texinfo.texi 823 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182
  1. \input texinfo.tex @c -*-texinfo-*-
  2. @c $Id$
  3. @c Everything between the start/end of header lines will be passed by
  4. @c Emacs's {texinfo,makeinfo}-format region commands. See the `start of
  5. @c header' node for more info.
  6. @c %**start of header
  7. @c Automake requires this
  8. @setfilename texinfo.info
  9. @c Automake automatically updates version.texi to @set VERSION and
  10. @c @set UPDATED to appropriate values.
  11. @include version.texi
  12. @settitle GNU Texinfo @value{VERSION}
  13. @c Define a new index for command-line options.
  14. @defcodeindex op
  15. @c Put everything except function (command, in this case) names in one
  16. @c index (arbitrarily chosen to be the concept index).
  17. @syncodeindex op cp
  18. @syncodeindex vr cp
  19. @syncodeindex pg cp
  20. @tex
  21. \global\usebracesinindexestrue
  22. @end tex
  23. @c finalout
  24. @comment %**end of header
  25. @copying
  26. This manual is for GNU Texinfo (version @value{VERSION}, @value{UPDATED}),
  27. a documentation system that can produce both online information and a
  28. printed manual from a single source using semantic markup.
  29. Copyright @copyright{} 1988, 1990, 1991, 1992, 1993, 1995, 1996, 1997,
  30. 1998, 1999, 2001, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
  31. 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free Software Foundation, Inc.
  32. @quotation
  33. Permission is granted to copy, distribute and/or modify this document
  34. under the terms of the GNU Free Documentation License, Version 1.3 or
  35. any later version published by the Free Software Foundation; with no
  36. Invariant Sections, with the Front-Cover Texts being ``A GNU Manual'',
  37. and with the Back-Cover Texts as in (a) below. A copy of the license
  38. is included in the section entitled ``GNU Free Documentation
  39. License''.
  40. (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
  41. modify this GNU manual. Buying copies from the FSF supports it in
  42. developing GNU and promoting software freedom.''
  43. @end quotation
  44. @end copying
  45. @dircategory Texinfo documentation system
  46. @direntry
  47. * Texinfo: (texinfo). The GNU documentation format.
  48. * install-info: (texinfo)Invoking install-info. Update info/dir entries.
  49. * makeinfo: (texinfo)Invoking makeinfo. Translate Texinfo source.
  50. * pod2texi: (pod2texi)Invoking pod2texi. Translate Perl POD to Texinfo.
  51. * texi2dvi: (texinfo)Format with texi2dvi. Print Texinfo documents.
  52. * texi2pdf: (texinfo)PDF Output. PDF output for Texinfo.
  53. * pdftexi2dvi: (texinfo)PDF Output. PDF output for Texinfo.
  54. * texindex: (texinfo)Format with tex/texindex. Sort Texinfo index files.
  55. @end direntry
  56. @c Set smallbook if printing in smallbook format so the example of the
  57. @c smallbook font is actually written using smallbook; in bigbook, a kludge
  58. @c is used for TeX output. Do this through the -t option to texi2dvi,
  59. @c so this same source can be used for other paper sizes as well.
  60. @c smallbook
  61. @c set smallbook
  62. @c @@clear smallbook
  63. @c If you like blank pages, add through texi2dvi -t.
  64. @c setchapternewpage odd
  65. @set txiindexatsignignore
  66. @set txiindexbackslashignore
  67. @set txiindexlessthanignore
  68. @set txiindexhyphenignore
  69. @titlepage
  70. @title Texinfo
  71. @subtitle The GNU Documentation Format
  72. @subtitle for Texinfo version @value{VERSION}, @value{UPDATED}
  73. @author Robert J. Chassell
  74. @author Richard M. Stallman
  75. @c Include the Distribution inside the titlepage so
  76. @c that headings are turned off.
  77. @page
  78. @vskip 0pt plus 1filll
  79. @insertcopying
  80. @sp 1
  81. Published by the Free Software Foundation @*
  82. 51 Franklin St, Fifth Floor @*
  83. Boston, MA 02110-1301 @*
  84. USA @*
  85. ISBN 1-882114-67-1 @c for version 4.0, September 1999.
  86. @c ISBN 1-882114-65-5 is for version 3.12, March 1998.
  87. @c ISBN 1-882114-64-7 is for edition 2.24 of November 1996.
  88. @c ISBN 1-882114-63-9 is for edition 2.20 of 28 February 1995.
  89. @sp 1
  90. Cover art by Etienne Suvasa.
  91. @end titlepage
  92. @summarycontents
  93. @contents
  94. @ifnottex
  95. @node Top
  96. @top Texinfo
  97. This manual is for GNU Texinfo (version @value{VERSION}, @value{UPDATED}),
  98. a documentation system that can produce both online information and a
  99. printed manual from a single source using semantic markup.
  100. The first part of this master menu lists the major nodes in this Info
  101. document, including the @@-command and concept indices. The rest of
  102. the menu lists all the lower-level nodes in the document.
  103. @end ifnottex
  104. @menu
  105. * Copying Conditions:: Your rights.
  106. * Overview:: Texinfo in brief.
  107. * Writing a Texinfo File:: Format of a Texinfo source file.
  108. * Beginning and Ending a File:: Beginning and end of a Texinfo file.
  109. * Nodes:: Writing nodes, the basic unit of Texinfo.
  110. * Chapter Structuring:: Creating chapters, sections, appendices, etc.
  111. * Cross References:: Writing cross-references.
  112. * Marking Text:: Marking words and phrases as code,
  113. keyboard input, meta-syntactic
  114. variables, and the like.
  115. * Quotations and Examples:: Block quotations, examples, etc.
  116. * Lists and Tables:: Itemized or numbered lists, and tables.
  117. * Special Displays:: Floating figures and footnotes.
  118. * Indices:: Creating indices.
  119. * Insertions:: Inserting @@-signs, braces, etc.
  120. * Breaks:: Forcing or preventing line and page breaks.
  121. * Definition Commands:: Describing functions and the like uniformly.
  122. * Internationalization:: Supporting languages other than English.
  123. * Conditionals:: Specifying text for only some output cases.
  124. * Defining New Texinfo Commands:: User-defined macros and aliases.
  125. * Include Files:: How to incorporate other Texinfo files.
  126. * Hardcopy:: Output for paper, with @TeX{}.
  127. * Generic Translator @command{texi2any}:: @command{texi2any}, an all-purpose converter.
  128. * Creating and Installing Info Files:: Details on Info output.
  129. * Generating HTML:: Details on HTML output.
  130. @c * texi2any Output Customization:: Fine tuning with initialization files.
  131. Appendices
  132. * @@-Command Details:: Details of the Texinfo @@-commands.
  133. * Tips:: Hints on how to write a Texinfo document.
  134. * Sample Texinfo Files:: Complete examples, including full texts.
  135. * Texinfo Mode:: Using the GNU Emacs Texinfo mode.
  136. * Headings:: How to write page headings and footings.
  137. * Catching Mistakes:: How to find mistakes in formatting.
  138. * Info Format Specification:: Technical details of the Info file format.
  139. * GNU Free Documentation License:: Copying this manual.
  140. * Command and Variable Index:: A menu containing commands and variables.
  141. * General Index:: A menu covering many topics.
  142. @detailmenu
  143. --- The Detailed Node Listing ---
  144. Overview of Texinfo
  145. * Reporting Bugs:: Submitting effective bug reports.
  146. * Output Formats:: Overview of the supported output formats.
  147. * Info Files:: What is an Info file?
  148. * Printed Books:: Characteristics of a printed book or manual.
  149. * Adding Output Formats:: Man pages and implementing new formats.
  150. * History:: Acknowledgements, contributors and genesis.
  151. Writing a Texinfo File
  152. * Command Syntax:: @@-commands are used for formatting.
  153. * Conventions:: General rules for writing a Texinfo file.
  154. * Comments:: Writing comments and ignored text in general.
  155. * Minimum:: What a Texinfo file must have.
  156. * Short Sample:: A short sample Texinfo file.
  157. Beginning and Ending a Texinfo File
  158. * Sample Beginning:: A sample beginning for a Texinfo file.
  159. * Texinfo File Header:: The first lines.
  160. * Document Permissions:: Ensuring your manual is free.
  161. * Titlepage & Copyright Page:: Creating the title and copyright pages.
  162. * Contents:: How to create a table of contents.
  163. * The Top Node:: Creating the `Top' node and master menu.
  164. * Global Document Commands:: Affecting formatting throughout.
  165. * Ending a File:: What is at the end of a Texinfo file?
  166. Texinfo File Header
  167. * First Line:: The first line of a Texinfo file.
  168. * Start of Header:: Formatting a region requires this.
  169. * @code{@@setfilename}:: Tell Info the name of the Info file.
  170. * @code{@@settitle}:: Create a title for the printed work.
  171. * End of Header:: Formatting a region requires this.
  172. Document Permissions
  173. * @code{@@copying}:: Declare the document's copying permissions.
  174. * @code{@@insertcopying}:: Where to insert the permissions.
  175. Title and Copyright Pages
  176. * @code{@@titlepage}:: Create a title for the printed document.
  177. * @code{@@titlefont @@center @@sp}:: The @code{@@titlefont}, @code{@@center},
  178. and @code{@@sp} commands.
  179. * @code{@@title @@subtitle @@author}:: The @code{@@title}, @code{@@subtitle},
  180. and @code{@@author} commands.
  181. * Copyright:: How to write the copyright notice and
  182. include copying permissions.
  183. * Heading Generation:: Turn on page headings after the title and
  184. copyright pages.
  185. The `Top' Node and Master Menu
  186. * Top Node Example::
  187. * Master Menu Parts::
  188. Global Document Commands
  189. * @code{@@documentdescription}:: Document summary for the HTML output.
  190. * @code{@@setchapternewpage}:: Start chapters on right-hand pages.
  191. * @code{@@headings}:: An option for turning headings on and off
  192. and double or single sided printing.
  193. * @code{@@paragraphindent}:: Specify paragraph indentation.
  194. * @code{@@firstparagraphindent}:: Suppressing first paragraph indentation.
  195. * @code{@@exampleindent}:: Specify environment indentation.
  196. Nodes
  197. * Texinfo Document Structure:: How Texinfo manuals are usually arranged.
  198. * Node Names:: How to choose node names.
  199. * Writing a Node:: How to write an @code{@@node} line.
  200. * Node Line Requirements:: Keep names unique.
  201. * First Node:: How to write a `Top' node.
  202. * @code{@@top} Command:: How to use the @code{@@top} command.
  203. * Node Menu Illustration:: A diagram, and sample nodes and menus.
  204. * @command{makeinfo} Pointer Creation:: Letting makeinfo determine node pointers.
  205. * Menus:: Listing subordinate nodes.
  206. Menus
  207. * Writing a Menu:: What is a menu?
  208. * Menu Example:: Two and three part menu entries.
  209. * Menu Location:: Menus go at the ends of nodes.
  210. * Menu Parts:: A menu entry has three parts.
  211. * Less Cluttered Menu Entry:: Two part menu entry.
  212. * Other Info Files:: How to refer to a different Info file.
  213. Chapter Structuring
  214. * Tree Structuring:: A manual is like an upside down tree @dots{}
  215. * Structuring Command Types:: How to divide a manual into parts.
  216. * @code{@@chapter}:: Chapter structuring.
  217. * @code{@@unnumbered @@appendix}::
  218. * @code{@@majorheading @@chapheading}::
  219. * @code{@@section}::
  220. * @code{@@unnumberedsec @@appendixsec @@heading}::
  221. * @code{@@subsection}::
  222. * @code{@@unnumberedsubsec @@appendixsubsec @@subheading}::
  223. * @code{@@subsubsection}:: Commands for the lowest level sections.
  224. * @code{@@part}:: Collections of chapters.
  225. * Raise/lower sections:: How to change commands' hierarchical level.
  226. Cross-references
  227. * References:: What cross-references are for.
  228. * Cross Reference Commands:: A summary of the different commands.
  229. * Cross Reference Parts:: A cross-reference has several parts.
  230. * @code{@@xref}:: Begin a reference with `See' @dots{}
  231. * Referring to a Manual as a Whole:: Refer to an entire manual.
  232. * @code{@@ref}:: A reference for the last part of a sentence.
  233. * @code{@@pxref}:: How to write a parenthetical cross-reference.
  234. * @code{@@anchor}:: Defining arbitrary cross-reference targets
  235. * @code{@@inforef}:: How to refer to an Info-only file.
  236. * @code{@@url}:: How to refer to a uniform resource locator.
  237. * @code{@@cite}:: How to refer to books not in the Info system.
  238. @code{@@xref}
  239. * One Argument:: @code{@@xref} with one argument.
  240. * Two Arguments:: @code{@@xref} with two arguments.
  241. * Three Arguments:: @code{@@xref} with three arguments.
  242. * Four and Five Arguments:: @code{@@xref} with four and five arguments.
  243. @code{@@url}, @code{@@uref@{@var{url}[, @var{text}][, @var{replacement}]@}}
  244. * @code{@@url} Examples:: Examples of using all the forms of @code{@@url}.
  245. * URL Line Breaking:: How lines are broken within @code{@@url} text.
  246. * @code{@@url} PDF Output Format:: A special option to hide links in PDF output.
  247. * PDF Colors:: Colorizing urls and other links in PDF output.
  248. Marking Text, Words and Phrases
  249. * Indicating:: How to indicate definitions, files, etc.
  250. * Emphasis:: How to emphasize text.
  251. Indicating Definitions, Commands, etc.
  252. * Useful Highlighting:: Highlighting provides useful information.
  253. * @code{@@code}:: Indicating program code.
  254. * @code{@@kbd}:: Showing keyboard input.
  255. * @code{@@key}:: Specifying keys.
  256. * @code{@@samp}:: Indicating a literal sequence of characters.
  257. * @code{@@verb}:: Indicating a verbatim sequence of characters.
  258. * @code{@@var}:: Indicating metasyntactic variables.
  259. * @code{@@env}:: Indicating environment variables.
  260. * @code{@@file}:: Indicating file names.
  261. * @code{@@command}:: Indicating command names.
  262. * @code{@@option}:: Indicating option names.
  263. * @code{@@dfn}:: Specifying definitions.
  264. * @code{@@abbr}:: Indicating abbreviations.
  265. * @code{@@acronym}:: Indicating acronyms.
  266. * @code{@@indicateurl}:: Indicating an example url.
  267. * @code{@@email}:: Indicating an electronic mail address.
  268. Emphasizing Text
  269. * @code{@@emph @@strong}:: How to emphasize text in Texinfo.
  270. * Smallcaps:: How to use the small caps font.
  271. * Fonts:: Various font commands for printed output.
  272. Quotations and Examples
  273. * Block Enclosing Commands:: Different constructs for different purposes.
  274. * @code{@@quotation}:: Writing a quotation.
  275. * @code{@@indentedblock}:: Block of text indented on left.
  276. * @code{@@example}:: Writing an example in a fixed-width font.
  277. * @code{@@verbatim}:: Writing a verbatim example.
  278. * @code{@@verbatiminclude}:: Including a file verbatim.
  279. * @code{@@lisp}:: Illustrating Lisp code.
  280. * @code{@@small@dots{}}:: Examples in a smaller font.
  281. * @code{@@display}:: Writing an example in the current font.
  282. * @code{@@format}:: Writing an example without narrowed margins.
  283. * @code{@@exdent}:: Undo indentation on a line.
  284. * @code{@@flushleft @@flushright}:: Pushing text flush left or flush right.
  285. * @code{@@raggedright}:: Avoiding justification on the right.
  286. * @code{@@noindent}:: Preventing paragraph indentation.
  287. * @code{@@indent}:: Forcing paragraph indentation.
  288. * @code{@@cartouche}:: Drawing rounded rectangles around text.
  289. Lists and Tables
  290. * Introducing Lists:: Texinfo formats lists for you.
  291. * @code{@@itemize}:: How to construct a simple list.
  292. * @code{@@enumerate}:: How to construct a numbered list.
  293. * Two-column Tables:: How to construct a two-column table.
  294. * Multi-column Tables:: How to construct generalized tables.
  295. Making a Two-column Table
  296. * @code{@@table}:: How to construct a two-column table.
  297. * @code{@@ftable @@vtable}:: Automatic indexing for two-column tables.
  298. * @code{@@itemx}:: How to put more entries in the first column.
  299. @code{@@multitable}: Multi-column Tables
  300. * Multitable Column Widths:: Defining multitable column widths.
  301. * Multitable Rows:: Defining multitable rows, with examples.
  302. Special Displays
  303. * Floats:: Figures, tables, and the like.
  304. * Images:: Including graphics and images.
  305. * Footnotes:: Writing footnotes.
  306. Floats
  307. * @code{@@float}:: Producing floating material.
  308. * @code{@@caption @@shortcaption}:: Specifying descriptions for floats.
  309. * @code{@@listoffloats}:: A table of contents for floats.
  310. Inserting Images
  311. * Image Syntax::
  312. * Image Scaling::
  313. Footnotes
  314. * Footnote Commands:: How to write a footnote in Texinfo.
  315. * Footnote Styles:: Controlling how footnotes appear in Info.
  316. Indices
  317. * Index Entries:: Choose different words for index entries.
  318. * Predefined Indices:: Use different indices for different kinds
  319. of entries.
  320. * Indexing Commands:: How to make an index entry.
  321. * Printing Indices & Menus:: How to print an index in hardcopy and
  322. generate index menus in Info.
  323. * Combining Indices:: How to combine indices.
  324. * New Indices:: How to define your own indices.
  325. Combining Indices
  326. * @code{@@syncodeindex}:: How to merge two indices, using @code{@@code}
  327. font for the merged-from index.
  328. * @code{@@synindex}:: How to merge two indices, using the
  329. roman font for the merged-from index.
  330. Special Insertions
  331. * Special Characters:: Inserting @@ @{@} , \ #
  332. * Inserting Quote Characters:: Inserting left and right quotes, in code.
  333. * Inserting Space:: Inserting the right amount of whitespace.
  334. * Inserting Accents:: Inserting accents and special characters.
  335. * Inserting Quotation Marks:: Inserting quotation marks.
  336. * Inserting Subscripts and Superscripts:: Inserting sub/superscripts.
  337. * Inserting Math:: Formatting mathematical expressions.
  338. * Glyphs for Text:: Inserting dots, bullets, currencies, etc.
  339. * Glyphs for Programming:: Indicating results of evaluation,
  340. expansion of macros, errors, etc.
  341. * Inserting Unicode:: Inserting a Unicode character by code point.
  342. Special Characters: Inserting @@ @{@} , \ #
  343. * Inserting an Atsign:: @code{@@@@}, @code{@@atchar@{@}}.
  344. * Inserting Braces:: @code{@@@{ @@@}}, @code{@@l rbracechar@{@}}.
  345. * Inserting a Comma:: , and @code{@@comma@{@}}.
  346. * Inserting a Backslash:: \ and @code{@@backslashchar@{@}}.
  347. * Inserting a Hashsign:: # and @code{@@hashchar@{@}}.
  348. Inserting Space
  349. * Multiple Spaces:: Inserting multiple spaces.
  350. * Not Ending a Sentence:: Sometimes a . doesn't end a sentence.
  351. * Ending a Sentence:: Sometimes it does.
  352. * @code{@@frenchspacing}:: Specifying end-of-sentence spacing.
  353. * @code{@@dmn}:: Formatting a dimension.
  354. Glyphs for Text
  355. * @code{@@TeX @@LaTeX}:: The @TeX{} logos.
  356. * @code{@@copyright}:: The copyright symbol (c in a circle).
  357. * @code{@@registeredsymbol}:: The registered symbol (R in a circle).
  358. * @code{@@dots}:: How to insert ellipses: @dots{} and @enddots{}
  359. * @code{@@bullet}:: How to insert a bullet: @bullet{}
  360. * @code{@@euro}:: How to insert the euro currency symbol.
  361. * @code{@@pounds}:: How to insert the pounds currency symbol.
  362. * @code{@@textdegree}:: How to insert the degrees symbol.
  363. * @code{@@minus}:: How to insert a minus sign.
  364. * @code{@@geq @@leq}:: How to insert greater/less-than-or-equal signs.
  365. Glyphs for Programming
  366. * Glyphs Summary::
  367. * @code{@@result}:: How to show the result of expression.
  368. * @code{@@expansion}:: How to indicate an expansion.
  369. * @code{@@print}:: How to indicate generated output.
  370. * @code{@@error}:: How to indicate an error message.
  371. * @code{@@equiv}:: How to indicate equivalence.
  372. * @code{@@point}:: How to indicate the location of point.
  373. * Click Sequences:: Inserting GUI usage sequences.
  374. Forcing and Preventing Breaks
  375. * Break Commands:: Summary of break-related commands.
  376. * Line Breaks:: Forcing line breaks.
  377. * @code{@@- @@hyphenation}:: Helping @TeX{} with hyphenation points.
  378. * @code{@@allowcodebreaks}:: Controlling line breaks within @@code text.
  379. * @code{@@w}:: Preventing unwanted line breaks in text.
  380. * @code{@@tie}:: Inserting an unbreakable but varying space.
  381. * @code{@@sp}:: Inserting blank lines.
  382. * @code{@@page}:: Forcing the start of a new page.
  383. * @code{@@group}:: Preventing unwanted page breaks.
  384. * @code{@@need}:: Another way to prevent unwanted page breaks.
  385. Definition Commands
  386. * Def Cmd Template:: Writing descriptions using definition commands.
  387. * Def Cmd Continuation Lines:: Continuing the heading over source lines.
  388. * Optional Arguments:: Handling optional and repeated arguments.
  389. * @code{@@deffnx}:: Group two or more `first' lines.
  390. * Def Cmds in Detail:: Reference for all the definition commands.
  391. * Def Cmd Conventions:: Conventions for writing definitions.
  392. * Sample Function Definition:: An example.
  393. The Definition Commands
  394. * Functions Commands:: Commands for functions and similar entities.
  395. * Variables Commands:: Commands for variables and similar entities.
  396. * Typed Functions:: Commands for functions in typed languages.
  397. * Typed Variables:: Commands for variables in typed languages.
  398. * Data Types:: The definition command for data types.
  399. * Abstract Objects:: Commands for object-oriented programming.
  400. Object-Oriented Programming
  401. * Variables: Object-Oriented Variables.
  402. * Methods: Object-Oriented Methods.
  403. Internationalization
  404. * @code{@@documentlanguage}:: Declaring the current language.
  405. * @code{@@documentencoding}:: Declaring the input encoding.
  406. Conditionally Visible Text
  407. * Conditional Commands:: Text for a given format.
  408. * Conditional Not Commands:: Text for any format other than a given one.
  409. * Raw Formatter Commands:: Using raw formatter commands.
  410. * Inline Conditionals:: Brace-delimited conditional text.
  411. * @code{@@set @@clear @@value}:: Variable tests and substitutions.
  412. * Testing for Texinfo Commands:: Testing if a Texinfo command is available.
  413. * Conditional Nesting:: Using conditionals inside conditionals.
  414. Flags: @code{@@set}, @code{@@clear}, conditionals, and @code{@@value}
  415. * @code{@@set @@value}:: Expand a flag variable to a string.
  416. * @code{@@ifset @@ifclear}:: Format a region if a flag is set.
  417. * @code{@@inlineifset @@inlineifclear}:: Brace-delimited flag conditionals.
  418. * @code{@@value} Example:: An easy way to update edition information.
  419. Defining New Texinfo Commands
  420. * Defining Macros:: Defining and undefining new commands.
  421. * Invoking Macros:: Using a macro, once you've defined it.
  422. * Macro Details:: Limitations of Texinfo macros.
  423. * @code{@@alias}:: Command aliases.
  424. * @code{@@definfoenclose}:: Customized highlighting.
  425. * External Macro Processors:: @code{#line} directives.
  426. External Macro Processors: Line Directives
  427. * @samp{#line} Directive::
  428. * TeX: @samp{#line} and @TeX{}.
  429. * Syntax: @samp{#line} Syntax Details.
  430. Include Files
  431. * Using Include Files:: How to use the @code{@@include} command.
  432. * @code{texinfo-multiple-files-update}:: How to create and update nodes and
  433. menus when using included files.
  434. * Include Files Requirements:: @code{texinfo-multiple-files-update} needs.
  435. * Sample Include File:: A sample outer file with included files
  436. within it; and a sample included file.
  437. * Include Files Evolution:: How use of the @code{@@include} command
  438. has changed over time.
  439. Formatting and Printing Hardcopy
  440. * Use @TeX{}:: Use @TeX{} to format for hardcopy.
  441. * Format with @command{texi2dvi}:: The simplest way to format.
  442. * Format with @command{tex}/@command{texindex}:: Formatting with explicit shell commands.
  443. * Print with @command{lpr}:: How to print.
  444. * Within Emacs:: How to format and print from an Emacs shell.
  445. * Texinfo Mode Printing:: How to format and print in Texinfo mode.
  446. * Compile-Command:: How to print using Emacs's compile command.
  447. * Requirements Summary:: @TeX{} formatting requirements summary.
  448. * Preparing for @TeX{}:: What to do before you use @TeX{}.
  449. * Overfull hboxes:: What are and what to do with overfull hboxes.
  450. * @code{@@smallbook}:: How to print small format books and manuals.
  451. * A4 Paper:: How to print on A4 or A5 paper.
  452. * @code{@@pagesizes}:: How to print with customized page sizes.
  453. * Cropmarks and Magnification:: How to print marks to indicate the size
  454. of pages and how to print scaled up output.
  455. * PDF Output:: Portable Document Format output.
  456. * Obtaining @TeX{}:: How to obtain @TeX{}.
  457. Format with @command{tex}/@command{texindex}
  458. * Formatting Partial Documents::
  459. * Details of @command{texindex}::
  460. @command{texi2any}: The Generic Translator for Texinfo
  461. * Reference Implementation:: @command{texi2any}: the reference implementation.
  462. * Invoking @command{texi2any}:: Running the translator from a shell.
  463. * @command{texi2any} Environment Variables::
  464. * @command{texi2any} Printed Output:: Calling @command{texi2dvi}.
  465. * Pointer Validation:: How to check that pointers point somewhere.
  466. * Customization Variables:: Configuring @command{texi2any}.
  467. * Internationalization of Document Strings:: Translating program-inserted text.
  468. * Invoking @command{pod2texi}:: Translating Perl pod to Texinfo.
  469. * @command{texi2html}:: An ancestor of @command{texi2any}.
  470. Customization Variables
  471. * Commands: Customization Variables for @@-Commands.
  472. * Options: Customization Variables and Options.
  473. * HTML: HTML Customization Variables.
  474. * Other: Other Customization Variables.
  475. Creating and Installing Info Files
  476. * Creating an Info File::
  477. * Installing an Info File::
  478. Creating an Info File
  479. * @command{makeinfo} Advantages:: @command{makeinfo} provides better error checking.
  480. * @code{makeinfo} in Emacs:: How to run @code{makeinfo} from Emacs.
  481. * @code{texinfo-format} commands:: Two Info formatting commands written
  482. in Emacs Lisp are an alternative
  483. to @code{makeinfo}.
  484. * Batch Formatting:: How to format for Info in Emacs batch mode.
  485. * Tag and Split Files:: How tagged and split files help Info
  486. to run better.
  487. Installing an Info File
  488. * Directory File:: The top level menu for all Info files.
  489. * New Info File:: Listing a new Info file.
  490. * Other Info Directories:: How to specify Info files that are
  491. located in other directories.
  492. * Installing Dir Entries:: How to specify what menu entry to add
  493. to the Info directory.
  494. * Invoking @command{install-info}:: @code{install-info} options.
  495. Generating HTML
  496. * HTML Translation:: Details of the HTML output.
  497. * HTML Splitting:: How HTML output is split.
  498. * HTML CSS:: Influencing HTML output with Cascading Style Sheets.
  499. * HTML Xref:: Cross-references in HTML output.
  500. HTML Cross-references
  501. * Link Basics: HTML Xref Link Basics.
  502. * Node Expansion: HTML Xref Node Name Expansion.
  503. * Command Expansion: HTML Xref Command Expansion.
  504. * 8-bit Expansion: HTML Xref 8-bit Character Expansion.
  505. * Mismatch: HTML Xref Mismatch.
  506. * Configuration: HTML Xref Configuration. htmlxref.cnf.
  507. * Preserving links: HTML Xref Link Preservation. MANUAL-noderename.cnf.
  508. Sample Texinfo Files
  509. * Short Sample Texinfo File::
  510. * GNU Sample Texts::
  511. * Verbatim Copying License::
  512. * All-permissive Copying License::
  513. Using Texinfo Mode
  514. * Texinfo Mode Overview:: How Texinfo mode can help you.
  515. * Emacs Editing:: Texinfo mode adds to GNU Emacs' general
  516. purpose editing features.
  517. * Inserting:: How to insert frequently used @@-commands.
  518. * Showing the Structure:: How to show the structure of a file.
  519. * Updating Nodes and Menus:: How to update or create new nodes and menus.
  520. * Info Formatting:: How to format for Info.
  521. * Printing:: How to format and print part or all of a file.
  522. * Texinfo Mode Summary:: Summary of all the Texinfo mode commands.
  523. Updating Nodes and Menus
  524. * Updating Commands:: Five major updating commands.
  525. * Updating Requirements:: How to structure a Texinfo file for
  526. using the updating command.
  527. * Other Updating Commands:: How to indent descriptions, insert
  528. missing nodes lines, and update
  529. nodes in sequence.
  530. Page Headings
  531. * Headings Introduced:: Conventions for using page headings.
  532. * Heading Format:: Standard page heading formats.
  533. * Heading Choice:: How to specify the type of page heading.
  534. * Custom Headings:: How to create your own headings and footings.
  535. Catching Mistakes
  536. * @command{makeinfo} Preferred:: @code{makeinfo} finds errors.
  537. * Debugging with Info:: How to catch errors with Info formatting.
  538. * Debugging with @TeX{}:: How to catch errors with @TeX{} formatting.
  539. * Using @code{texinfo-show-structure}:: How to use @code{texinfo-show-structure}.
  540. * Using @code{occur}:: How to list all lines containing a pattern.
  541. * Running @code{Info-validate}:: How to find badly referenced nodes.
  542. Finding Badly Referenced Nodes
  543. * Using @code{Info-validate}:: How to run @code{Info-validate}.
  544. * Unsplit:: How to create an unsplit file.
  545. * Tagifying:: How to tagify a file.
  546. * Splitting:: How to split a file manually.
  547. Info Format Specification
  548. * General: Info Format General Layout.
  549. * Text: Info Format Text Constructs.
  550. Info Format General Layout
  551. * Whole: Info Format Whole Manual. Split vs.@: nonsplit manuals.
  552. * Preamble: Info Format Preamble.
  553. * Indirect: Info Format Indirect Table.
  554. * Tag table: Info Format Tag Table.
  555. * Local variables: Info Format Local Variables.
  556. * Regular nodes: Info Format Regular Nodes.
  557. Info Format Text Constructs
  558. * Info Format Menu::
  559. * Info Format Image::
  560. * Info Format Printindex::
  561. * Info Format Cross Reference::
  562. @end detailmenu
  563. @end menu
  564. @c Reward readers for getting to the end of the menu :).
  565. @c Contributed by Arnold Robbins.
  566. @quotation
  567. Documentation is like sex: when it is good, it is very, very good; and
  568. when it is bad, it is better than nothing.
  569. ---Dick Brandon
  570. @end quotation
  571. @node Copying Conditions
  572. @unnumbered Texinfo Copying Conditions
  573. @cindex Copying conditions
  574. @cindex Conditions for copying Texinfo
  575. @cindex Free software
  576. @cindex Libre software
  577. GNU Texinfo is @dfn{free software}; this means that everyone is free
  578. to use it and free to redistribute it on certain conditions. Texinfo
  579. is not in the public domain; it is copyrighted and there are
  580. restrictions on its distribution, but these restrictions are designed
  581. to permit everything that a good cooperating citizen would want to do.
  582. What is not allowed is to try to prevent others from further sharing
  583. any version of Texinfo that they might get from you.
  584. Specifically, we want to make sure that you have the right to give away
  585. copies of the programs that relate to Texinfo, that you receive source
  586. code or else can get it if you want it, that you can change these
  587. programs or use pieces of them in new free programs, and that you know
  588. you can do these things.
  589. To make sure that everyone has such rights, we have to forbid you to
  590. deprive anyone else of these rights. For example, if you distribute
  591. copies of the Texinfo related programs, you must give the recipients all
  592. the rights that you have. You must make sure that they, too, receive or
  593. can get the source code. And you must tell them their rights.
  594. Also, for our own protection, we must make certain that everyone finds
  595. out that there is no warranty for the programs that relate to Texinfo.
  596. If these programs are modified by someone else and passed on, we want
  597. their recipients to know that what they have is not what we distributed,
  598. so that any problems introduced by others will not reflect on our
  599. reputation.
  600. The precise conditions of the licenses for the programs currently
  601. being distributed that relate to Texinfo are found in the General
  602. Public Licenses that accompany them. This manual is covered by the
  603. GNU Free Documentation License (@pxref{GNU Free Documentation
  604. License}).
  605. @node Overview
  606. @chapter Overview of Texinfo
  607. @cindex Overview of Texinfo
  608. @cindex Texinfo overview
  609. @cindex Using Texinfo in general
  610. @cindex Texinfo, introduction to
  611. @cindex Introduction to Texinfo
  612. @anchor{Using Texinfo} @c merged node
  613. @dfn{Texinfo} is a documentation system that uses a single source file
  614. to produce both online information and printed output. This means
  615. that instead of writing several different documents, one for each output
  616. format, you need only write one document.
  617. Using Texinfo, you can create a printed document (via the @TeX{}
  618. typesetting system) in PDF or PostScript format, including chapters,
  619. sections, cross-references, and indices. From the same Texinfo source
  620. file, you can create an HTML output file suitable for use with a web
  621. browser, you can create an Info file with special features to make
  622. browsing documentation easy, and also create a Docbook file or a
  623. transliteration to XML format.
  624. @cindex Source file format
  625. @cindex Semantic markup
  626. A Texinfo source file is a plain text file containing text interspersed
  627. with @dfn{@@-commands} (words preceded by an @samp{@@}) that tell the
  628. Texinfo processors what to do. Texinfo's markup commands are almost
  629. entirely @dfn{semantic}; that is, they specify the intended meaning
  630. of text in the document, rather than physical formatting instructions.
  631. You can edit a Texinfo file with any text editor, but it is especially
  632. convenient to use GNU Emacs since that editor has a special mode,
  633. called Texinfo mode, that provides various Texinfo-related features.
  634. (@xref{Texinfo Mode}.)
  635. @cindex Limited scope of Texinfo
  636. Texinfo was devised specifically for the purpose of writing software
  637. documentation and manuals. If you want to write a good manual for
  638. your program, Texinfo has many features which we hope will make your
  639. job easier. However, it provides almost no commands for controlling
  640. the final formatting. Texinfo is not intended to be a general-purpose
  641. formatting program, so if you need to lay out a newspaper, devise a
  642. glossy magazine ad, or follow the exact formatting requirements of
  643. a publishing house, Texinfo may not be the simplest tool.
  644. @cindex Spelling of Texinfo
  645. @cindex Pronunciation of Texinfo
  646. Spell ``Texinfo'' with a capital ``T'' and the other letters in
  647. lowercase. The first syllable of ``Texinfo'' is pronounced like
  648. ``speck'', not ``hex''. This odd pronunciation is derived from the
  649. pronunciation of @TeX{}. Pronounce @TeX{} as if the @samp{X} were
  650. the last sound in the name `Bach'. In the word @TeX{}, the @samp{X}
  651. is, rather than the English letter ``ex'', actually the Greek letter
  652. ``chi''.
  653. Texinfo is the official documentation format of the GNU project.
  654. More information, including manuals for GNU packages, is available
  655. at the @uref{http://www.gnu.org/doc/, GNU documentation web page}.
  656. @menu
  657. * Reporting Bugs:: Submitting effective bug reports.
  658. * Output Formats:: Overview of the supported output formats.
  659. * Info Files:: What is an Info file?
  660. * Printed Books:: Characteristics of a printed book or manual.
  661. * Adding Output Formats:: Man pages and implementing new formats.
  662. * History:: Acknowledgements, contributors and genesis.
  663. @end menu
  664. @node Reporting Bugs
  665. @section Reporting Bugs
  666. @cindex Bugs, reporting
  667. @cindex Suggestions for Texinfo, making
  668. @cindex Reporting bugs
  669. We welcome bug reports and suggestions for any aspect of the Texinfo
  670. system: programs, documentation, installation, etc. Please email them
  671. to @email{bug-texinfo@@gnu.org}. You can get the latest version of
  672. Texinfo via its home page, @uref{http://www.gnu.org/software/texinfo}.
  673. @cindex Checklist for bug reports
  674. For bug reports, please include enough information for the maintainers
  675. to reproduce the problem. Generally speaking, that means:
  676. @itemize @bullet
  677. @item The version number of Texinfo and the program(s) or manual(s) involved.
  678. @item The contents of any input files necessary to reproduce the bug.
  679. @item Precisely how you ran any program(s) involved.
  680. @item A description of the problem and samples of any erroneous output.
  681. @item Hardware and operating system names and versions.
  682. @item Anything else that you think would be helpful.
  683. @end itemize
  684. When in doubt whether something is needed or not, include it. It's
  685. better to include too much than to leave out something important.
  686. It is critical to send an actual input file that reproduces the
  687. problem. What's not critical is to ``narrow down'' the example to the
  688. smallest possible input---the actual input with which you discovered
  689. the bug will suffice. (Of course, if you do do experiments, the
  690. smaller the input file, the better.)
  691. @cindex Patches, contributing
  692. Patches are most welcome; if possible, please make them with
  693. @samp{@w{diff -c}} (@pxref{Top,,, diffutils, Comparing and Merging
  694. Files}) and include @file{ChangeLog} entries (@pxref{Change Log,,,
  695. emacs, The GNU Emacs Manual}), and follow the existing coding style.
  696. @node Output Formats
  697. @section Output Formats
  698. @cindex Output formats
  699. @cindex Back-end output formats
  700. Here is a brief overview of the output formats currently supported by
  701. Texinfo.
  702. @table @asis
  703. @item Info
  704. @cindex Info output, overview
  705. (Generated via @command{makeinfo}.) Info format is mostly a plain
  706. text transliteration of the Texinfo source. It adds a few control
  707. characters to provide navigational information for cross-references,
  708. indices, and so on. The Emacs Info subsystem (@pxref{Top,,, info,
  709. Info}), and the standalone @command{info} program (@pxref{Top,,,
  710. info-stnd, GNU Info}), among others, can read these files. @xref{Info
  711. Files}, and @ref{Creating and Installing Info Files}.
  712. @item Plain text
  713. @cindex Plain text output, overview
  714. (Generated via @command{makeinfo --plaintext}.) This is almost the
  715. same as Info output with the navigational control characters are
  716. omitted.
  717. @item HTML
  718. @cindex HTML output, overview
  719. @cindex W3 consortium
  720. @cindex Mozilla
  721. @cindex Lynx
  722. @cindex Emacs-W3
  723. (Generated via @command{makeinfo --html}.) HTML, standing for Hyper
  724. Text Markup Language, has become the most commonly used language for
  725. writing documents on the World Wide Web. Web browsers, such as
  726. Mozilla, Lynx, and Emacs-W3, can render this language online. There
  727. are many versions of HTML, both different standards and
  728. browser-specific variations. @command{makeinfo} tries to use a subset
  729. of the language that can be interpreted by any common browser,
  730. intentionally not using many newer or less widely-supported tags.
  731. Although the native output is thus rather plain, it can be customized
  732. at various levels, if desired. For details of the HTML language and
  733. much related information, see @uref{http://www.w3.org/MarkUp/}.
  734. @xref{Generating HTML}.
  735. @item DVI
  736. @cindex DVI output, overview
  737. @pindex dvips
  738. @pindex xdvi
  739. (Generated via @command{texi2dvi}.) The DeVIce Independent binary
  740. format is output by the @TeX{} typesetting program
  741. (@uref{http://tug.org}). This is then read by a DVI `driver', which
  742. knows the actual device-specific commands that can be viewed or
  743. printed, notably Dvips for translation to PostScript (@pxref{Top,,,
  744. dvips, Dvips}) and Xdvi for viewing on an X display
  745. (@uref{http://sourceforge.net/projects/xdvi/}). @xref{Hardcopy}.
  746. (Be aware that the Texinfo language is very different from and much
  747. stricter than @TeX{}'s usual languages: plain @TeX{}, @LaTeX{},
  748. Con@TeX{}t, etc.)
  749. @item PostScript
  750. @cindex PostScript output, overview
  751. (Generated via @command{texi2dvi --ps}.) PostScript is a page
  752. description language that became widely used around 1985 and is still
  753. used today. @uref{http://en.wikipedia.org/wiki/PostScript} gives a
  754. basic description and more preferences. By default, Texinfo uses the
  755. @command{dvips} program to convert @TeX{}'s DVI output to PostScript.
  756. @xref{Top,,, dvips, Dvips}.
  757. @item PDF
  758. @cindex PDF output, overview
  759. @cindex Beebe, Nelson
  760. (Generated via @command{texi2dvi --pdf} or @command{texi2pdf}.) This
  761. format was developed by Adobe Systems for portable document
  762. interchange, based on their previous PostScript language. It can
  763. represent the exact appearance of a document, including fonts and
  764. graphics, and supporting arbitrary scaling. It is intended to be
  765. platform-independent and easily viewable, among other design goals;
  766. @uref{http://en.wikipedia.org/wiki/Portable_Document_Format} and
  767. @uref{http://tug.org/TUGboat/tb22-3/tb72beebe-pdf.pdf} have some
  768. background. By default, Texinfo uses the @command{pdftex} program, an
  769. extension of @TeX{}, to output PDF; see
  770. @uref{http://tug.org/applications/pdftex}. @xref{PDF Output}.
  771. @item Docbook
  772. @cindex Docbook output, overview
  773. @cindex XML Docbook output, overview
  774. (Generated via @command{makeinfo --docbook}.) This is an XML-based
  775. format developed some years ago, primarily for technical
  776. documentation. It therefore bears some resemblance, in broad
  777. outline, to Texinfo. See @uref{http://www.docbook.org}. Various
  778. converters from Docbook @emph{to} Texinfo have also been developed;
  779. see the Texinfo web pages.
  780. @item XML
  781. @cindex XML Texinfo output, overview
  782. @cindex Texinfo XML output, overview
  783. @cindex DTD, for Texinfo XML
  784. @pindex texinfo.dtd
  785. @pindex txixml2texi
  786. (Generated via @command{makeinfo --xml}.) XML is a generic syntax
  787. specification usable for any sort of content (a reference is at
  788. @uref{http://www.w3.org/XML}). The @command{makeinfo} XML output,
  789. unlike all the other output formats, is a transliteration of the
  790. Texinfo source rather than processed output. That is, it translates
  791. the Texinfo markup commands into XML syntax, for further processing by
  792. XML tools. The XML contains enough information to recreate the
  793. original content, except for syntactic constructs such as Texinfo
  794. macros and conditionals. The Texinfo source distribution includes a
  795. utility script @file{txixml2texi} to do that backward transformation.
  796. The details of the output syntax are defined in an XML DTD as usual,
  797. which is contained in a file @file{texinfo.dtd} included in the
  798. Texinfo source distribution and available via the Texinfo web pages.
  799. Texinfo XML files, and XML files in general, cannot be viewed in
  800. typical web browsers; they won't follow the DTD reference and as a
  801. result will simply report a (misleading) syntax error.
  802. @end table
  803. @node Info Files
  804. @section Info Files
  805. @cindex Info files
  806. As mentioned above, Info format is mostly a plain text transliteration
  807. of the Texinfo source, with the addition of a few control characters
  808. to separate nodes and provide navigational information, so that
  809. Info-reading programs can operate on it.
  810. Info files are nearly always created by processing a Texinfo source
  811. document. @command{makeinfo}, also known as @command{texi2any}, is
  812. the principal command that converts a Texinfo file into an Info file;
  813. @pxref{Generic Translator @command{texi2any}}.
  814. Generally, you enter an Info file through a node that by convention is
  815. named `Top'. This node normally contains just a brief summary of the
  816. file's purpose, and a large menu through which the rest of the file is
  817. reached. From this node, you can either traverse the file
  818. systematically by going from node to node, or you can go to a specific
  819. node listed in the main menu, or you can search the index menus and then
  820. go directly to the node that has the information you want. Alternatively,
  821. with the standalone Info program, you can specify specific menu items on
  822. the command line (@pxref{Top,,, info, Info}).
  823. If you want to read through an Info file in sequence, as if it were a
  824. printed manual, you can hit @key{SPC} repeatedly, or you get the whole
  825. file with the advanced Info command @kbd{g *}. (@xref{Advanced,,
  826. Advanced Info commands, info, Info}.)
  827. The @file{dir} file in the @file{info} directory serves as the
  828. departure point for the whole Info system. From it, you can reach the
  829. `Top' nodes of each of the documents in a complete Info system.
  830. @cindex URI syntax for Info
  831. If you wish to refer to an Info file via a URI, you can use the
  832. (unofficial) syntax exemplified by the following. This works with
  833. Emacs/W3, for example:
  834. @example
  835. info:emacs#Dissociated%20Press
  836. info:///usr/info/emacs#Dissociated%20Press
  837. info://localhost/usr/info/emacs#Dissociated%20Press
  838. @end example
  839. The @command{info} program itself does not follow URIs of any kind.
  840. @node Printed Books
  841. @section Printed Books
  842. @cindex Printed book and manual characteristics
  843. @cindex Manual characteristics, printed
  844. @cindex Book characteristics, printed
  845. @cindex Texinfo printed book characteristics
  846. @cindex Characteristics, printed books or manuals
  847. @cindex Knuth, Donald
  848. A Texinfo file can be formatted and typeset as a printed book or
  849. manual. To do this, you need @TeX{}, a sophisticated typesetting
  850. program written by Donald Knuth of Stanford University.
  851. A Texinfo-based book is similar to any other typeset, printed work: it
  852. can have a title page, copyright page, table of contents, and preface,
  853. as well as chapters, numbered or unnumbered sections and subsections,
  854. page headers, cross-references, footnotes, and indices.
  855. @TeX{} is a general purpose typesetting program. Texinfo provides a
  856. file @file{texinfo.tex} that contains information (definitions or
  857. @dfn{macros}) that @TeX{} uses when it typesets a Texinfo file.
  858. (@file{texinfo.tex} tells @TeX{} how to convert the Texinfo @@-commands
  859. to @TeX{} commands, which @TeX{} can then process to create the typeset
  860. document.) @file{texinfo.tex} contains the specifications for printing
  861. a document. You can get the latest version of @file{texinfo.tex} from
  862. the Texinfo home page, @uref{http://www.gnu.org/software/texinfo/}.
  863. In the United States, documents are most often printed on 8.5 inch by
  864. 11 inch pages (216@dmn{mm} by 280@dmn{mm}); this is the default size.
  865. But you can also print for 7 inch by 9.25 inch pages (178@dmn{mm} by
  866. 235@dmn{mm}, the @code{@@smallbook} size; or on A4 or A5 size paper
  867. (@code{@@afourpaper}, @code{@@afivepaper}).
  868. @xref{@code{@@smallbook}}, and @ref{A4 Paper}.
  869. @cindex Literate programming
  870. @TeX{} is freely distributable. It is written in a superset of Pascal
  871. for literate programming called WEB and can be compiled either in
  872. Pascal or (by using a conversion program that comes with the @TeX{}
  873. distribution) in C.
  874. @TeX{} is very powerful and has a great many features. Because a
  875. Texinfo file must be able to present information both on a
  876. character-only terminal in Info form and in a typeset book, the
  877. formatting commands that Texinfo supports are necessarily limited.
  878. @xref{Obtaining @TeX{}}, for information on acquiring @TeX{}. It is
  879. not part of the Texinfo distribution.
  880. @node Adding Output Formats
  881. @section Adding Output Formats
  882. @cindex Additional output formats
  883. The output formats in the previous sections handle a wide variety of
  884. usage, but of course there is always room for more.
  885. @cindex Output formats, supporting more
  886. @cindex SGML-tools output format
  887. If you are a programmer and would like to contribute to the GNU
  888. project by implementing additional output formats for Texinfo, that
  889. would be excellent. The way to do this that would be most useful is
  890. to write a new back-end for @command{texi2any}, our reference
  891. implementation of a Texinfo parser; it creates a tree representation
  892. of the Texinfo input that you can use for the conversion. The
  893. documentation in the source file
  894. @file{tp/Texinfo/Convert/Converter.pm} is a good place to start.
  895. @xref{Generic Translator @command{texi2any}}.
  896. Another viable approach is use the Texinfo XML output from
  897. @command{texi2any} as your input. This XML is an essentially complete
  898. representation of the input, but without the Texinfo syntax and option
  899. peculiarities, as described above.
  900. @cindex Texinfo parsers, discouraging more
  901. If you still cannot resist the temptation of writing a new program
  902. that reads Texinfo source directly, let us give some more caveats:
  903. please do not underestimate the amount of work required. Texinfo is
  904. by no means a simple language to parse correctly, and remains under
  905. development, so you would be committing to an ongoing task. You
  906. are advised to check that the tests of the language that come with
  907. @command{texi2any} give correct results with your new program.
  908. @cindex Man page output, not supported
  909. From time to time, proposals are made to generate traditional Unix man
  910. pages from Texinfo source. However, because man pages have a strict
  911. conventional format, creating a good man page requires a completely
  912. different source from that needed for the typical Texinfo applications
  913. of writing a good user tutorial and/or a good reference manual. This
  914. makes generating man pages incompatible with the Texinfo design
  915. goal of not having to document the same information in different
  916. ways for different output formats. You might as well write the man
  917. page directly.
  918. @pindex help2man
  919. @cindex O'Dea, Brendan
  920. As an alternative way to support man pages, you may find the program
  921. @command{help2man} to be useful. It generates a traditional man page
  922. from the @samp{--help} output of a program. In fact, the man pages
  923. for the programs in the Texinfo distribution are generated with this.
  924. It is GNU software written by Brendan O'Dea, available from
  925. @uref{http://www.gnu.org/software/help2man}.
  926. @node History
  927. @section History
  928. @cindex Stallman, Richard M.
  929. @cindex Chassell, Robert J.
  930. @cindex Fox, Brian
  931. @cindex Berry, Karl
  932. Richard M. Stallman invented the Texinfo format, wrote the initial
  933. processors, and created Edition 1.0 of this manual. Robert@tie{}J.
  934. Chassell greatly revised and extended the manual, starting with
  935. Edition 1.1. Brian Fox was responsible for the standalone Texinfo
  936. distribution until version 3.8, and originally wrote the standalone
  937. @command{makeinfo} and @command{info} programs. Karl Berry has
  938. continued maintenance since Texinfo 3.8 (manual edition 2.22).
  939. @cindex Pinard, Fran@,{c}ois
  940. @cindex Schwab, Andreas
  941. @cindex Weinberg, Zack
  942. @cindex Weisshaus, Melissa
  943. @cindex Zaretskii, Eli
  944. @cindex Zuhn, David D.
  945. Our thanks go out to all who helped improve this work, particularly
  946. the indefatigable Eli Zaretskii and Andreas Schwab, who have provided
  947. patches beyond counting. Fran@,{c}ois Pinard and David@tie{}D. Zuhn,
  948. tirelessly recorded and reported mistakes and obscurities. Zack
  949. Weinberg did the impossible by implementing the macro syntax in
  950. @file{texinfo.tex}. Thanks to Melissa Weisshaus for her frequent
  951. reviews of nearly similar editions. Dozens of others have contributed
  952. patches and suggestions, they are gratefully acknowledged in the
  953. @file{ChangeLog} file. Our mistakes are our own.
  954. @cindex History of Texinfo
  955. @cindex Texinfo history
  956. @subheading Beginnings
  957. @cindex Scribe
  958. @cindex Reid, Brian
  959. In the 1970's at CMU, Brian Reid developed a program and format named
  960. Scribe to mark up documents for printing. It used the @code{@@}
  961. character to introduce commands, as Texinfo does. Much more
  962. consequentially, it strove to describe document contents rather than
  963. formatting, an idea wholeheartedly adopted by Texinfo.
  964. @cindex Bolio
  965. @cindex Bo@TeX{}
  966. Meanwhile, people at MIT developed another, not too dissimilar format
  967. called Bolio. This then was converted to using @TeX{} as its typesetting
  968. language: Bo@TeX{}. The earliest Bo@TeX{} version seems to have been
  969. 0.02 on October 31, 1984.
  970. Bo@TeX{} could only be used as a markup language for documents to be
  971. printed, not for online documents. Richard Stallman (RMS) worked on
  972. both Bolio and Bo@TeX{}. He also developed a nifty on-line help format
  973. called Info, and then combined Bo@TeX{} and Info to create Texinfo, a
  974. mark up language for text that is intended to be read both online and
  975. as printed hard copy.
  976. Moving forward, the original translator to create Info was written
  977. (primarily by RMS and Bob Chassell) in Emacs Lisp, namely the
  978. @code{texinfo-format-buffer} and other functions. In the early 1990s,
  979. Brian Fox reimplemented the conversion program in C, now called
  980. @command{makeinfo}.
  981. @subheading Reimplementing in Perl
  982. @cindex Cons, Lionel
  983. @cindex Dumas, Patrice
  984. In 2012, the C @command{makeinfo} was itself replaced by a Perl
  985. implementation generically called @command{texi2any}. This version
  986. supports the same level of output customization as
  987. @command{texi2html}, an independent program originally written by
  988. Lionel Cons, later with substantial work by many others. The many
  989. additional features needed to make @command{texi2html} a replacement
  990. for @command{makeinfo} were implemented by Patrice Dumas. The first
  991. never-released version of @command{texi2any} was based on the
  992. @command{texi2html} code. That implementation, however, was abandoned
  993. in favor of the current program, which parses the Texinfo input into a
  994. tree for processing. It still supports nearly all the features of
  995. @command{texi2html}.
  996. The new Perl program is much slower than the old C program. We hope
  997. the speed gap will close in the future, but it may not ever be
  998. entirely comparable. So why did we switch? In short, we intend and
  999. hope that the present program will be much easier than the previous C
  1000. implementation of @command{makeinfo} to extend to different output
  1001. styles, back-end output formats, and all other customizations.
  1002. In more detail:
  1003. @itemize @bullet
  1004. @item HTML customization. Many GNU and other free software packages
  1005. had been happily using the HTML customization features in
  1006. @command{texi2html} for years. Thus, in effect two independent
  1007. implementations of the Texinfo language had developed, and keeping
  1008. them in sync was not simple. Adding the HTML customization possible
  1009. in @command{texi2html} to a C program would have been an
  1010. enormous effort.
  1011. @item Unicode, and multilingual support generally, especially of east
  1012. Asian languages. Although of course it's perfectly plausible to write
  1013. such support in C, in the particular case of @command{makeinfo}, it
  1014. would have been tantamount to rewriting the entire program. In Perl,
  1015. much of that comes essentially for free.
  1016. @item Additional back-ends. The @command{makeinfo} code had become
  1017. convoluted to the point where adding a new back-end was quite complex,
  1018. requiring complex interactions with existing back-ends. In contrast,
  1019. our Perl implementation provides a clean tree-based representation for
  1020. all back-ends to work from. People have requested numerous different
  1021. back-ends (@LaTeX{}, the latest (X)HTML, @dots{}), and they will now
  1022. be much more feasible to implement. Which leads to the last item:
  1023. @item Making contributions easier. In general, due to the cleaner
  1024. structure, the Perl program should be considerably easier than the C
  1025. for anyone to read and contribute to, with the resulting obvious
  1026. benefits.
  1027. @end itemize
  1028. @xref{Reference Implementation}, for more on the rationale for and
  1029. role of @command{texi2any}.
  1030. @node Writing a Texinfo File
  1031. @chapter Writing a Texinfo File
  1032. This chapter describes Texinfo syntax and what is required in a Texinfo
  1033. file, and gives a short sample file.
  1034. @menu
  1035. * Conventions:: General rules for writing a Texinfo file.
  1036. * Comments:: Writing comments and ignored text in general.
  1037. * Minimum:: What a Texinfo file must have.
  1038. * Short Sample:: A short sample Texinfo file.
  1039. @end menu
  1040. @node Conventions
  1041. @section General Syntactic Conventions
  1042. @cindex General syntactic conventions
  1043. @cindex Syntactic conventions
  1044. @cindex Conventions, syntactic
  1045. @cindex Characters, basic input
  1046. @anchor{Formatting Commands} @c old name
  1047. This section describes the general conventions used in all Texinfo documents.
  1048. @itemize @bullet
  1049. @item
  1050. @cindex Source files, characters used
  1051. All printable ASCII characters except @samp{@@}, @samp{@{} and
  1052. @samp{@}} can appear in a Texinfo file and stand for themselves.
  1053. @samp{@@} is the escape character which introduces commands, while
  1054. @samp{@{} and @samp{@}} are used to surround arguments to certain
  1055. commands. To put one of these special characters into the document, put
  1056. an @samp{@@} character in front of it, like this: @samp{@@@@},
  1057. @samp{@@@{}, and @samp{@@@}}.
  1058. @item
  1059. @cindex @@-commands
  1060. @cindex Formatting commands
  1061. In a Texinfo file, the commands you write to describe the contents of
  1062. the manual are preceded by an @samp{@@} character; they are called
  1063. @dfn{@@-commands}. (The @samp{@@} in Texinfo has the same meaning that
  1064. @samp{\} has in plain @TeX{}.)
  1065. @cindex Braces, when to use
  1066. Depending on what they do or what arguments@footnote{The word
  1067. @dfn{argument} comes from the way it is used in mathematics and does not
  1068. refer to a dispute between two people; it refers to the information
  1069. presented to the command. According to the @cite{Oxford English
  1070. Dictionary}, the word derives from the Latin for @dfn{to make clear,
  1071. prove}; thus it came to mean `the evidence offered as proof', which is
  1072. to say, `the information offered', which led to its mathematical
  1073. meaning. In its other thread of derivation, the word came to mean `to
  1074. assert in a manner against which others may make counter assertions',
  1075. which led to the meaning of `argument' as a dispute.} they take, you
  1076. need to write @@-commands on lines of their own, or as part of
  1077. sentences. As a general rule, a command requires braces if it mingles
  1078. among other text; but it does not need braces if it is on a line of its
  1079. own. For more details of Texinfo command syntax, see @ref{Command
  1080. Syntax}.
  1081. @item
  1082. Whitespace following an @@-command name is optional and (usually)
  1083. ignored if present. The exceptions are contexts when whitespace is
  1084. significant, e.g., an @code{@@example} environment.
  1085. @item
  1086. Texinfo supports the usual quotation marks used in English and in
  1087. other languages; see @ref{Inserting Quotation Marks}.
  1088. @item
  1089. @cindex Multiple dashes in source
  1090. @cindex Dashes in source
  1091. @cindex Hyphens in source, two or three in a row
  1092. @cindex Em dash, producing
  1093. @cindex En dash, producing
  1094. Use three hyphens in a row, @samp{---}, to produce a long dash---like
  1095. this (called an @dfn{em dash}), used for punctuation in sentences.
  1096. Use two hyphens, @samp{--}, to produce a medium dash (called an
  1097. @dfn{en dash}), used primarily for numeric ranges, as in ``June
  1098. 25--26''. Use a single hyphen, @samp{-}, to produce a standard hyphen
  1099. used in compound words. For display on the screen, Info reduces three
  1100. hyphens to two and two hyphens to one (not transitively!). Of course,
  1101. any number of hyphens in the source remain as they are in literal
  1102. contexts, such as @code{@@code} and @code{@@example}.
  1103. @item
  1104. @cindex Form feed characters
  1105. @cindex @kbd{CTRL-l}
  1106. Form feed (@kbd{CTRL-l}) characters in the input are handled as
  1107. follows:
  1108. @table @asis
  1109. @item PDF/DVI
  1110. In normal text, treated as ending any open paragraph; essentially
  1111. ignored between paragraphs.
  1112. @item Info
  1113. Output as-is between paragraphs (their most common use); in other
  1114. contexts, they may be treated as regular spaces (and thus consolidated
  1115. with surrounding whitespace).
  1116. @item HTML
  1117. Written as a numeric entity except contexts where spaces are ignored;
  1118. for example, in @samp{@@footnote@{ ^L foo@}}, the form feed is
  1119. ignored.
  1120. @item XML
  1121. Keep them everywhere; in attributes, escaped as @samp{\f}; also,
  1122. @samp{\} is escaped as @samp{\\} and newline as @samp{\n}.
  1123. @item Docbook
  1124. Completely removed, as they are not allowed.
  1125. @end table
  1126. As you can see, because of these differing requirements of the output
  1127. formats, it's not possible to use form feeds completely portably.
  1128. @item
  1129. @cindex Tabs; don't use!
  1130. @strong{Caution:} Last, do not use tab characters in a Texinfo file!
  1131. (Except perhaps in verbatim modes.) @TeX{} uses variable-width fonts,
  1132. which means that it is impractical at best to define a tab to work in
  1133. all circumstances. Consequently, @TeX{} treats tabs like single
  1134. spaces, and that is not what they look like in the source.
  1135. Furthermore, @code{makeinfo} does nothing special with tabs, and thus
  1136. a tab character in your input file will usually have a different
  1137. appearance in the output.
  1138. @noindent
  1139. To avoid this problem, Texinfo mode in GNU Emacs inserts
  1140. multiple spaces when you press the @key{TAB} key. Also, you can run
  1141. @code{untabify} in Emacs to convert tabs in a region to multiple
  1142. spaces, or use the @code{unexpand} command from the shell.
  1143. @end itemize
  1144. @node Comments
  1145. @section Comments
  1146. @cindex Comments
  1147. @findex comment
  1148. @findex c
  1149. You can write comments in a Texinfo file by using the @code{@@comment}
  1150. command, which may be abbreviated to @code{@@c}. Such comments are
  1151. for a person looking at the Texinfo source file. All the text on a
  1152. line that follows either @code{@@comment} or @code{@@c} is a comment;
  1153. the rest of the line does not appear in the visible output. (To be
  1154. precise, the character after the @code{@@c} or @code{@@comment} must
  1155. be something other than a dash or alphanumeric, or it will be taken as
  1156. part of the command.)
  1157. Often, you can write the @code{@@comment} or @code{@@c} in the middle
  1158. of a line, and only the text that follows after the @code{@@comment}
  1159. or @code{@@c} command does not appear; but some commands, such as
  1160. @code{@@settitle}, work on a whole line. You cannot use @code{@@comment}
  1161. or @code{@@c} within a line beginning with such a command.
  1162. @findex DEL @r{(comment character)}
  1163. @cindex Catcode for comments in @TeX{}
  1164. In cases of nested command invocations, complicated macro definitions,
  1165. etc., @code{@@c} and @code{@@comment} may provoke an error when
  1166. processing with @TeX{}. Therefore, you can also use the @kbd{DEL}
  1167. character (ASCII 127 decimal, 0x7f hex, 0177 octal) as a true @TeX{}
  1168. comment character (catcode 14, in @TeX{} internals). Everything on
  1169. the line after the @kbd{DEL} will be ignored.
  1170. @cindex Ignored text
  1171. @cindex Unprocessed text
  1172. @findex ignore
  1173. You can also have long stretches of text ignored by the Texinfo
  1174. processors with the @code{@@ignore} and @code{@@end ignore} commands.
  1175. Write each of these commands on a line of its own, starting each
  1176. command at the beginning of the line. Text between these two commands
  1177. does not appear in the processed output. You can use @code{@@ignore}
  1178. and @code{@@end ignore} for writing comments. (For some caveats
  1179. regarding nesting of such commands, @pxref{Conditional Nesting}.)
  1180. @node Minimum
  1181. @section What a Texinfo File Must Have
  1182. @cindex Minimal Texinfo file (requirements)
  1183. @cindex Must have in Texinfo file
  1184. @cindex Required in Texinfo file
  1185. @cindex Texinfo file minimum
  1186. By convention, the name of a Texinfo file ends with one of the
  1187. extensions @file{.texinfo}, @file{.texi}, @file{.txi}, or
  1188. @file{.tex}.@footnote{The longer extensions are preferred, since they
  1189. describe more clearly to a human reader the nature of the file. The
  1190. shorter extensions are for operating systems that cannot handle long
  1191. file names.}
  1192. In order to be made into a printed manual and other output
  1193. formats, a Texinfo file must begin with lines like this:
  1194. @example
  1195. @group
  1196. \input texinfo
  1197. @@settitle @var{name-of-manual}
  1198. @end group
  1199. @end example
  1200. @noindent
  1201. The contents of the file follow this beginning, and then you
  1202. must end the Texinfo source with a line like this:
  1203. @example
  1204. @@bye
  1205. @end example
  1206. @findex \input @r{(raw @TeX{} startup)}
  1207. @noindent
  1208. Here's an explanation:
  1209. @itemize @bullet
  1210. @item
  1211. The @samp{\input texinfo} line tells @TeX{} to use the
  1212. @file{texinfo.tex} file, which tells @TeX{} how to translate the Texinfo
  1213. @@-commands into @TeX{} typesetting commands. (Note the use of the
  1214. backslash, @samp{\}; this is correct for @TeX{}.)
  1215. @item
  1216. The @code{@@settitle} line specifies a title for the page headers (or
  1217. footers) of the printed manual, and the default title and document
  1218. description for the @samp{<head>} in HTML@. Strictly speaking,
  1219. @code{@@settitle} is optional---if you don't mind your document being
  1220. titled `Untitled'.
  1221. @item
  1222. The @code{@@bye} line at the end of the file on a line of its own tells
  1223. the formatters that the file is ended and to stop formatting. If you
  1224. leave this out, you'll be dumped at @TeX{}'s prompt at the end of the
  1225. run.
  1226. @end itemize
  1227. Furthermore, you will usually provide a Texinfo file with a title page,
  1228. indices, and the like, all of which are explained in this manual. But
  1229. the minimum, which can be useful for short documents, is just the two
  1230. lines at the beginning and the one line at the end.
  1231. @node Short Sample
  1232. @section A Short Sample Texinfo File
  1233. @cindex Sample Texinfo file, with comments
  1234. Here is a short but complete Texinfo file, so you can see how Texinfo
  1235. source appears in practice. The first three parts of the file are
  1236. mostly boilerplate: when writing a manual, you simply change
  1237. the names as appropriate.
  1238. The complete file, without interspersed comments, is shown in
  1239. @ref{Short Sample Texinfo File}.
  1240. @xref{Beginning and Ending a File}, for more documentation on the
  1241. commands listed here.
  1242. @subheading Header
  1243. @noindent
  1244. The header tells @TeX{} which definitions file to
  1245. use, names the manual, and carries out other such housekeeping tasks.
  1246. @example
  1247. @group
  1248. \input texinfo
  1249. @@settitle Sample Manual 1.0
  1250. @end group
  1251. @end example
  1252. @subheading Summary Description and Copyright
  1253. This segment describes the document and contains the copyright notice
  1254. and copying permissions. This is done with the @code{@@copying} command.
  1255. @noindent
  1256. A real manual includes more text here, according to the license under
  1257. which it is distributed. @xref{GNU Sample Texts}.
  1258. @example
  1259. @group
  1260. @@copying
  1261. This is a short example of a complete Texinfo file, version 1.0.
  1262. Copyright @@copyright@{@} 2016 Free Software Foundation, Inc.
  1263. @@end copying
  1264. @end group
  1265. @end example
  1266. @subheading Titlepage, Copyright, Contents
  1267. The title and copyright segment contains the title and copyright
  1268. pages for the printed manual. The segment must be enclosed between
  1269. @code{@@titlepage} and @code{@@end titlepage} commands. The title and
  1270. copyright page does not appear in the online output.
  1271. @noindent
  1272. We use the @code{@@insertcopying} command to
  1273. include the permission text from the previous section, instead of
  1274. writing it out again; it is output on the back of the title page. The
  1275. @code{@@contents} command generates a table of contents.
  1276. @example
  1277. @group
  1278. @@titlepage
  1279. @@title Sample Title
  1280. @end group
  1281. @group
  1282. @@c The following two commands start the copyright page.
  1283. @@page
  1284. @@vskip 0pt plus 1filll
  1285. @@insertcopying
  1286. @@end titlepage
  1287. @end group
  1288. @@c Output the table of contents at the beginning.
  1289. @@contents
  1290. @end example
  1291. @subheading `Top' Node and Master Menu
  1292. The `Top' node starts off the online output; it does not appear in the
  1293. printed manual. We repeat the short description from the beginning of
  1294. the @samp{@@copying} text, but there's no need to repeat the copyright
  1295. information, so we don't use @samp{@@insertcopying} here.
  1296. The @samp{@@top} command itself helps @command{makeinfo} determine
  1297. the relationships between nodes. The `Top' node contains at least a
  1298. top-level @dfn{menu} listing the chapters, and possibly a @dfn{Master
  1299. Menu} listing all the nodes in the entire document.
  1300. @example
  1301. @@ifnottex
  1302. @@node Top
  1303. @@top Short Sample
  1304. This is a short sample Texinfo file.
  1305. @@end ifnottex
  1306. @group
  1307. @@menu
  1308. * First Chapter:: The first chapter is the
  1309. only chapter in this sample.
  1310. * Index:: Complete index.
  1311. @@end menu
  1312. @end group
  1313. @end example
  1314. @subheading The Body of the Document
  1315. @noindent
  1316. The body segment contains all the text of the document, but not the
  1317. indices or table of contents. This example illustrates a node and a
  1318. chapter containing an enumerated list.
  1319. @example
  1320. @group
  1321. @@node First Chapter
  1322. @@chapter First Chapter
  1323. @@cindex chapter, first
  1324. @end group
  1325. @group
  1326. This is the first chapter.
  1327. @@cindex index entry, another
  1328. @end group
  1329. @group
  1330. Here is a numbered list.
  1331. @@enumerate
  1332. @@item
  1333. This is the first item.
  1334. @@item
  1335. This is the second item.
  1336. @@end enumerate
  1337. @end group
  1338. @end example
  1339. @subheading The End of the Document
  1340. This may contain commands for printing indices, and
  1341. closes with the @code{@@bye} command, which marks the end of the document.
  1342. @example
  1343. @group
  1344. @@node Index
  1345. @@unnumbered Index
  1346. @end group
  1347. @group
  1348. @@printindex cp
  1349. @@bye
  1350. @end group
  1351. @end example
  1352. @subheading Some Results
  1353. Here is what the contents of the first chapter of the sample look like:
  1354. @sp 1
  1355. @need 700
  1356. @quotation
  1357. This is the first chapter.
  1358. Here is a numbered list.
  1359. @enumerate
  1360. @item
  1361. This is the first item.
  1362. @item
  1363. This is the second item.
  1364. @end enumerate
  1365. @end quotation
  1366. @node Beginning and Ending a File
  1367. @anchor{Beginning a File} @c old name
  1368. @chapter Beginning and Ending a Texinfo File
  1369. @cindex Beginning a Texinfo file
  1370. @cindex Texinfo file beginning
  1371. @cindex File beginning
  1372. This chapter expands on the minimal complete Texinfo source file
  1373. previously given (@pxref{Short Sample}).
  1374. Certain pieces of information must be provided at the beginning of a
  1375. Texinfo file, such the title of the document and the Top node. A table
  1376. of contents is also generally produced here.
  1377. @cindex Frontmatter, text in
  1378. Straight text outside of any command before the Top node should be
  1379. avoided. Such text is treated differently in the different output
  1380. formats: at the time of writing, it is visible in @TeX{} and HTML, by
  1381. default not shown in Info readers, and so on.
  1382. @menu
  1383. * Sample Beginning:: A sample beginning for a Texinfo file.
  1384. * Texinfo File Header:: The first lines.
  1385. * Document Permissions:: Ensuring your manual is free.
  1386. * Titlepage & Copyright Page:: Creating the title and copyright pages.
  1387. * Contents:: How to create a table of contents.
  1388. * The Top Node:: Creating the `Top' node and master menu.
  1389. * Global Document Commands:: Affecting formatting throughout.
  1390. * Ending a File:: What is at the end of a Texinfo file?
  1391. @end menu
  1392. @node Sample Beginning
  1393. @section Sample Texinfo File Beginning
  1394. @cindex Example beginning of Texinfo file
  1395. The following sample shows what is needed. The elements given here are
  1396. explained in more detail in the following sections. Other commands are
  1397. often included at the beginning of Texinfo files, but the ones here are
  1398. the most critical.
  1399. @xref{GNU Sample Texts}, for the full texts to be used in GNU manuals.
  1400. @example
  1401. \input texinfo
  1402. @@settitle @var{name-of-manual} @var{version}
  1403. @@copying
  1404. This manual is for @var{program}, version @var{version}.
  1405. Copyright @@copyright@{@} @var{years} @var{copyright-owner}.
  1406. @group
  1407. @@quotation
  1408. Permission is granted to @dots{}
  1409. @@end quotation
  1410. @@end copying
  1411. @end group
  1412. @group
  1413. @@titlepage
  1414. @@title @var{name-of-manual-when-printed}
  1415. @@subtitle @var{subtitle-if-any}
  1416. @@subtitle @var{second-subtitle}
  1417. @@author @var{author}
  1418. @end group
  1419. @group
  1420. @@c The following two commands
  1421. @@c start the copyright page.
  1422. @@page
  1423. @@vskip 0pt plus 1filll
  1424. @@insertcopying
  1425. @end group
  1426. Published by @dots{}
  1427. @@end titlepage
  1428. @@c So the toc is printed at the start.
  1429. @@contents
  1430. @@ifnottex
  1431. @@node Top
  1432. @@top @var{title}
  1433. This manual is for @var{program}, version @var{version}.
  1434. @@end ifnottex
  1435. @group
  1436. @@menu
  1437. * First Chapter:: Getting started @dots{}
  1438. * Second Chapter:: @dots{}
  1439. @dots{}
  1440. * Copying:: Your rights and freedoms.
  1441. @@end menu
  1442. @end group
  1443. @group
  1444. @@node First Chapter
  1445. @@chapter First Chapter
  1446. @@cindex first chapter
  1447. @@cindex chapter, first
  1448. @dots{}
  1449. @end group
  1450. @end example
  1451. @node Texinfo File Header
  1452. @section Texinfo File Header
  1453. @cindex Header for Texinfo files
  1454. @cindex Texinfo file header
  1455. Texinfo files start with at least two lines. These are the
  1456. @code{\input texinfo} line and the @code{@@settitle} line.
  1457. Also, if you want to format just part of the Texinfo file in Emacs,
  1458. you must write the @code{@@settitle} line between start-of-header and
  1459. end-of-header lines. These start- and end-of-header lines are optional,
  1460. but they do no harm, so you might as well always include them.
  1461. Any command that affects document formatting as a whole makes sense to
  1462. include in the header. @code{@@synindex} (@pxref{@code{@@synindex}}),
  1463. for instance, is another command often included in the header.
  1464. Thus, the beginning of a Texinfo file looks approximately
  1465. like this:
  1466. @example
  1467. @group
  1468. \input texinfo
  1469. @@settitle Sample Manual 1.0
  1470. @end group
  1471. @end example
  1472. (@xref{GNU Sample Texts} for complete sample texts.)
  1473. @menu
  1474. * First Line:: The first line of a Texinfo file.
  1475. * Start of Header:: Formatting a region requires this.
  1476. * @code{@@setfilename}:: Tell Info the name of the Info file.
  1477. * @code{@@settitle}:: Create a title for the printed work.
  1478. * End of Header:: Formatting a region requires this.
  1479. @end menu
  1480. @node First Line
  1481. @subsection The First Line of a Texinfo File
  1482. @cindex First line of a Texinfo file
  1483. @cindex Beginning line of a Texinfo file
  1484. @cindex Header of a Texinfo file
  1485. Every Texinfo file that is to be the top-level input to @TeX{} must begin
  1486. with a line that looks like this:
  1487. @example
  1488. \input texinfo
  1489. @end example
  1490. When the file is processed by @TeX{}, the @samp{\input texinfo} command
  1491. tells @TeX{} to load the macros needed for processing a Texinfo file.
  1492. These are in a file called @file{texinfo.tex}, which should have been
  1493. installed on your system along with either the @TeX{} or Texinfo
  1494. software. @TeX{} uses the backslash, @samp{\}, to mark the beginning of
  1495. a command, exactly as Texinfo uses @samp{@@}. The @file{texinfo.tex}
  1496. file causes the switch from @samp{\} to @samp{@@}; before the switch
  1497. occurs, @TeX{} requires @samp{\}, which is why it appears at the
  1498. beginning of the file.
  1499. You may optionally follow this line with a comment to tell GNU Emacs
  1500. to use Texinfo mode when the file is edited:
  1501. @example
  1502. \input texinfo @@c -*-texinfo-*-
  1503. @end example
  1504. @noindent This may be useful when Emacs doesn't detect the file type
  1505. from the file extension automatically.
  1506. @node Start of Header
  1507. @subsection Start of Header
  1508. @cindex Start of header line
  1509. A start-of-header line is a Texinfo comment that looks like this:
  1510. @example
  1511. @@c %**start of header
  1512. @end example
  1513. Write the start-of-header line on the second line of a Texinfo file.
  1514. Follow the start-of-header line with an @code{@@settitle} line and,
  1515. optionally, with other commands that globally affect the document
  1516. formatting, such as @code{@@synindex} or @code{@@footnotestyle}; and
  1517. then by an end-of-header line (@pxref{End of Header}).
  1518. The start- and end-of-header lines allow you to format only part of a
  1519. Texinfo file for Info or printing. @xref{@code{texinfo-format} commands}.
  1520. The odd string of characters, @samp{%**}, is to ensure that no other
  1521. comment is accidentally taken for a start-of-header line. You can
  1522. change it if you wish by setting the @code{tex-start-of-header} and/or
  1523. @code{tex-end-of-header} Emacs variables. @xref{Texinfo Mode Printing}.
  1524. @node @code{@@setfilename}
  1525. @subsection @code{@@setfilename}: Set the Output File Name
  1526. @anchor{setfilename}@c old name
  1527. @findex setfilename
  1528. @cindex Texinfo requires @code{@@setfilename}
  1529. @cindex Output file name, required
  1530. The @code{@@setfilename} line specifies the name of the output file to
  1531. be generated.
  1532. When present, it should be the first Texinfo command (that is, after
  1533. @samp{\input texinfo}).
  1534. Write the @code{@@setfilename} command at the beginning of a line and
  1535. follow it on the same line by the Info file name.
  1536. @example
  1537. @@setfilename @var{info-file-name}
  1538. @end example
  1539. The name must be different from the name of the
  1540. Texinfo file. There are two conventions for choosing the name: you
  1541. can either remove the extension (such as @samp{.texi}) entirely from
  1542. the input file name, or (recommended) replace it with the @samp{.info}
  1543. extension.
  1544. @cindex Ignored before @code{@@setfilename}
  1545. @cindex @samp{\input} source line ignored
  1546. When a @code{@@setfilename} line is present, the Texinfo processors
  1547. ignore everything written before the @code{@@setfilename} line. This
  1548. is why the very first line of the file (the @code{\input} line) does
  1549. not show up in the output.
  1550. If there is no @code{@@setfilename} line, @code{makeinfo} uses the
  1551. input file name to determine the output name: first, any of the
  1552. extensions @code{.texi}, @code{.tex}, @code{.txi} or @code{.texinfo}
  1553. is removed from the input file name; then, the output format specific
  1554. extension is added---@code{.html} when generating HTML, @code{.info}
  1555. when generating Info, etc. The @code{\input} line is still ignored in
  1556. this processing, as well as leading blank lines.
  1557. When producing another output format, @code{makeinfo} will replace any
  1558. final extension with the output format-specific extension (@samp{html}
  1559. when generating HTML, for example), or add a dot followed by the
  1560. extension (@samp{.html} for HTML) if the given name has no extension.
  1561. @code{@@setfilename} used to be required by the Texinfo processors, and
  1562. some other programs may still expect it to be present; for example,
  1563. Automake (@pxref{Texinfo,,,automake, GNU Automake}).
  1564. @cindex Length of file names
  1565. @cindex File name collision
  1566. @cindex Info file name, choosing
  1567. Although an explicit @samp{.info} extension is preferable, some
  1568. operating systems cannot handle long file names. You can run into a
  1569. problem even when the file name you specify is itself short enough.
  1570. This occurs because the Info formatters split a long Info file into
  1571. short indirect subfiles, and name them by appending @samp{-1},
  1572. @samp{-2}, @dots{}, @samp{-10}, @samp{-11}, and so on, to the original
  1573. file name. (@xref{Tag and Split Files}.) The subfile name
  1574. @file{texinfo.info-10}, for example, is too long for old systems with
  1575. a 14-character limit on filenames; so the Info file name for this
  1576. document is @file{texinfo} rather than @file{texinfo.info}. When
  1577. @code{makeinfo} is running on operating systems such as MS-DOS which
  1578. impose severe limits on file names, it may remove some characters from
  1579. the original file name to leave enough space for the subfile suffix,
  1580. thus producing files named @file{texin-10}, @file{gcc.i12}, etc.
  1581. See also the @option{--output} option in @ref{Invoking @command{texi2any}}.
  1582. @node @code{@@settitle}
  1583. @subsection @code{@@settitle}: Set the Document Title
  1584. @anchor{settitle}@c old name
  1585. @findex settitle
  1586. @cindex Document title, specifying
  1587. A Texinfo file should contain a line that looks like this:
  1588. @example
  1589. @@settitle @var{title}
  1590. @end example
  1591. Write the @code{@@settitle} command at the beginning of a line and
  1592. follow it on the same line by the title. Do not write anything else
  1593. on the line. The @code{@@settitle} command should precede everything
  1594. that generates actual output. The best place for it is right after
  1595. the @code{@@setfilename} command (described in the previous section).
  1596. This command tells @TeX{} the title to use in a header or footer
  1597. for double-sided output, in case such headings are output. For
  1598. more on headings for @TeX{}, see @ref{Heading Generation}.
  1599. @cindex @code{<title>} HTML tag
  1600. In the HTML file produced by @command{makeinfo}, @var{title} serves as
  1601. the document @samp{<title>}. It also becomes the default document
  1602. description in the @samp{<head>} part
  1603. (@pxref{@code{@@documentdescription}}).
  1604. When the title page is used in the output, the title in the
  1605. @code{@@settitle} command does not affect the title as it appears on
  1606. the title page. Thus, the two do not need not to match exactly. A
  1607. practice we recommend is to include the version or edition number of
  1608. the manual in the @code{@@settitle} title; on the title page, the
  1609. version number generally appears as a @code{@@subtitle} so it would
  1610. be omitted from the @code{@@title}. @xref{@code{@@titlepage}}.
  1611. @node End of Header
  1612. @subsection End of Header
  1613. @cindex End of header line
  1614. Follow the header lines with an @w{end-of-header} line, which is a
  1615. Texinfo comment that looks like this:
  1616. @example
  1617. @@c %**end of header
  1618. @end example
  1619. @xref{Start of Header}.
  1620. @node Document Permissions
  1621. @section Document Permissions
  1622. @cindex Document Permissions
  1623. @cindex Copying Permissions
  1624. The copyright notice and copying permissions for a document need to
  1625. appear in several places in the various Texinfo output formats.
  1626. Therefore, Texinfo provides a command (@code{@@copying}) to declare
  1627. this text once, and another command (@code{@@insertcopying}) to
  1628. insert the text at appropriate points.
  1629. @anchor{Software Copying Permissions}@c old node name
  1630. This section is about the license of the Texinfo document. If the
  1631. document is a software manual, the software is typically under a
  1632. different license---for GNU and many other free software packages,
  1633. software is usually released under the GNU GPL, and manuals are
  1634. released under the GNU FDL@. It is helpful to state the license of
  1635. the software of the manual, but giving the complete text of the
  1636. software license is not necessarily required.
  1637. @menu
  1638. * @code{@@copying}:: Declare the document's copying permissions.
  1639. * @code{@@insertcopying}:: Where to insert the permissions.
  1640. @end menu
  1641. @node @code{@@copying}
  1642. @subsection @code{@@copying}: Declare Copying Permissions
  1643. @anchor{copying}@c old name
  1644. @findex copying
  1645. The @code{@@copying} command should be given very early in the document;
  1646. the recommended location is right after the header material
  1647. (@pxref{Texinfo File Header}). It conventionally consists of a sentence
  1648. or two about what the program is, identification of the documentation
  1649. itself, the legal copyright line, and the copying permissions. Here is
  1650. a skeletal example:
  1651. @example
  1652. @@copying
  1653. This manual is for @var{program} (version @var{version}, updated
  1654. @var{date}), which @dots{}
  1655. Copyright @@copyright@{@} @var{years} @var{copyright-owner}.
  1656. @@quotation
  1657. Permission is granted to @dots{}
  1658. @@end quotation
  1659. @@end copying
  1660. @end example
  1661. The @code{@@quotation} has no legal significance; it's there to improve
  1662. readability in some contexts.
  1663. The text of @code{@@copying} is output as a comment at the beginning
  1664. of Info, HTML, XML, and Docbook output files. It is @emph{not} output
  1665. implicitly in plain text or @TeX{}; it's up to you to use
  1666. @code{@@insertcopying} to emit the copying information. See the next
  1667. section for details.
  1668. @findex copyright
  1669. The @code{@@copyright@{@}} command generates a @samp{c} inside a
  1670. circle when the output format supports this glyph (print and HTML
  1671. always do, for instance). When the glyph is not supported in the
  1672. output, it generates the three-character sequence @samp{(C)}.
  1673. The copyright notice itself has the following legally-prescribed
  1674. form:
  1675. @example
  1676. Copyright @copyright{} @var{years} @var{copyright-owner}.
  1677. @end example
  1678. @cindex Copyright word, always in English
  1679. The word `Copyright' must always be written in English, even if the
  1680. document is otherwise written in another language. This is due to
  1681. international law.
  1682. @cindex Years, in copyright line
  1683. The list of years should include all years in which a version was
  1684. completed (even if it was released in a subsequent year). It is
  1685. simplest for each year to be written out individually and in full,
  1686. separated by commas.
  1687. @cindex Copyright holder for FSF works
  1688. @cindex Holder of copyright for FSF works
  1689. @cindex Owner of copyright for FSF works
  1690. The copyright owner (or owners) is whoever holds legal copyright on the
  1691. work. In the case of works assigned to the FSF, the owner is `Free
  1692. Software Foundation, Inc.'.
  1693. The copyright `line' may actually be split across multiple lines, both
  1694. in the source document and in the output. This often happens for
  1695. documents with a long history, having many different years of
  1696. publication. If you do use several lines, do not indent any of them
  1697. (or anything else in the @code{@@copying} block) in the source file.
  1698. @xref{Copyright Notices,,, maintain, GNU Maintainer Information}, for
  1699. additional information. @xref{GNU Sample Texts}, for the full text to
  1700. be used in GNU manuals. @xref{GNU Free Documentation License}, for
  1701. the license itself under which GNU and other free manuals are
  1702. distributed.
  1703. @node @code{@@insertcopying}
  1704. @subsection @code{@@insertcopying}: Include Permissions Text
  1705. @anchor{insertcopying}@c old name
  1706. @findex insertcopying
  1707. @cindex Copying text, including
  1708. @cindex Permissions text, including
  1709. @cindex Including permissions text
  1710. The @code{@@insertcopying} command is simply written on a line by
  1711. itself, like this:
  1712. @example
  1713. @@insertcopying
  1714. @end example
  1715. This inserts the text previously defined by @code{@@copying}. To meet
  1716. legal requirements, it must be used on the copyright page in the printed
  1717. manual (@pxref{Copyright}).
  1718. The @code{@@copying} command itself causes the permissions text to
  1719. appear in an Info file @emph{before} the first node. The text is also
  1720. copied into the beginning of each split Info output file, as is legally
  1721. necessary. This location implies a human reading the manual using Info
  1722. does @emph{not} see this text (except when using the advanced Info
  1723. command @kbd{g *}), but this does not matter for legal purposes,
  1724. because the text is present.
  1725. Similarly, the @code{@@copying} text is automatically included at the
  1726. beginning of each HTML output file, as an HTML comment. Again, this
  1727. text is not visible (unless the reader views the HTML source).
  1728. The permissions text defined by @code{@@copying} also appears
  1729. automatically at the beginning of the XML and Docbook output files.
  1730. @node Titlepage & Copyright Page
  1731. @section Title and Copyright Pages
  1732. In hard copy output, the manual's name and author are usually printed on
  1733. a title page. Copyright information is usually printed on the back of
  1734. the title page.
  1735. The title and copyright pages appear in printed manuals, but not in
  1736. most other output formats. Because of this, it is possible to use
  1737. several slightly obscure typesetting commands that are not to be used
  1738. in the main text. In addition, this part of the beginning of a
  1739. Texinfo file contains the text of the copying permissions that appears
  1740. in the printed manual.
  1741. @menu
  1742. * @code{@@titlepage}:: Create a title for the printed document.
  1743. * @code{@@titlefont @@center @@sp}:: The @code{@@titlefont}, @code{@@center},
  1744. and @code{@@sp} commands.
  1745. * @code{@@title @@subtitle @@author}:: The @code{@@title}, @code{@@subtitle},
  1746. and @code{@@author} commands.
  1747. * Copyright:: How to write the copyright notice and
  1748. include copying permissions.
  1749. * Heading Generation:: Turn on page headings after the title and
  1750. copyright pages.
  1751. @end menu
  1752. @node @code{@@titlepage}
  1753. @subsection @code{@@titlepage}
  1754. @anchor{titlepage}@c old name
  1755. @cindex Title page
  1756. @findex titlepage
  1757. Start the material for the title page and following copyright page
  1758. with @code{@@titlepage} on a line by itself and end it with
  1759. @code{@@end titlepage} on a line by itself.
  1760. The @code{@@end titlepage} command starts a new page and turns on page
  1761. numbering (@pxref{Heading Generation}). All the
  1762. material that you want to appear on unnumbered pages should be put
  1763. between the @code{@@titlepage} and @code{@@end titlepage} commands.
  1764. You can force the table of contents to appear there with the
  1765. @code{@@setcontentsaftertitlepage} command (@pxref{Contents}).
  1766. @findex page@r{, within @code{@@titlepage}}
  1767. By using the @code{@@page} command you can force a page break within the
  1768. region delineated by the @code{@@titlepage} and @code{@@end titlepage}
  1769. commands and thereby create more than one unnumbered page. This is how
  1770. the copyright page is produced. (The @code{@@titlepage} command might
  1771. perhaps have been better named the @code{@@titleandadditionalpages}
  1772. command, but that would have been rather long!)
  1773. When you write a manual about a computer program, you should write the
  1774. version of the program to which the manual applies on the title page.
  1775. If the manual changes more frequently than the program or is independent
  1776. of it, you should also include an edition number@footnote{We have found
  1777. that it is helpful to refer to versions of independent manuals as
  1778. `editions' and versions of programs as `versions'; otherwise, we find we
  1779. are liable to confuse each other in conversation by referring to both
  1780. the documentation and the software with the same words.} for the manual.
  1781. This helps readers keep track of which manual is for which version of
  1782. the program. (The `Top' node should also contain this information; see
  1783. @ref{The Top Node}.)
  1784. Texinfo provides two main methods for creating a title page. One method
  1785. uses the @code{@@titlefont}, @code{@@sp}, and @code{@@center} commands
  1786. to generate a title page in which the words on the page are
  1787. centered.
  1788. The second method uses the @code{@@title}, @code{@@subtitle}, and
  1789. @code{@@author} commands to create a title page with black rules under
  1790. the title and author lines and the subtitle text set flush to the
  1791. right hand side of the page. With this method, you do not specify any
  1792. of the actual formatting of the title page. You specify the text
  1793. you want, and Texinfo does the formatting.
  1794. You may use either method, or you may combine them; see the examples in
  1795. the sections below.
  1796. @findex shorttitlepage
  1797. @cindex Bastard title page
  1798. @cindex Title page, bastard
  1799. For sufficiently simple documents, and for the bastard title page in
  1800. traditional book frontmatter, Texinfo also provides a command
  1801. @code{@@shorttitlepage} which takes the rest of the line as the title.
  1802. The argument is typeset on a page by itself and followed by a blank
  1803. page.
  1804. @node @code{@@titlefont @@center @@sp}
  1805. @subsection @code{@@titlefont}, @code{@@center}, and @code{@@sp}
  1806. @anchor{titlefont center sp}@c old name
  1807. @findex titlefont
  1808. @findex center
  1809. @findex sp @r{(titlepage line spacing)}
  1810. You can use the @code{@@titlefont}, @code{@@sp}, and @code{@@center}
  1811. commands to create a title page for a printed document. (This is the
  1812. first of the two methods for creating a title page in Texinfo.)
  1813. Use the @code{@@titlefont} command to select a large font suitable for
  1814. the title itself. You can use @code{@@titlefont} more than once if you
  1815. have an especially long title.
  1816. For HTML output, each @code{@@titlefont} command produces an
  1817. @code{<h1>} heading, but the HTML document @code{<title>} is not
  1818. affected. For that, you must put a @code{@@settitle} command before
  1819. the @code{@@titlefont} command (@pxref{@code{@@settitle}}).
  1820. @need 700
  1821. For example:
  1822. @example
  1823. @@titlefont@{Texinfo@}
  1824. @end example
  1825. Use the @code{@@center} command at the beginning of a line to center
  1826. the remaining text on that line. Thus,
  1827. @example
  1828. @@center @@titlefont@{Texinfo@}
  1829. @end example
  1830. @noindent
  1831. centers the title, which in this example is ``Texinfo'' printed
  1832. in the title font.
  1833. Use the @code{@@sp} command to insert vertical space. For example:
  1834. @example
  1835. @@sp 2
  1836. @end example
  1837. @noindent
  1838. This inserts two blank lines on the printed page.
  1839. (@xref{@code{@@sp}}, for more information about the @code{@@sp}
  1840. command.)
  1841. A template for this method looks like this:
  1842. @example
  1843. @group
  1844. @@titlepage
  1845. @@sp 10
  1846. @@center @@titlefont@{@var{name-of-manual-when-printed}@}
  1847. @@sp 2
  1848. @@center @var{subtitle-if-any}
  1849. @@sp 2
  1850. @@center @var{author}
  1851. @dots{}
  1852. @@end titlepage
  1853. @end group
  1854. @end example
  1855. The spacing of the example fits an 8.5 by 11 inch manual.
  1856. You can in fact use these commands anywhere, not just on a title page,
  1857. but since they are not logical markup commands, we don't recommend
  1858. them.
  1859. @node @code{@@title @@subtitle @@author}
  1860. @subsection @code{@@title}, @code{@@subtitle}, and @code{@@author}
  1861. @anchor{title subtitle author}@c old name
  1862. @findex title
  1863. @findex subtitle
  1864. @findex author
  1865. You can use the @code{@@title}, @code{@@subtitle}, and @code{@@author}
  1866. commands to create a title page in which the vertical and horizontal
  1867. spacing is done for you automatically. This contrasts with the method
  1868. described in the previous section, in which the @code{@@sp} command is
  1869. needed to adjust vertical spacing.
  1870. Write the @code{@@title}, @code{@@subtitle}, or @code{@@author}
  1871. commands at the beginning of a line followed by the title, subtitle,
  1872. or author. The @code{@@author} command may be used for a quotation in
  1873. an @code{@@quotation} block (@pxref{@code{@@quotation}});
  1874. except for that, it is an error to use any of these commands outside
  1875. of @code{@@titlepage}.
  1876. The @code{@@title} command produces a line in which the title is set
  1877. flush to the left-hand side of the page in a larger than normal font.
  1878. The title is underlined with a black rule. The title must be given on
  1879. a single line in the source file; it will be broken into multiple
  1880. lines of output is needed.
  1881. For long titles, the @code{@@*} command may be used to specify the
  1882. line breaks in long titles if the automatic breaks do not suit. Such
  1883. explicit line breaks are generally reflected in all output formats; if
  1884. you only want to specify them for the printed output, use a
  1885. conditional (@pxref{Conditionals}). For example:
  1886. @example
  1887. @@title This Long Title@@inlinefmt@{tex,@@*@} Is Broken in @@TeX@{@}
  1888. @end example
  1889. The @code{@@subtitle} command sets subtitles in a normal-sized font
  1890. flush to the right-hand side of the page.
  1891. The @code{@@author} command sets the names of the author or authors in
  1892. a middle-sized font flush to the left-hand side of the page on a line
  1893. near the bottom of the title page. The names are followed by a black
  1894. rule that is thinner than the rule that underlines the title.
  1895. There are two ways to use the @code{@@author} command: you can write
  1896. the name or names on the remaining part of the line that starts with
  1897. an @code{@@author} command:
  1898. @example
  1899. @@author by Jane Smith and John Doe
  1900. @end example
  1901. @noindent
  1902. or you can write the names one above each other by using multiple
  1903. @code{@@author} commands:
  1904. @example
  1905. @group
  1906. @@author Jane Smith
  1907. @@author John Doe
  1908. @end group
  1909. @end example
  1910. @need 950
  1911. A template for this method looks like this:
  1912. @example
  1913. @group
  1914. @@titlepage
  1915. @@title @var{name-of-manual-when-printed}
  1916. @@subtitle @var{subtitle-if-any}
  1917. @@subtitle @var{second-subtitle}
  1918. @@author @var{author}
  1919. @@page
  1920. @dots{}
  1921. @@end titlepage
  1922. @end group
  1923. @end example
  1924. @node Copyright
  1925. @subsection Copyright Page
  1926. @cindex Copyright page
  1927. @cindex Printed permissions
  1928. @cindex Permissions, printed
  1929. By international treaty, the copyright notice for a book must be either
  1930. on the title page or on the back of the title page. When the copyright
  1931. notice is on the back of the title page, that page is customarily not
  1932. numbered. Therefore, in Texinfo, the information on the copyright page
  1933. should be within @code{@@titlepage} and @code{@@end titlepage}
  1934. commands.
  1935. @findex vskip @r{@TeX{} vertical skip}
  1936. @cindex filll @r{@TeX{} dimension}
  1937. Use the @code{@@page} command to cause a page break. To push the
  1938. copyright notice and the other text on the copyright page towards the
  1939. bottom of the page, use the following incantation after @code{@@page}:
  1940. @example
  1941. @@vskip 0pt plus 1filll
  1942. @end example
  1943. @noindent
  1944. The @code{@@vskip} command inserts whitespace in the @TeX{} output; it
  1945. is ignored in all other output formats. The @samp{0pt plus 1filll}
  1946. means to put in zero points of mandatory whitespace, and as much
  1947. optional whitespace as needed to push the following text to the bottom
  1948. of the page. Note the use of three @samp{l}s in the word
  1949. @samp{filll}; this is correct.
  1950. To insert the copyright text itself, write @code{@@insertcopying}
  1951. next (@pxref{Document Permissions}):
  1952. @example
  1953. @@insertcopying
  1954. @end example
  1955. Follow the copying text by the publisher, ISBN numbers, cover art
  1956. credits, and other such information.
  1957. Here is an example putting all this together:
  1958. @example
  1959. @@titlepage
  1960. @dots{}
  1961. @@page
  1962. @@vskip 0pt plus 1filll
  1963. @@insertcopying
  1964. Published by @dots{}
  1965. Cover art by @dots{}
  1966. @@end titlepage
  1967. @end example
  1968. We have one more special case to consider: for plain text output, you
  1969. must insert the copyright information explicitly if you want it to
  1970. appear. For instance, you could have the following after the copyright
  1971. page:
  1972. @example
  1973. @@ifplaintext
  1974. @@insertcopying
  1975. @@end ifplaintext
  1976. @end example
  1977. You could include other title-like information for the plain text
  1978. output in the same place.
  1979. @node Heading Generation
  1980. @subsection Heading Generation
  1981. @anchor{end titlepage}@c old name
  1982. @cindex Headings, page, begin to appear
  1983. @cindex Titlepage end starts headings
  1984. @cindex End titlepage starts headings
  1985. @cindex Generating page headings
  1986. Like all @code{@@end} commands (@pxref{Quotations and Examples}), the
  1987. @code{@@end titlepage} command must be written at the beginning of a
  1988. line by itself, with only one space between the @code{@@end} and the
  1989. @code{titlepage}. It not only marks the end of the title and
  1990. copyright pages, but also causes @TeX{} to start generating page
  1991. headings and page numbers.
  1992. Texinfo has two standard page heading formats, one for documents
  1993. printed on one side of each sheet of paper (single-sided printing),
  1994. and the other for documents printed on both sides of each sheet
  1995. (double-sided printing).
  1996. In full generality, you can control the headings in different ways:
  1997. @itemize @bullet
  1998. @item
  1999. The conventional way is to write a @code{@@setchapternewpage} command
  2000. before the title page commands, if required, and then have the
  2001. @code{@@end titlepage} command start generating page headings in the
  2002. manner desired.
  2003. Most documents are formatted with the standard single-sided or
  2004. double-sided headings, (sometimes) using @code{@@setchapternewpage
  2005. odd} for double-sided printing and (almost always) no
  2006. @code{@@setchapternewpage} command for single-sided printing
  2007. (@pxref{@code{@@setchapternewpage}}).
  2008. @item
  2009. Alternatively, you can use the @code{@@headings} command to prevent
  2010. page headings from being generated or to start them for either single
  2011. or double-sided printing. Write a @code{@@headings} command
  2012. immediately after the @code{@@end titlepage} command. To turn off
  2013. headings, write @code{@@headings off}. @xref{@code{@@headings}}.
  2014. @item
  2015. Or, you may specify your own page heading and footing format.
  2016. @xref{Headings}.
  2017. @end itemize
  2018. @node Contents
  2019. @section Generating a Table of Contents
  2020. @cindex Table of contents
  2021. @cindex Contents, table of
  2022. @cindex Short table of contents
  2023. @findex contents
  2024. @findex summarycontents
  2025. @findex shortcontents
  2026. The @code{@@chapter}, @code{@@section}, and other structuring commands
  2027. (@pxref{Chapter Structuring}) supply the information to make up a
  2028. table of contents, but they do not cause an actual table to appear in
  2029. the manual. To do this, you must use the @code{@@contents} and/or
  2030. @code{@@summarycontents} command(s).
  2031. @table @code
  2032. @item @@contents
  2033. Generates a table of contents in a printed manual, including all
  2034. chapters, sections, subsections, etc., as well as appendices and
  2035. unnumbered chapters. Headings generated by @code{@@majorheading},
  2036. @code{@@chapheading}, and the other @code{@@@dots{}heading} commands
  2037. do not appear in the table of contents (@pxref{Structuring Command
  2038. Types}).
  2039. @item @@shortcontents
  2040. @itemx @@summarycontents
  2041. (@code{@@summarycontents} is a synonym for @code{@@shortcontents}.)
  2042. Generates a short or summary table of contents that lists only the
  2043. chapters, appendices, and unnumbered chapters. Sections, subsections
  2044. and subsubsections are omitted. Only a long manual needs a short
  2045. table of contents in addition to the full table of contents.
  2046. @end table
  2047. Both contents commands should be written on a line by themselves, and
  2048. placed near the beginning of the file, after the @code{@@end
  2049. titlepage} (@pxref{@code{@@titlepage}}), before any sectioning
  2050. command. The contents commands automatically generate a chapter-like
  2051. heading at the top of the first table of contents page, so don't
  2052. include any sectioning command such as @code{@@unnumbered} before
  2053. them.
  2054. Since an Info file uses menus instead of tables of contents, the Info
  2055. formatting commands ignore the contents commands. But the contents
  2056. are included in plain text output (generated by @code{makeinfo
  2057. --plaintext}) and in other output formats, such as HTML.
  2058. When @code{makeinfo} writes a short table of contents while producing
  2059. HTML output, the links in the short table of contents point to
  2060. corresponding entries in the full table of contents rather than the text
  2061. of the document. The links in the full table of contents point to the
  2062. main text of the document.
  2063. @node The Top Node
  2064. @section The `Top' Node and Master Menu
  2065. @cindex Top node
  2066. @cindex Node, `Top'
  2067. The `Top' node is the node in which a reader enters an Info manual.
  2068. As such, it should begin with a brief description of the manual
  2069. (including the version number), and end with a master menu for the
  2070. whole manual. Of course you should include any other general
  2071. information you feel a reader would find helpful.
  2072. @findex top
  2073. It is conventional and desirable to write a @code{@@top} sectioning
  2074. command line containing the title of the document immediately after
  2075. the @code{@@node Top} line (@pxref{@code{@@top} Command}).
  2076. The contents of the `Top' node should appear only in the online output;
  2077. none of it should appear in printed output, so enclose it between
  2078. @code{@@ifnottex} and @code{@@end ifnottex} commands. (@TeX{} does not
  2079. print either an @code{@@node} line or a menu; they appear only in Info;
  2080. strictly speaking, you are not required to enclose these parts between
  2081. @code{@@ifnottex} and @code{@@end ifnottex}, but it is simplest to do
  2082. so. @xref{Conditionals, , Conditionally Visible Text}.)
  2083. @menu
  2084. * Top Node Example::
  2085. * Master Menu Parts::
  2086. @end menu
  2087. @node Top Node Example
  2088. @subsection Top Node Example
  2089. @cindex Top node example
  2090. Here is an example of a Top node.
  2091. @example
  2092. @group
  2093. @@ifnottex
  2094. @@node Top
  2095. @@top Sample Title
  2096. This is the text of the top node.
  2097. @@end ifnottex
  2098. @end group
  2099. Additional general information.
  2100. @group
  2101. @@menu
  2102. * First Chapter::
  2103. * Second Chapter::
  2104. @dots{}
  2105. * Index::
  2106. @end group
  2107. @@end menu
  2108. @end example
  2109. @node Master Menu Parts
  2110. @subsection Parts of a Master Menu
  2111. @cindex Master menu
  2112. @cindex Menu, master
  2113. @cindex Parts of a master menu
  2114. A @dfn{master menu} is the main menu. It is customary to include a
  2115. detailed menu listing all the nodes in the document in this menu.
  2116. Like any other menu, a master menu is enclosed in @code{@@menu} and
  2117. @code{@@end menu} and does not appear in the printed output.
  2118. Generally, a master menu is divided into parts.
  2119. @itemize @bullet
  2120. @item
  2121. The first part contains the major nodes in the Texinfo file: the nodes
  2122. for the chapters, chapter-like sections, and the appendices.
  2123. @item
  2124. The second part contains nodes for the indices.
  2125. @item
  2126. @findex detailmenu
  2127. @cindex Detailed menu
  2128. The third and subsequent parts contain a listing of the other,
  2129. lower-level nodes, often ordered by chapter. This way, rather than go
  2130. through an intermediary menu, an inquirer can go directly to a
  2131. particular node when searching for specific information. These menu
  2132. items are not required; add them if you think they are a convenience.
  2133. If you do use them, put @code{@@detailmenu} before the first one, and
  2134. @code{@@end detailmenu} after the last; otherwise, @code{makeinfo}
  2135. will get confused.
  2136. @end itemize
  2137. Each section in the menu can be introduced by a descriptive line. So
  2138. long as the line does not begin with an asterisk, it will not be
  2139. treated as a menu entry. (@xref{Writing a Menu}, for more
  2140. information.)
  2141. For example, the master menu for this manual looks like the following
  2142. (but has many more entries):
  2143. @example
  2144. @group
  2145. @@menu
  2146. * Copying Conditions:: Your rights.
  2147. * Overview:: Texinfo in brief.
  2148. @dots{}
  2149. @end group
  2150. @group
  2151. * Command and Variable Index::
  2152. * General Index::
  2153. @end group
  2154. @group
  2155. @@detailmenu
  2156. --- The Detailed Node Listing ---
  2157. Overview of Texinfo
  2158. * Reporting Bugs:: @dots{}
  2159. @dots{}
  2160. @end group
  2161. @group
  2162. Beginning a Texinfo File
  2163. * Sample Beginning:: @dots{}
  2164. @dots{}
  2165. @@end detailmenu
  2166. @@end menu
  2167. @end group
  2168. @end example
  2169. @node Global Document Commands
  2170. @section Global Document Commands
  2171. @cindex Global Document Commands
  2172. Besides the basic commands mentioned in the previous sections, here are
  2173. additional commands which affect the document as a whole. They are
  2174. generally all given before the Top node, if they are given at all.
  2175. @menu
  2176. * @code{@@documentdescription}:: Document summary for the HTML output.
  2177. * @code{@@setchapternewpage}:: Start chapters on right-hand pages.
  2178. * @code{@@headings}:: An option for turning headings on and off
  2179. and double or single sided printing.
  2180. * @code{@@paragraphindent}:: Specify paragraph indentation.
  2181. * @code{@@firstparagraphindent}:: Suppressing first paragraph indentation.
  2182. * @code{@@exampleindent}:: Specify environment indentation.
  2183. @end menu
  2184. @node @code{@@documentdescription}
  2185. @subsection @code{@@documentdescription}: Summary Text
  2186. @anchor{documentdescription}@c old name
  2187. @cindex Document description
  2188. @cindex Description of document
  2189. @cindex Summary of document
  2190. @cindex Abstract of document
  2191. @cindex @code{<meta>} HTML tag, and document description
  2192. @findex documentdescription
  2193. When producing HTML output for a document, @command{makeinfo} writes a
  2194. @samp{<meta>} element in the @samp{<head>} to give some idea of the
  2195. content of the document. By default, this @dfn{description} is the
  2196. title of the document, taken from the @code{@@settitle} command
  2197. (@pxref{@code{@@settitle}}). To change this, use the
  2198. @code{@@documentdescription} environment, as in:
  2199. @example
  2200. @@documentdescription
  2201. descriptive text.
  2202. @@end documentdescription
  2203. @end example
  2204. @noindent
  2205. This will produce the following output in the @samp{<head>} of the HTML:
  2206. @example
  2207. <meta name=description content="descriptive text.">
  2208. @end example
  2209. @code{@@documentdescription} must be specified before the first node of
  2210. the document.
  2211. @node @code{@@setchapternewpage}
  2212. @subsection @code{@@setchapternewpage}: Blank Pages Before Chapters
  2213. @anchor{setchapternewpage}@c old name
  2214. @findex setchapternewpage
  2215. @cindex Starting chapters
  2216. @cindex Pages, starting odd
  2217. In an officially bound book, text is usually printed on both sides of
  2218. the paper, chapters start on right-hand pages, and right-hand pages have
  2219. odd numbers. But in short reports, text often is printed only on one
  2220. side of the paper. Also in short reports, chapters sometimes do not
  2221. start on new pages, but are printed on the same page as the end of the
  2222. preceding chapter, after a small amount of vertical whitespace.
  2223. You can use the @code{@@setchapternewpage} command with various
  2224. arguments to specify how @TeX{} should start chapters and whether it
  2225. should format headers for printing on one or both sides of the paper
  2226. (single-sided or double-sided printing).
  2227. Write the @code{@@setchapternewpage} command at the beginning of a
  2228. line followed by its argument.
  2229. For example, you would write the following to cause each chapter to
  2230. start on a fresh odd-numbered page:
  2231. @example
  2232. @@setchapternewpage odd
  2233. @end example
  2234. You can specify one of three alternatives with the
  2235. @code{@@setchapternewpage} command:
  2236. @table @asis
  2237. @item @code{@@setchapternewpage off}
  2238. Cause @TeX{} to typeset a new chapter on the same page as the last
  2239. chapter, after skipping some vertical whitespace. Also, cause @TeX{} to
  2240. format page headers for single-sided printing.
  2241. @item @code{@@setchapternewpage on}
  2242. Cause @TeX{} to start new chapters on new pages and to format page
  2243. headers for single-sided printing. This is the form most often used for
  2244. short reports or personal printing. This is the default.
  2245. @item @code{@@setchapternewpage odd}
  2246. Cause @TeX{} to start new chapters on new, odd-numbered pages
  2247. (right-handed pages) and to typeset for double-sided printing. This is
  2248. the form most often used for books and manuals.
  2249. @end table
  2250. Texinfo does not have a @code{@@setchapternewpage even} command,
  2251. because there is no printing tradition of starting chapters or books on
  2252. an even-numbered page.
  2253. If you don't like the default headers that @code{@@setchapternewpage}
  2254. sets, you can explicit control them with the @code{@@headings} command.
  2255. @xref{@code{@@headings}}.
  2256. At the beginning of a manual or book, pages are not numbered---for
  2257. example, the title and copyright pages of a book are not numbered. By
  2258. convention, table of contents and frontmatter pages are numbered with
  2259. roman numerals and not in sequence with the rest of the document.
  2260. The @code{@@setchapternewpage} has no effect in output formats that do
  2261. not have pages, such as Info and HTML.
  2262. We recommend not including any @code{@@setchapternewpage} command in
  2263. your document source at all, since such desired pagination is not
  2264. intrinsic to the document. For a particular hard copy run, if you
  2265. don't want the default output (no blank pages, same headers on all
  2266. pages) use the @option{--texinfo} option to @command{texi2dvi} to
  2267. specify the output you want.
  2268. @node @code{@@headings}
  2269. @subsection The @code{@@headings} Command
  2270. @anchor{headings on off}@c old name
  2271. @findex headings
  2272. The @code{@@headings} command is rarely used. It specifies what kind of
  2273. page headings and footings to print on each page. Usually, this is
  2274. controlled by the @code{@@setchapternewpage} command. You need the
  2275. @code{@@headings} command only if the @code{@@setchapternewpage} command
  2276. does not do what you want, or if you want to turn off predefined page
  2277. headings prior to defining your own. Write a @code{@@headings} command
  2278. immediately after the @code{@@end titlepage} command.
  2279. You can use @code{@@headings} as follows:
  2280. @table @code
  2281. @item @@headings off
  2282. Turn off printing of page headings.
  2283. @item @@headings single
  2284. Turn on page headings appropriate for single-sided printing.
  2285. @item @@headings double
  2286. Turn on page headings appropriate for double-sided printing.
  2287. @item @@headings singleafter
  2288. @itemx @@headings doubleafter
  2289. Turn on @code{single} or @code{double} headings, respectively, after the
  2290. current page is output.
  2291. @item @@headings on
  2292. Turn on page headings: @code{single} if @samp{@@setchapternewpage
  2293. on}, @code{double} otherwise.
  2294. @end table
  2295. For example, suppose you write @code{@@setchapternewpage off} before the
  2296. @code{@@titlepage} command to tell @TeX{} to start a new chapter on the
  2297. same page as the end of the last chapter. This command also causes
  2298. @TeX{} to typeset page headers for single-sided printing. To cause
  2299. @TeX{} to typeset for double sided printing, write @code{@@headings
  2300. double} after the @code{@@end titlepage} command.
  2301. You can stop @TeX{} from generating any page headings at all by
  2302. writing @code{@@headings off} on a line of its own immediately after the
  2303. line containing the @code{@@end titlepage} command, like this:
  2304. @example
  2305. @@end titlepage
  2306. @@headings off
  2307. @end example
  2308. @noindent
  2309. The @code{@@headings off} command overrides the @code{@@end titlepage}
  2310. command, which would otherwise cause @TeX{} to print page headings.
  2311. You can also specify your own style of page heading and footing.
  2312. @xref{Headings, , Page Headings}, for more information.
  2313. @node @code{@@paragraphindent}
  2314. @subsection @code{@@paragraphindent}: Controlling Paragraph Indentation
  2315. @anchor{paragraphindent}@c old name
  2316. @findex paragraphindent
  2317. @cindex Indenting paragraphs, control of
  2318. @cindex Paragraph indentation control
  2319. The Texinfo processors may insert whitespace at the beginning of the
  2320. first line of each paragraph, thereby indenting that paragraph. You can
  2321. use the @code{@@paragraphindent} command to specify this indentation.
  2322. Write a @code{@@paragraphindent} command at the beginning of a line
  2323. followed by either @samp{asis} or a number:
  2324. @example
  2325. @@paragraphindent @var{indent}
  2326. @end example
  2327. The indentation is according to the value of @var{indent}:
  2328. @table @asis
  2329. @item @code{asis}
  2330. Do not change the existing indentation (not implemented in @TeX{}).
  2331. @item @code{none}
  2332. @itemx 0
  2333. Omit all indentation.
  2334. @item @var{n}
  2335. Indent by @var{n} space characters in Info output, by @var{n} ems in
  2336. @TeX{}.
  2337. @end table
  2338. The default value of @var{indent} is 3. @code{@@paragraphindent} is
  2339. ignored for HTML output.
  2340. It is best to write the @code{@@paragraphindent} command before the
  2341. end-of-header line at the beginning of a Texinfo file, so the region
  2342. formatting commands indent paragraphs as specified. @xref{Start of
  2343. Header}.
  2344. @node @code{@@firstparagraphindent}
  2345. @subsection @code{@@firstparagraphindent}: Indenting After Headings
  2346. @anchor{firstparagraphindent}@c old name
  2347. @findex firstparagraphindent
  2348. @cindex First paragraph, suppressing indentation of
  2349. @cindex Suppressing first paragraph indentation
  2350. @cindex Preventing first paragraph indentation
  2351. @cindex Indenting, suppressing of first paragraph
  2352. @cindex Headings, indentation after
  2353. As you can see in the present manual, the first paragraph in any
  2354. section is not indented by default. Typographically, indentation is a
  2355. paragraph separator, which means that it is unnecessary when a new
  2356. section begins. This indentation is controlled with the
  2357. @code{@@firstparagraphindent} command:
  2358. @example
  2359. @@firstparagraphindent @var{word}
  2360. @end example
  2361. The first paragraph after a heading is indented according to the value
  2362. of @var{word}:
  2363. @table @asis
  2364. @item @code{none}
  2365. Prevents the first paragraph from being indented (default).
  2366. This option is ignored by @command{makeinfo} if
  2367. @code{@@paragraphindent asis} is in effect.
  2368. @item @code{insert}
  2369. Include normal paragraph indentation. This respects the paragraph
  2370. indentation set by a @code{@@paragraphindent} command
  2371. (@pxref{@code{@@paragraphindent}}).
  2372. @end table
  2373. @code{@@firstparagraphindent} is ignored for HTML and Docbook output.
  2374. It is best to write the @code{@@firstparagraphindent} command before the
  2375. end-of-header line at the beginning of a Texinfo file, so the region
  2376. formatting commands indent paragraphs as specified. @xref{Start of
  2377. Header}.
  2378. @node @code{@@exampleindent}
  2379. @subsection @code{@@exampleindent}: Environment Indenting
  2380. @anchor{exampleindent}@c old name
  2381. @findex exampleindent
  2382. @cindex Indenting environments
  2383. @cindex Environment indentation
  2384. @cindex Example indentation
  2385. The Texinfo processors indent each line of @code{@@example} and similar
  2386. environments. You can use the @code{@@exampleindent} command to specify
  2387. this indentation. Write an @code{@@exampleindent} command at the
  2388. beginning of a line followed by either @samp{asis} or a number:
  2389. @example
  2390. @@exampleindent @var{indent}
  2391. @end example
  2392. The indentation is according to the value of @var{indent}:
  2393. @table @asis
  2394. @item @code{asis}
  2395. Do not change the existing indentation (not implemented in @TeX{}).
  2396. @item 0
  2397. Omit all indentation.
  2398. @item @var{n}
  2399. Indent environments by @var{n} space characters in Info output, by
  2400. @var{n} ems in @TeX{}.
  2401. @end table
  2402. The default value of @var{indent} is 5 spaces in Info, and 0.4@dmn{in}
  2403. in @TeX{}, which is somewhat less. (The reduction is to help @TeX{}
  2404. fit more characters onto physical lines.)
  2405. It is best to write the @code{@@exampleindent} command before the
  2406. end-of-header line at the beginning of a Texinfo file, so the region
  2407. formatting commands indent paragraphs as specified. @xref{Start of
  2408. Header}.
  2409. @node Ending a File
  2410. @section Ending a Texinfo File
  2411. @cindex Ending a Texinfo file
  2412. @cindex Texinfo file ending
  2413. @cindex File ending
  2414. @findex bye
  2415. The end of a Texinfo file should include commands to create indices
  2416. (@pxref{Printing Indices & Menus}), and the @code{@@bye} command to mark
  2417. the last line to be processed. For example:
  2418. @example
  2419. @@node Index
  2420. @@unnumbered Index
  2421. @@printindex cp
  2422. @@bye
  2423. @end example
  2424. @findex bye
  2425. @anchor{File End}
  2426. An @code{@@bye} command terminates Texinfo processing. None of the
  2427. formatters process anything following @code{@@bye}; any such text is
  2428. completely ignored. The @code{@@bye} command should be on a line by
  2429. itself.
  2430. Thus, if you wish, you may follow the @code{@@bye} line with arbitrary
  2431. notes. Also, you may follow the @code{@@bye} line with a local
  2432. variables list for Emacs, most typically a @samp{compile-command}
  2433. (@pxref{Compile-Command,, Using the Local Variables List}).
  2434. @node Nodes
  2435. @chapter Nodes
  2436. @anchor{node}@anchor{@@node} @c old names
  2437. @cindex Node, defined
  2438. A @dfn{node} is a region of text that begins at a @code{@@node}
  2439. command, and continues until the next @code{@@node} command.
  2440. To specify a node, write a @code{@@node} command at the beginning of
  2441. a line, and follow it with the name of the node.
  2442. Each node contains the discussion of one topic. Info readers
  2443. display one node at a time, and provide commands for the user to move
  2444. to related nodes. The HTML output can be similarly navigated.
  2445. Nodes are used as the targets of cross-references. Cross-references,
  2446. such as the one at the end of this sentence, are made with @code{@@xref}
  2447. and related commands; see @ref{Cross References}. Cross-references can
  2448. be sprinkled throughout the text, and provide a way to represent links
  2449. that do not fit a hierarchical structure.
  2450. Normally, you put a node command immediately before each chapter
  2451. structuring command---for example, an @code{@@section} or
  2452. @code{@@subsection} line. (@xref{Chapter Structuring}.).
  2453. You must do this even if you do not intend to format the file for Info.
  2454. This is because @TeX{} uses both @code{@@node} names and
  2455. chapter-structuring names in the output for cross-references. The only
  2456. time you are likely to use the chapter structuring commands without also
  2457. using nodes is if you are writing a document that contains no cross
  2458. references and will only be printed, not transformed into Info, HTML, or
  2459. other formats.
  2460. @menu
  2461. * Texinfo Document Structure:: Double structure of documents.
  2462. * Node Names:: How to choose node names.
  2463. * Writing a Node:: How to write an @code{@@node} line.
  2464. * Node Line Requirements:: Keep names unique.
  2465. * First Node:: How to write a `Top' node.
  2466. * @code{@@top} Command:: How to use the @code{@@top} command.
  2467. * Node Menu Illustration:: A diagram, and sample nodes and menus.
  2468. * @command{makeinfo} Pointer Creation:: Letting makeinfo determine node pointers.
  2469. * Menus:: Listing subordinate nodes.
  2470. @end menu
  2471. @node Texinfo Document Structure
  2472. @section Texinfo Document Structure
  2473. @cindex Texinfo document structure
  2474. @cindex Document structure, of Texinfo
  2475. @cindex Structure, of Texinfo documents
  2476. @cindex Double structure, of Texinfo documents
  2477. @anchor{Two Paths}@c node name
  2478. Nodes can contain @dfn{menus}, which contain the names of @dfn{child
  2479. nodes} within the parent node; for example, a node corresponding to a
  2480. chapter would have a menu of the sections in that chapter. The menus
  2481. allow the user to move to the child nodes in a natural way in the online
  2482. output.
  2483. In addition, nodes contain @dfn{node pointers} that name other nodes.
  2484. The `Next' and `Previous' pointers form nodes at the same sectioning
  2485. level into a chain. As you might imagine, the `Next' pointer links to
  2486. the next node, and the `Previous' pointer links to the previous node.
  2487. Thus, for example, all the nodes that are at the level of sections
  2488. within a chapter are linked together, and the order in this chain
  2489. is the same as the order of the children in the menu of the parent
  2490. chapter. Each child node records the parent node name as its `Up'
  2491. pointer.
  2492. @opindex accesskey@r{, in HTML output of nodes}
  2493. The Info and HTML output from @command{makeinfo} for each node includes
  2494. links to the `Next', `Previous', and `Up' nodes. The HTML also uses
  2495. the @code{accesskey} attribute with the values @samp{n}, @samp{p}, and
  2496. @samp{u} respectively. This allows people using web browsers to
  2497. follow the navigation using (typically) @kbd{M-@var{letter}}, e.g.,
  2498. @kbd{M-n} for the `Next' node, from anywhere within the node.
  2499. Node pointers and menus provide structure for Info files just as
  2500. chapters, sections, subsections, and the like provide structure for
  2501. printed books. The two structures are theoretically distinct; in
  2502. practice, however, the tree structure of printed books is essentially
  2503. always used for the node and menu structure also, as this leads to a
  2504. document which is easiest to follow. @xref{Texinfo Document
  2505. Structure}.
  2506. Typically, the sectioning structure and the node structure are
  2507. completely parallel, with one node for each chapter, section, etc.,
  2508. and with the nodes following the same hierarchical arrangement as the
  2509. sectioning. Thus, if a node is at the logical level of a chapter, its
  2510. child nodes are at the level of sections; similarly, the child nodes
  2511. of sections are at the level of subsections.
  2512. Although it is technically possible to create Texinfo documents with
  2513. only one structure or the other, or for the two structures not to be
  2514. parallel, or for either the sectioning or node structure to be
  2515. abnormally formed, etc., this is @emph{not at all recommended}. To
  2516. the best of our knowledge, all the Texinfo manuals currently in
  2517. general use do follow the conventional parallel structure.
  2518. @node Node Names
  2519. @section Choosing Node Names
  2520. @cindex Node names, choosing
  2521. The name of a node identifies the node. For all the details of node
  2522. names, @pxref{Node Line Requirements}).
  2523. @anchor{Node Line Tips}@c previous node name
  2524. Here are some suggestions for node names:
  2525. @itemize @bullet
  2526. @item
  2527. Try to pick node names that are informative but short.
  2528. In the Info file, the file name, node name, and pointer names are all
  2529. inserted on one line, which may run into the right edge of the window.
  2530. (This does not cause a problem with Info, but is ugly.)
  2531. @item
  2532. Try to pick node names that differ from each other near the beginnings
  2533. of their names. This way, it is easy to use automatic name completion in
  2534. Info.
  2535. @item
  2536. Conventionally, node names are capitalized in the same way as section
  2537. and chapter titles. In this manual, initial and significant words are
  2538. capitalized; others are not. In other manuals, just initial words and
  2539. proper nouns are capitalized. Either way is fine; we recommend just
  2540. being consistent.
  2541. @end itemize
  2542. Because node names are used in cross-references, it is not desirable
  2543. to casually change them once published. Such name changes invalidate
  2544. references from other manuals, from mail archives, and so on.
  2545. @xref{HTML Xref Link Preservation}.
  2546. The pointers from a given node enable you to reach other nodes and
  2547. consist simply of the names of those nodes. The pointers are usually
  2548. not specified explicitly, as @command{makeinfo} can determine them
  2549. (@pxref{@command{makeinfo} Pointer Creation}).
  2550. Normally, a node's `Up' pointer contains the name of the node whose
  2551. menu mentions that node. The node's `Next' pointer contains the name
  2552. of the node that follows the present node in that menu and its
  2553. `Previous' pointer contains the name of the node that precedes it in
  2554. that menu. When a node's `Previous' node is the same as its `Up'
  2555. node, both pointers name the same node.
  2556. Usually, the first node of a Texinfo file is the `Top' node, and its
  2557. `Up' pointer points to the @file{dir} file, which contains the main menu
  2558. for all of Info.
  2559. @node Writing a Node
  2560. @section Writing an @code{@@node} Line
  2561. @cindex Writing an @code{@@node} line
  2562. @cindex @code{@@node} line writing
  2563. @cindex Node line writing
  2564. @findex node
  2565. The easiest way to write an @code{@@node} line is to write @code{@@node}
  2566. at the beginning of a line and then the name of the node, like this:
  2567. @example
  2568. @@node @var{node-name}
  2569. @end example
  2570. After you have inserted an @code{@@node} line, you should immediately
  2571. write an @@-command for the chapter or section and insert its name.
  2572. Next (and this is important!), put in several index entries. Usually,
  2573. you will find at least two and often as many as four or five ways of
  2574. referring to the node in the index. Use them all. This will make it
  2575. much easier for people to find the node.
  2576. If you wish, you can ignore @code{@@node} lines altogether in your
  2577. first draft and then use the @code{texinfo-insert-node-lines} command
  2578. to create @code{@@node} lines for you. However, we do not recommend
  2579. this practice. It is better to name the node itself at the same time
  2580. that you write a segment so you can easily make cross-references.
  2581. Useful cross-references are an especially important feature of a good
  2582. Texinfo manual.
  2583. Even when you explicitly specify all pointers, you cannot write the
  2584. nodes in the Texinfo source file in an arbitrary order! Because
  2585. formatters must process the file sequentially, irrespective of node
  2586. pointers, you must write the nodes in the order you wish them to
  2587. appear in the output. For Info format one can imagine that the order
  2588. may not matter, but it matters for the other formats.
  2589. You may optionally follow the node name argument to @code{@@node}
  2590. with up to three optional arguments on the rest of the same line,
  2591. separating the arguments with commas. These are the names of the
  2592. `Next', `Previous', and `Up' pointers, in that order. We recommend
  2593. omitting them if your Texinfo document is hierarchically organized,
  2594. as virtually all are (@pxref{@command{makeinfo} Pointer Creation}).
  2595. Any spaces before or after each name on the @code{@@node} line are
  2596. ignored.
  2597. The template for a fully-written-out node line with `Next', `Previous',
  2598. and `Up' pointers looks like this:
  2599. @example
  2600. @@node @var{node-name}, @var{next}, @var{previous}, @var{up}
  2601. @end example
  2602. The @var{node-name} argument must be present, but the others are
  2603. optional. If you wish to specify some but not others, just insert
  2604. commas as needed, as in: @samp{@@node mynode,,,uppernode}. However,
  2605. we recommend leaving off all the pointers and letting @code{makeinfo}
  2606. determine them.
  2607. If you are using GNU Emacs, you can use the update node commands
  2608. provided by Texinfo mode to insert the names of the pointers; or
  2609. (recommended), you can leave the pointers out of the Texinfo file and
  2610. let @code{makeinfo} insert node pointers into the Info file it
  2611. creates. (@xref{Texinfo Mode}, and @ref{@command{makeinfo} Pointer
  2612. Creation}.)
  2613. Alternatively, you can insert the `Next', `Previous', and `Up'
  2614. pointers yourself. If you do this, you may find it helpful to use the
  2615. Texinfo mode keyboard command @kbd{C-c C-c n}. This command inserts
  2616. @samp{@@node} and a comment line listing the names of the pointers in
  2617. their proper order. The comment line helps you keep track of which
  2618. arguments are for which pointers. This comment line is especially useful
  2619. if you are not familiar with Texinfo.
  2620. @node Node Line Requirements
  2621. @section @code{@@node} Line Requirements
  2622. @cindex Node line requirements
  2623. @cindex Restrictions on node names
  2624. Names used with @code{@@node} have several requirements:
  2625. @itemize @bullet
  2626. @item
  2627. @cindex Unique node names requirement
  2628. @cindex Node names must be unique
  2629. All the node names in a single Texinfo file must be unique.
  2630. This means, for example, that if you end every chapter with a summary,
  2631. you must name each summary node differently. You cannot just call
  2632. them all ``Summary''. You may, however, duplicate the titles of
  2633. chapters, sections, and the like. Thus you can end each chapter with
  2634. a section called ``Summary'', so long as the node names for those
  2635. sections are all different.
  2636. @item
  2637. @cindex Commands in node names
  2638. @cindex @@-commands in node names
  2639. Node names can contain @@-commands. The output is generally the
  2640. natural result of the command; for example, using @code{@@TeX@{@}} in a
  2641. node name results in the @TeX{} logo being output, as it would be in
  2642. normal text. Cross-references should use @code{@@TeX@{@}} just as the
  2643. node name does.
  2644. For Info and HTML output, especially, it is necessary to expand
  2645. commands to some sequence of plain characters; for instance,
  2646. @code{@@TeX@{@}} expands to the three letters @samp{TeX} in the Info
  2647. node name. However, cross-references to the node should not take the
  2648. ``shortcut'' of using @samp{TeX}; stick to the actual node name,
  2649. commands and all.
  2650. Some commands do not make sense in node names; for instance,
  2651. environments (e.g., @code{@@quotation}), commands that read a whole
  2652. line as their argument (e.g., @code{@@sp}), and plenty of others.
  2653. For the complete list of commands that are allowed, and their
  2654. expansion for HTML identifiers and file names, @pxref{HTML Xref
  2655. Command Expansion}. The expansions for Info are generally given with
  2656. main the description of the command.
  2657. Prior to the Texinfo 5 release in 2013, this feature was supported in
  2658. an ad hoc way (the @option{--commands-in-node-names} option to
  2659. @command{makeinfo}). Now it is part of the language.
  2660. @item
  2661. @cindex Colon in node name
  2662. @cindex Comma in node name
  2663. @cindex Parentheses in node name
  2664. @cindex Period in node name
  2665. @cindex Characters, invalid in node name
  2666. @cindex Invalid characters in node names
  2667. @cindex Node names, invalid characters in
  2668. Unfortunately, you cannot reliably use periods, commas, or colons
  2669. within a node name; these can confuse the Info reader. Also, a node
  2670. name may not start with a left parenthesis preceding a right
  2671. parenthesis, as in @code{(not)allowed}, since this syntax is used to
  2672. specify an external manual. (Perhaps these limitations will be
  2673. removed some day.)
  2674. @command{makeinfo} warns about such problematic usage in node names,
  2675. menu items, and cross-references. If you don't want to see the
  2676. warnings, you can set the customization variable
  2677. @code{INFO_SPECIAL_CHARS_WARNING} to @samp{0} (@pxref{Other
  2678. Customization Variables}).
  2679. Also, if you insist on using these characters in node names (accepting
  2680. the resulting substandard Info output), in order not to confuse the
  2681. Texinfo processors you must still escape those characters, by using
  2682. either special insertions (@pxref{Inserting a Comma}) or @code{@@asis}
  2683. (@pxref{@code{@@asis}}). For example:
  2684. @example
  2685. @@node foo@@asis@{::@}bar
  2686. @end example
  2687. As an example of avoiding the special characters, the following is a
  2688. section title in this manual:
  2689. @smallexample
  2690. @@section @@code@{@@@@unnumbered@}, @@code@{@@@@appendix@}: ...
  2691. @end smallexample
  2692. @noindent
  2693. But the corresponding node name lacks the commas and the subtitle:
  2694. @smallexample
  2695. @@node @code{@@unnumbered @@appendix}
  2696. @end smallexample
  2697. @cindex Case in node name
  2698. @item
  2699. Case is significant in node names.
  2700. @cindex White space in node name
  2701. @cindex Spaces in node name
  2702. @item
  2703. Spaces before and after names on the @samp{@@node} line are ignored.
  2704. Multiple whitespace characters ``inside'' a name are collapsed to a
  2705. single space. For example:
  2706. @example
  2707. @@node foo bar
  2708. @@node foo bar,
  2709. @@node foo bar ,
  2710. @@node foo bar,
  2711. @@node foo bar ,
  2712. @end example
  2713. @noindent all define the same node, namely @samp{foo bar}.
  2714. In menu entries, this is the name that should be used: no leading or
  2715. trailing spaces, and a single internal space. (For cross-references,
  2716. the node name used in the Texinfo sources is automatically normalized
  2717. in this way.)
  2718. @item
  2719. The next/previous/up pointers on @code{@@node} lines must be the names
  2720. of nodes. (It's recommended to leave out these explicit node pointer
  2721. names, which automatically avoids any problem here; @pxref{@command{makeinfo}
  2722. Pointer Creation}.)
  2723. @end itemize
  2724. @node First Node
  2725. @section The First Node
  2726. @cindex Top node is first
  2727. @cindex First node
  2728. The first node of a Texinfo file is the @dfn{Top} node, except in an
  2729. included file (@pxref{Include Files}). The Top node should contain a
  2730. short summary, copying permissions, and a master menu. @xref{The Top
  2731. Node}, for more information on the Top node contents and examples.
  2732. Here is a description of the node pointers to be used in the Top node:
  2733. @itemize @bullet
  2734. @item
  2735. @cindex Up node of Top node
  2736. @cindex (dir) as Up node of Top node
  2737. The Top node (which must be named @samp{top} or @samp{Top}) should have
  2738. as its `Up' node the name of a node in another file, where there is a
  2739. menu that leads to this file. Specify the file name in parentheses.
  2740. Usually, all Info files are available through a single virtual Info
  2741. tree, constructed from multiple directories. In this case, use
  2742. @samp{(dir)} as the parent of the Top node; this specifies the
  2743. top-level node in the @file{dir} file, which contains the main menu
  2744. for the Info system as a whole. (Each directory with Info files is
  2745. intended to contain a file named @file{dir}.)
  2746. That's fine for Info, but for HTML output, one might well want the Up
  2747. link from the Top node to go somewhere other than @samp{dir.html}.
  2748. For example, for GNU the natural place would be
  2749. @url{http://www.gnu.org/manual/} (a web page collecting links to most
  2750. GNU manuals), better specified as just @code{/manual/} if the manual
  2751. will be installed on @code{www.gnu.org}. This can be specified with
  2752. the @code{TOP_NODE_UP_URL} customization variable (@pxref{HTML
  2753. Customization Variables}), as in
  2754. @example
  2755. $ @kbd{makeinfo --html -c TOP_NODE_UP_URL=/manual/} ...
  2756. @end example
  2757. All links to @code{(dir)} will be replaced by the given url.
  2758. @item
  2759. @cindex Prev node of Top node
  2760. The `Prev' node of the Top node is usually either omitted or also set
  2761. to @file{(dir)}. Either is fine.
  2762. @item
  2763. @cindex Next node of Top node
  2764. The `Next' node of the Top node should be the first chapter in your
  2765. document.
  2766. @end itemize
  2767. @xref{Installing an Info File}, for more information about installing
  2768. an Info file in the @file{info} directory.
  2769. It is usually best to leave the pointers off entirely and let the
  2770. tools implicitly define them, with this simple result:
  2771. @example
  2772. @@node Top
  2773. @end example
  2774. @node @code{@@top} Command
  2775. @section The @code{@@top} Sectioning Command
  2776. @anchor{top command}@c old name
  2777. @anchor{makeinfo top}@c another old name
  2778. @anchor{makeinfo top command}@c yet another name
  2779. @findex top
  2780. The @code{@@top} command is a special sectioning command that you
  2781. should only use after a @samp{@@node Top} line at the beginning of a
  2782. Texinfo file. The @code{@@top} command tells the @code{makeinfo}
  2783. formatter which node is to be used as the root of the node tree.
  2784. It produces the same sort of output as @code{@@unnumbered}
  2785. (@pxref{@code{@@unnumbered @@appendix}}).
  2786. The @code{@@top} node is conventionally wrapped in an
  2787. @code{@@ifnottex} conditional so that it will not appear in @TeX{}
  2788. output (@pxref{Conditionals}).
  2789. Thus, in practice, a Top node usually looks like this:
  2790. @example
  2791. @@ifnottex
  2792. @@node Top
  2793. @@top @var{your-manual-title}
  2794. @var{very-high-level-summary}
  2795. @@end ifnottex
  2796. @end example
  2797. @code{@@top} is ignored when raising or lowering sections. That is,
  2798. it is never lowered and nothing can be raised to it
  2799. (@pxref{Raise/lower sections}).
  2800. @node Node Menu Illustration
  2801. @section Node and Menu Illustration
  2802. Here is a diagram that illustrates a Texinfo file with three chapters,
  2803. each of which contains two sections.
  2804. The ``root'' is at the top of the diagram and the ``leaves'' are at
  2805. the bottom. This is how such a diagram is drawn conventionally; it
  2806. illustrates an upside-down tree. For this reason, the root node is
  2807. called the `Top' node, and `Up' node pointers carry you closer to the
  2808. root.
  2809. @example
  2810. @group
  2811. Top
  2812. |
  2813. -------------------------------------
  2814. | | |
  2815. Chapter 1 Chapter 2 Chapter 3
  2816. | | |
  2817. -------- -------- --------
  2818. | | | | | |
  2819. Section Section Section Section Section Section
  2820. 1.1 1.2 2.1 2.2 3.1 3.2
  2821. @end group
  2822. @end example
  2823. Using explicit pointers (not recommended, but for shown for purposes
  2824. of the example), the fully-written command to start Chapter@tie{}2
  2825. would be this:
  2826. @example
  2827. @group
  2828. @@node Chapter 2, Chapter 3, Chapter 1, Top
  2829. @@comment node-name, next, previous, up
  2830. @end group
  2831. @end example
  2832. @noindent
  2833. This @code{@@node} line says that the name of this node is
  2834. ``Chapter@tie{}2'', the name of the `Next' node is ``Chapter 3'', the
  2835. name of the `Previous' node is ``Chapter@tie{}1'', and the name of the
  2836. `Up' node is ``Top''. You can (and should) omit writing out these
  2837. node names if your document is hierarchically organized
  2838. (@pxref{@command{makeinfo} Pointer Creation}), but the pointer
  2839. relationships still obtain.
  2840. @quotation Note
  2841. `Next' and `Previous' refer to nodes at the @emph{same hierarchical
  2842. level} in the manual, not necessarily to the next node within the
  2843. Texinfo file. In the Texinfo file, the subsequent node may be at a
  2844. lower level---a section-level node most often follows a chapter-level
  2845. node, for example. (The `Top' node contains the exception to this
  2846. rule. Since the `Top' node is the only node at that level, `Next'
  2847. refers to the first following node, which is almost always a chapter
  2848. or chapter-level node.)
  2849. @end quotation
  2850. To go to Sections 2.1 and 2.2 using Info, you need a menu inside
  2851. Chapter 2. (@xref{Menus}.) You would write the menu just before the
  2852. beginning of Section 2.1, like this:
  2853. @example
  2854. @group
  2855. @@menu
  2856. * Sect. 2.1:: Description of this section.
  2857. * Sect. 2.2:: Description.
  2858. @@end menu
  2859. @end group
  2860. @end example
  2861. Using explicit pointers, the node for Sect.@: 2.1 is written like this:
  2862. @example
  2863. @group
  2864. @@node Sect. 2.1, Sect. 2.2, Chapter 2, Chapter 2
  2865. @@comment node-name, next, previous, up
  2866. @end group
  2867. @end example
  2868. In Info format, the `Next' and `Previous' pointers of a node usually
  2869. lead to other nodes at the same level---from chapter to chapter or
  2870. from section to section (sometimes, as shown, the `Previous' pointer
  2871. points up); an `Up' pointer usually leads to a node at the level above
  2872. (closer to the `Top' node); and a `Menu' leads to nodes at a level
  2873. below (closer to `leaves'). (A cross-reference can point to a node at
  2874. any level; see @ref{Cross References}.)
  2875. A @code{@@node} command and a chapter structuring command are
  2876. conventionally used together, in that order, often followed by
  2877. indexing commands. (As shown in the example above, you may follow the
  2878. @code{@@node} line with a comment line, e.g., to show which pointer is
  2879. which if explicit pointers are used.) The Texinfo processors use this
  2880. construct to determine the relationships between nodes and sectioning
  2881. commands.
  2882. Here is the beginning of the chapter in this manual called ``Ending a
  2883. Texinfo File''. This shows an @code{@@node} line followed by an
  2884. @code{@@chapter} line, and then by indexing lines.
  2885. @example
  2886. @group
  2887. @@node Ending a File
  2888. @@chapter Ending a Texinfo File
  2889. @@cindex Ending a Texinfo file
  2890. @@cindex Texinfo file ending
  2891. @@cindex File ending
  2892. @end group
  2893. @end example
  2894. An earlier version of the manual used explicit node pointers. Here is
  2895. the beginning of the same chapter for that case. This shows an
  2896. @code{@@node} line followed by a comment line, a @code{@@chapter}
  2897. line, and then by indexing lines.
  2898. @example
  2899. @group
  2900. @@node Ending a File, Structuring, Beginning a File, Top
  2901. @@comment node-name, next, previous, up
  2902. @@chapter Ending a Texinfo File
  2903. @@cindex Ending a Texinfo file
  2904. @dots{}
  2905. @end group
  2906. @end example
  2907. @node @command{makeinfo} Pointer Creation
  2908. @section @code{makeinfo} Pointer Creation
  2909. @cindex Creating pointers with @code{makeinfo}
  2910. @cindex Pointer creation with @code{makeinfo}
  2911. @cindex Automatic pointer creation with @code{makeinfo}
  2912. @cindex Implicit pointer creation with @code{makeinfo}
  2913. The @code{makeinfo} program can automatically determine node pointers
  2914. for a hierarchically organized document. This implicit node pointer
  2915. creation feature in @code{makeinfo} relieves you from the need to
  2916. update menus and pointers manually or with Texinfo mode commands.
  2917. (@xref{Updating Nodes and Menus}.) We highly recommend taking
  2918. advantage of this.
  2919. To do so, write your @code{@@node} lines with just the name of the
  2920. node:
  2921. @example
  2922. @@node My Node
  2923. @end example
  2924. @noindent
  2925. You do not need to write out the `Next', `Previous', and `Up'
  2926. pointers.
  2927. Then, you must write a sectioning command, such as @code{@@chapter}
  2928. or @code{@@section}, on the line immediately following each truncated
  2929. @code{@@node} line (except that comment lines may intervene). This is
  2930. where it normally goes.
  2931. Also, you must write the name of each node (except for the `Top' node)
  2932. in a menu that is one or more hierarchical levels above the node's
  2933. level.
  2934. Finally, you must follow the `Top' @code{@@node} line with a line
  2935. beginning with @code{@@top} to mark the top-level node in the file.
  2936. @xref{@code{@@top} Command}.
  2937. @cindex Detail menu
  2938. @findex detailmenu
  2939. If you use a detailed menu in your master menu (@pxref{Master Menu
  2940. Parts}), mark it with the @code{@@detailmenu @dots{} @@end
  2941. detailmenu} environment, or @command{makeinfo} will get confused,
  2942. typically about the last and/or first node in the document.
  2943. In most cases, you will want to take advantage of this feature and not
  2944. redundantly specify node pointers that the programs can determine.
  2945. However, Texinfo documents are not required to be organized
  2946. hierarchically or in fact to contain sectioning commands at all (for
  2947. example, if you never intend the document to be printed), so node
  2948. pointers may still be specified explicitly, in full generality.
  2949. @node Menus
  2950. @section Menus
  2951. @cindex Menus
  2952. @findex menu
  2953. @dfn{Menus} contain pointers to subordinate nodes. In online output,
  2954. you use menus to go to such nodes. Menus have no effect in printed
  2955. manuals and do not appear in them.
  2956. @menu
  2957. * Writing a Menu:: What is a menu?
  2958. * Menu Example:: Two and three part menu entries.
  2959. * Menu Location:: Menus go at the ends of nodes.
  2960. * Menu Parts:: A menu entry has three parts.
  2961. * Less Cluttered Menu Entry:: Two part menu entry.
  2962. * Other Info Files:: How to refer to a different Info file.
  2963. @end menu
  2964. @node Writing a Menu
  2965. @subsection Writing a Menu
  2966. @cindex Writing a menu
  2967. @cindex Menu writing
  2968. A menu consists of a @code{@@menu} command on a line by itself,
  2969. followed by menu entry lines or menu comment lines, and then followed
  2970. by an @code{@@end menu} command on a line by itself.
  2971. A menu looks like this:
  2972. @example
  2973. @group
  2974. @@menu
  2975. Larger Units of Text
  2976. * Files:: All about handling files.
  2977. * Multiples: Buffers. Multiple buffers; editing
  2978. several files at once.
  2979. @@end menu
  2980. @end group
  2981. @end example
  2982. @cindex Spaces, in menus
  2983. In a menu, every line that begins with an @w{@samp{* }} is a @dfn{menu
  2984. entry}. (Note the space after the asterisk.)
  2985. A line that does not start with an @w{@samp{* }} may also appear in a
  2986. menu. Such a line is not a menu entry but rather a @dfn{menu comment}
  2987. line that appears in the Info file. In the example above, the line
  2988. @samp{Larger Units of Text} is such a menu comment line; the two lines
  2989. starting with @w{@samp{* }} are menu entries.
  2990. @cindex Hierarchical documents, and menus
  2991. Technically, menus can carry you to any node, regardless of the
  2992. structure of the document; even to nodes in a different Info file.
  2993. However, we do not recommend making use of this, because it is hard
  2994. for readers to follow. Also, the @command{makeinfo} implicit pointer
  2995. creation feature (@pxref{@command{makeinfo} Pointer Creation}) and GNU
  2996. Emacs Texinfo mode updating commands work only to create menus of
  2997. subordinate nodes in a hierarchically structured document. It is much
  2998. better to use cross-references to refer to arbitrary nodes.
  2999. @cindex Menus, automatically generating
  3000. @findex validatemenus
  3001. @command{makeinfo} can automatically generate menus in nodes for Info
  3002. and HTML output, based on the chapter structure of the document. To
  3003. specify that you want it to do this, place the line
  3004. @samp{@@validatemenus off} near the beginning of the document.
  3005. In Info, a user selects a node with the @kbd{m} (@code{Info-menu})
  3006. command. The menu entry name is what the user types after the @kbd{m}
  3007. command.
  3008. @opindex accesskey@r{, in HTML output of menus}
  3009. In the HTML output from @command{makeinfo}, the @code{accesskey}
  3010. attribute is used with the values @samp{1}@dots{}@samp{9} for the
  3011. first nine entries. This allows people using web browsers to follow
  3012. the first menu entries using (typically) @kbd{M-@var{digit}}, e.g.,
  3013. @kbd{M-1} for the first entry.
  3014. @node Menu Example
  3015. @subsection A Menu Example
  3016. @cindex Menu example
  3017. @cindex Example menu
  3018. @c merge with Writing a Menu node?
  3019. A menu looks like this in Texinfo:
  3020. @example
  3021. @group
  3022. @@menu
  3023. * menu entry name: Node name. A short description.
  3024. * Node name:: This form is preferred.
  3025. @@end menu
  3026. @end group
  3027. @end example
  3028. @need 800
  3029. @noindent
  3030. This produces:
  3031. @example
  3032. @group
  3033. * menu:
  3034. * menu entry name: Node name. A short description.
  3035. * Node name:: This form is preferred.
  3036. @end group
  3037. @end example
  3038. @need 700
  3039. Here is an example as you might see it in a Texinfo file:
  3040. @example
  3041. @group
  3042. @@menu
  3043. Larger Units of Text
  3044. * Files:: All about handling files.
  3045. * Multiples: Buffers. Multiple buffers; editing
  3046. several files at once.
  3047. @@end menu
  3048. @end group
  3049. @end example
  3050. @need 800
  3051. @noindent
  3052. This produces:
  3053. @example
  3054. @group
  3055. * menu:
  3056. Larger Units of Text
  3057. * Files:: All about handling files.
  3058. * Multiples: Buffers. Multiple buffers; editing
  3059. several files at once.
  3060. @end group
  3061. @end example
  3062. In this example, the menu has two entries. @samp{Files} is both a menu
  3063. entry name and the name of the node referred to by that name.
  3064. @samp{Multiples} is the menu entry name; it refers to the node named
  3065. @samp{Buffers}. The line @samp{Larger Units of Text} is a comment; it
  3066. appears in the menu, but is not an entry.
  3067. Since no file name is specified with either @samp{Files} or
  3068. @samp{Buffers}, they must be the names of nodes in the same Info file
  3069. (@pxref{Other Info Files, , Referring to Other Info Files}).
  3070. @node Menu Location
  3071. @subsection Menu Location
  3072. @cindex Menu location
  3073. @cindex Location of menus
  3074. There may be at most one menu in a node. A menu is conventionally
  3075. located at the end of a node, without any regular text or additional
  3076. commands between the @code{@@end menu} and the beginning of the next
  3077. node.
  3078. @cindex Info format, and menus
  3079. This convention is useful, since a reader who uses the menu could
  3080. easily miss any such text. Also, any such post-menu text will be
  3081. considered part of the menu in Info output (which has no marker for
  3082. the end of a menu). Thus, a line beginning with @samp{* } will likely
  3083. be incorrectly handled.
  3084. It's usually best if a node with a menu does not contain much text.
  3085. If you find yourself with a lot of text before a menu, we generally
  3086. recommend moving all but a couple of paragraphs into a new subnode.
  3087. Otherwise, it is easy for readers to miss the menu.
  3088. @ignore
  3089. Years ago, we recommended using a @samp{@@heading} command within an
  3090. @code{@@ifinfo} conditional instead of the normal sectioning commands
  3091. after a very short node with a menu. This had the advantage of making
  3092. the printed output look better, because there was no very short text
  3093. between two headings on the page. But it does not work with
  3094. @command{makeinfo}'s implicit pointer creation, and it also makes the
  3095. XML output incorrect, since it does not reflect the true document
  3096. structure. So, we no longer recommend this.
  3097. @end ignore
  3098. @node Menu Parts
  3099. @subsection The Parts of a Menu
  3100. @cindex Parts of a menu
  3101. @cindex Menu parts
  3102. @cindex @code{@@menu} parts
  3103. A menu entry has three parts, only the second of which is required:
  3104. @enumerate
  3105. @item
  3106. The menu entry name (optional).
  3107. @item
  3108. The name of the node (required).
  3109. @item
  3110. A description of the item (optional).
  3111. @end enumerate
  3112. The template for a generic menu entry looks like this (but see the
  3113. next section for one more possibility):
  3114. @example
  3115. * @var{menu-entry-name}: @var{node-name}. @var{description}
  3116. @end example
  3117. Follow the menu entry name with a single colon, and follow the node
  3118. name with tab, comma, newline, or the two characters period and space
  3119. (@samp{. }).
  3120. The third part of a menu entry is a descriptive phrase or sentence.
  3121. Menu entry names and node names are often short; the description
  3122. explains to the reader what the node is about. A useful description
  3123. complements the node name rather than repeats it. The description,
  3124. which is optional, can spread over multiple lines; if it does, some
  3125. authors prefer to indent the second line while others prefer to align
  3126. it with the first (and all others). It's up to you. An empty line,
  3127. or the next menu entry, ends a description.
  3128. Space characters in a menu are preserved as-is in the Info output; this
  3129. allows you to format the menu as you wish. Unfortunately you must type
  3130. node names without any extra spaces or some versions of some Info
  3131. readers will not find the node (@pxref{Node Line Requirements}).
  3132. @command{makeinfo} warns when the text of a menu item (and node names
  3133. and cross-references) contains a problematic construct that will
  3134. interfere with its parsing in Info. If you don't want to see the
  3135. warnings, you can set the customization variable
  3136. @code{INFO_SPECIAL_CHARS_WARNING} to @samp{0} (@pxref{Other
  3137. Customization Variables}).
  3138. @node Less Cluttered Menu Entry
  3139. @subsection Less Cluttered Menu Entry
  3140. @cindex Two part menu entry
  3141. @cindex Double-colon menu entries
  3142. @cindex Menu entries with two colons
  3143. @cindex Less cluttered menu entry
  3144. @cindex Uncluttered menu entry
  3145. When the menu entry name and node name are the same, you can write
  3146. the name immediately after the asterisk and space at the beginning of
  3147. the line and follow the name with two colons.
  3148. @need 800
  3149. For example, write
  3150. @example
  3151. * Name:: @var{description}
  3152. @end example
  3153. @need 800
  3154. @noindent
  3155. instead of
  3156. @example
  3157. * Name: Name. @var{description}
  3158. @end example
  3159. We recommend using the node name for the menu entry name whenever
  3160. possible, since it reduces visual clutter in the menu.
  3161. @node Other Info Files
  3162. @subsection Referring to Other Info Files
  3163. @cindex Referring to other Info files
  3164. @cindex Nodes in other Info files
  3165. @cindex Other Info files' nodes
  3166. @cindex Going to other Info files' nodes
  3167. @cindex Info; other files' nodes
  3168. You can create a menu entry that enables a reader in Info to go to a
  3169. node in another Info file by writing the file name in parentheses just
  3170. before the node name. Some examples:
  3171. @example
  3172. @group
  3173. @@menu
  3174. * @var{first-entry-name}:(@var{filename})@var{nodename}. @var{description}
  3175. * (@var{filename})@var{second-node}:: @var{description}
  3176. @@end menu
  3177. @end group
  3178. @end example
  3179. For example, to refer directly to the @samp{Outlining} and
  3180. @samp{Rebinding} nodes in the @cite{Emacs Manual}, you could write a
  3181. menu like this:
  3182. @example
  3183. @group
  3184. @@menu
  3185. * Outlining: (emacs)Outline Mode. The major mode for
  3186. editing outlines.
  3187. * (emacs)Rebinding:: How to redefine the
  3188. meaning of a key.
  3189. @@end menu
  3190. @end group
  3191. @end example
  3192. If you do not list the node name, but only name the file, then Info
  3193. presumes that you are referring to the `Top' node. Examples:
  3194. @example
  3195. @group
  3196. * Info: (info). Documentation browsing system.
  3197. * (emacs):: The extensible, self-documenting
  3198. text editor.
  3199. @end group
  3200. @end example
  3201. The GNU Emacs Texinfo mode menu updating commands only work with nodes
  3202. within the current buffer, so you cannot use them to create menus that
  3203. refer to other files. You must write such menus by hand.
  3204. @node Chapter Structuring
  3205. @chapter Chapter Structuring
  3206. @anchor{Structuring}@c old name
  3207. @cindex Chapter structuring
  3208. @cindex Structuring of chapters
  3209. @cindex Sectioning
  3210. Texinfo's @dfn{chapter structuring} commands divide a document into a
  3211. hierarchy of chapters, sections, subsections, and subsubsections. These
  3212. commands generate large headings in the text, like the one above. They
  3213. also provide information for generating the table of contents
  3214. (@pxref{Contents,, Generating a Table of Contents}).
  3215. Normally you put a @code{@@node} command immediately before each
  3216. chapter structuring command. @xref{Nodes}.
  3217. @menu
  3218. * Tree Structuring:: A manual is like an upside down tree @dots{}
  3219. * Structuring Command Types:: How to divide a manual into parts.
  3220. * @code{@@chapter}:: Chapter structuring.
  3221. * @code{@@unnumbered @@appendix}::
  3222. * @code{@@majorheading @@chapheading}::
  3223. * @code{@@section}::
  3224. * @code{@@unnumberedsec @@appendixsec @@heading}::
  3225. * @code{@@subsection}::
  3226. * @code{@@unnumberedsubsec @@appendixsubsec @@subheading}::
  3227. * @code{@@subsubsection}:: Commands for the lowest level sections.
  3228. * @code{@@part}:: Collections of chapters.
  3229. * Raise/lower sections:: How to change commands' hierarchical level.
  3230. @end menu
  3231. @node Tree Structuring
  3232. @section Tree Structure of Sections
  3233. @cindex Tree structuring
  3234. A Texinfo file is usually structured like a book with chapters,
  3235. sections, subsections, and the like. This structure can be visualized
  3236. as a tree (or rather as an upside-down tree) with the root at the top
  3237. and the levels corresponding to chapters, sections, subsection, and
  3238. subsubsections.
  3239. Here is a diagram that shows a Texinfo file with three chapters, each
  3240. with two sections.
  3241. @example
  3242. @group
  3243. Top
  3244. |
  3245. -------------------------------------
  3246. | | |
  3247. Chapter 1 Chapter 2 Chapter 3
  3248. | | |
  3249. -------- -------- --------
  3250. | | | | | |
  3251. Section Section Section Section Section Section
  3252. 1.1 1.2 2.1 2.2 3.1 3.2
  3253. @end group
  3254. @end example
  3255. In a Texinfo file that has this structure, the beginning of Chapter 2
  3256. would be written like this:
  3257. @example
  3258. @group
  3259. @@node Chapter 2
  3260. @@chapter Chapter 2
  3261. @end group
  3262. @end example
  3263. @noindent
  3264. For purposes of example, here is how it would be written with
  3265. explicit node pointers:
  3266. @example
  3267. @group
  3268. @@node Chapter 2, Chapter 3, Chapter 1, Top
  3269. @@chapter Chapter 2
  3270. @end group
  3271. @end example
  3272. The chapter structuring commands are described in the sections that
  3273. follow; the @code{@@node} command is described in
  3274. the previous chapter (@pxref{Nodes}).
  3275. @node Structuring Command Types
  3276. @section Structuring Command Types
  3277. The chapter structuring commands fall into four groups or series, each
  3278. of which contains structuring commands corresponding to the
  3279. hierarchical levels of chapters, sections, subsections, and
  3280. subsubsections.
  3281. The four groups of commands are the @code{@@chapter} series, the
  3282. @code{@@unnumbered} series, the @code{@@appendix} series, and the
  3283. @code{@@heading} series. Each command produces a title with a
  3284. different appearance in the body of the document. Some of the
  3285. commands list their titles in the tables of contents, while others do
  3286. not. Here are the details:
  3287. @itemize @bullet
  3288. @item
  3289. The @code{@@chapter} and @code{@@appendix} series of commands produce
  3290. numbered or lettered entries both in the body of a document and in its
  3291. table of contents.
  3292. @item
  3293. The @code{@@unnumbered} series of commands produce unnumbered entries
  3294. both in the body of a document and in its table of contents. The
  3295. @code{@@top} command, which has a special use, is a member of this
  3296. series (@pxref{@code{@@top} Command}). An @code{@@unnumbered} section
  3297. is a normal part of the document structure.
  3298. @item
  3299. The @code{@@heading} series of commands produce simple unnumbered
  3300. headings that do not appear in a table of contents, are not associated
  3301. with nodes, and cannot be cross-referenced. These heading commands
  3302. never start a new page.
  3303. @end itemize
  3304. When a @code{@@setchapternewpage} command says to do so, the
  3305. @code{@@chapter}, @code{@@unnumbered}, and @code{@@appendix} commands
  3306. start new pages in the printed manual; the @code{@@heading} commands
  3307. do not. @xref{@code{@@setchapternewpage}}.
  3308. Here is a summary:
  3309. @tex
  3310. {\globaldefs=1 \smallfonts \rm}
  3311. @end tex
  3312. @multitable @columnfractions .19 .30 .29 .22
  3313. @item @tab @tab @tab No new page
  3314. @item @i{Numbered} @tab @i{Unnumbered} @tab @i{Lettered/numbered} @tab @i{Unnumbered}
  3315. @item In contents @tab In contents @tab In contents @tab Not in contents
  3316. @item @tab @code{@@top} @tab @tab @code{@@majorheading}
  3317. @item @code{@@chapter} @tab @code{@@unnumbered} @tab @code{@@appendix} @tab @code{@@chapheading}
  3318. @item @code{@@section} @tab @code{@@unnumberedsec} @tab @code{@@appendixsec} @tab @code{@@heading}
  3319. @item @code{@@subsection} @tab @code{@@unnumberedsubsec} @tab @code{@@appendixsubsec} @tab @code{@@subheading}
  3320. @item @code{@@subsubsection} @tab @code{@@unnumberedsubsubsec} @tab @code{@@appendixsubsubsec} @tab @code{@@subsubheading}
  3321. @end multitable
  3322. @tex
  3323. {\globaldefs=1 \textfonts \rm}
  3324. @end tex
  3325. @node @code{@@chapter}
  3326. @section @code{@@chapter}: Chapter Structuring
  3327. @anchor{chapter}@c old name
  3328. @findex chapter
  3329. @code{@@chapter} identifies a chapter in the document--the highest
  3330. level of the normal document structuring hierarchy. Write the command
  3331. at the beginning of a line and follow it on the same line by the title
  3332. of the chapter. The chapter is numbered automatically, starting
  3333. from@tie{}1.
  3334. For example, the present chapter in this manual is entitled
  3335. ``@code{@@chapter}: Chapter Structuring''; the @code{@@chapter} line
  3336. looks like this:
  3337. @example
  3338. @@chapter @@code@{@@@@chapter@}: Chapter Structuring
  3339. @end example
  3340. In @TeX{}, the @code{@@chapter} command produces a chapter heading in
  3341. the document.
  3342. In Info and plain text output, the @code{@@chapter} command causes the
  3343. title to appear on a line by itself, with a line of asterisks inserted
  3344. underneath. So, the above example produces the following output:
  3345. @example
  3346. @group
  3347. 5 Chapter Structuring
  3348. *********************
  3349. @end group
  3350. @end example
  3351. In HTML, the @code{@@chapter} command produces an @code{<h2>}-level
  3352. header by default (controlled by the @code{CHAPTER_HEADER_LEVEL}
  3353. customization variable, @pxref{Other Customization Variables}).
  3354. In the XML and Docbook output, a @code{<chapter>} element is produced
  3355. that includes all the following sections, up to the next chapter.
  3356. @node @code{@@unnumbered @@appendix}
  3357. @section @code{@@unnumbered}, @code{@@appendix}: Chapters with Other Labeling
  3358. @anchor{unnumbered & appendix}@c old name
  3359. @findex unnumbered
  3360. @findex appendix
  3361. Use the @code{@@unnumbered} command to start a chapter-level element
  3362. that appears without chapter numbers of any kind. Use the
  3363. @code{@@appendix} command to start an appendix that is labeled by
  3364. letter (`A', `B', @dots{}) instead of by number; appendices are also
  3365. at the chapter level of structuring.
  3366. Write an @code{@@appendix} or @code{@@unnumbered} command at the
  3367. beginning of a line and follow it on the same line by the title,
  3368. just as with @code{@@chapter}.
  3369. @findex centerchap
  3370. Texinfo also provides a command @code{@@centerchap}, which is analogous
  3371. to @code{@@unnumbered}, but centers its argument in the printed and HTML
  3372. outputs. This kind of stylistic choice is not usually offered by
  3373. Texinfo. It may be suitable for short documents.
  3374. @c but the Hacker's Dictionary wanted it, before they quit Texinfo.
  3375. @cindex Docbook and prefatory sections
  3376. @cindex Preface, etc., and Docbook
  3377. With @code{@@unnumbered}, if the name of the associated node is one of
  3378. these English words (case-insensitive):
  3379. @example
  3380. Acknowledgements Colophon Dedication Preface
  3381. @end example
  3382. @cindex @code{<acknowledgements>} Docbook tag
  3383. @cindex @code{<colophon>} Docbook tag
  3384. @cindex @code{<dedication>} Docbook tag
  3385. @cindex @code{<preface>} Docbook tag
  3386. @cindex @code{<chapter>} Docbook tag
  3387. @cindex @code{<title>} Docbook tag
  3388. @noindent then the Docbook output uses corresponding special tags
  3389. (@code{<preface>}, etc.)@: instead of the default @code{<chapter>}.
  3390. The argument to @code{@@unnumbered} itself can be anything, and is
  3391. output as the following @code{<title>} text as usual.
  3392. @node @code{@@majorheading @@chapheading}
  3393. @section @code{@@majorheading}, @code{@@chapheading}: Chapter-level Headings
  3394. @anchor{majorheading & chapheading}@c old name
  3395. @findex majorheading
  3396. @findex chapheading
  3397. The @code{@@majorheading} and @code{@@chapheading} commands produce
  3398. chapter-like headings in the body of a document.
  3399. However, neither command produces an entry in the table of contents,
  3400. and neither command causes @TeX{} to start a new page in a printed
  3401. manual.
  3402. In @TeX{}, a @code{@@majorheading} command generates a larger vertical
  3403. whitespace before the heading than a @code{@@chapheading} command but
  3404. is otherwise the same.
  3405. In Info and plain text, the @code{@@majorheading} and
  3406. @code{@@chapheading} commands produce the same output as
  3407. @code{@@chapter}: the title is printed on a line by itself with a line
  3408. of asterisks underneath. Similarly for HTML@. The only difference is
  3409. the lack of numbering and the lack of any association with nodes.
  3410. @xref{@code{@@chapter}}.
  3411. @node @code{@@section}
  3412. @section @code{@@section}: Sections Below Chapters
  3413. @anchor{section}@c old name
  3414. @findex section
  3415. An @code{@@section} command identifies a section within a chapter
  3416. unit, whether created with @code{@@chapter}, @code{@@unnumbered}, or
  3417. @code{@@appendix}, following the numbering scheme of the chapter-level
  3418. command. Thus, within a @code{@@chapter} chapter numbered `1', the
  3419. sections are numbered `1.1', `1.2', etc.; within an @code{@@appendix}
  3420. ``chapter'' labeled `A', the sections are numbered `A.1', `A.2', etc.;
  3421. within an @code{@@unnumbered} chapter, the section gets no number.
  3422. The output is underlined with @samp{=} in Info and plain text.
  3423. To make a section, write the @code{@@section} command at the
  3424. beginning of a line and follow it on the same line by the section
  3425. title. For example,
  3426. @example
  3427. @@section This is a section
  3428. @end example
  3429. @noindent
  3430. might produce the following in Info:
  3431. @example
  3432. @group
  3433. 5.7 This is a section
  3434. =====================
  3435. @end group
  3436. @end example
  3437. Section titles are listed in the table of contents.
  3438. The @TeX{}, HTML, Docbook, and XML output is all analogous to the
  3439. chapter-level output, just ``one level down''; @pxref{@code{@@chapter}}.
  3440. @node @code{@@unnumberedsec @@appendixsec @@heading}
  3441. @section @code{@@unnumberedsec}, @code{@@appendixsec}, @code{@@heading}
  3442. @anchor{unnumberedsec appendixsec heading}@c old name
  3443. @findex unnumberedsec
  3444. @findex appendixsec
  3445. @findex heading
  3446. The @code{@@unnumberedsec}, @code{@@appendixsec}, and @code{@@heading}
  3447. commands are, respectively, the unnumbered, appendix-like, and
  3448. heading-like equivalents of the @code{@@section} command (see the
  3449. previous section).
  3450. @code{@@unnumberedsec} and @code{@@appendixsec} do not need to be used
  3451. in ordinary circumstances, because @code{@@section} may also be used
  3452. within @code{@@unnumbered} and @code{@@appendix} chapters; again, see
  3453. the previous section.
  3454. @table @code
  3455. @item @@unnumberedsec
  3456. The @code{@@unnumberedsec} command may be used within an unnumbered
  3457. chapter or within a regular chapter or appendix to produce an
  3458. unnumbered section.
  3459. @item @@appendixsec
  3460. @itemx @@appendixsection
  3461. @findex appendixsection
  3462. @findex appendixsec
  3463. @code{@@appendixsection} is a longer spelling of the
  3464. @code{@@appendixsec} command; the two are synonymous.
  3465. Conventionally, the @code{@@appendixsec} or @code{@@appendixsection}
  3466. command is used only within appendices.
  3467. @item @@heading
  3468. You may use the @code{@@heading} command (almost) anywhere for a
  3469. section-style heading that will not appear in the table of contents.
  3470. The @code{@@heading}-series commands can appear inside most
  3471. environments, for example, though pathological and useless locations
  3472. such as inside @code{@@titlepage}, as an argument to another command,
  3473. etc., are not allowed.
  3474. @end table
  3475. @node @code{@@subsection}
  3476. @section @code{@@subsection}: Subsections Below Sections
  3477. @anchor{subsection}@c old name
  3478. @findex subsection
  3479. Subsections are to sections as sections are to chapters;
  3480. @pxref{@code{@@section}}. In Info and plain text, subsection titles
  3481. are underlined with @samp{-}. For example,
  3482. @example
  3483. @@subsection This is a subsection
  3484. @end example
  3485. @noindent
  3486. might produce
  3487. @example
  3488. @group
  3489. 1.2.3 This is a subsection
  3490. --------------------------
  3491. @end group
  3492. @end example
  3493. Subsection titles are listed in the table of contents.
  3494. The @TeX{}, HTML, Docbook, and XML output is all analogous to the
  3495. chapter-level output, just ``two levels down'';
  3496. @pxref{@code{@@chapter}}.
  3497. @node @code{@@unnumberedsubsec @@appendixsubsec @@subheading}
  3498. @section The @code{@@subsection}-like Commands
  3499. @anchor{unnumberedsubsec appendixsubsec subheading}@c old name
  3500. @findex unnumberedsubsec
  3501. @findex appendixsubsec
  3502. @findex subheading
  3503. @cindex Subsection-like commands
  3504. The @code{@@unnumberedsubsec}, @code{@@appendixsubsec}, and
  3505. @code{@@subheading} commands are, respectively, the unnumbered,
  3506. appendix-like, and heading-like equivalents of the @code{@@subsection}
  3507. command. (@xref{@code{@@subsection}}.)
  3508. @code{@@unnumberedsubsec} and @code{@@appendixsubsec} do not need to
  3509. be used in ordinary circumstances, because @code{@@subsection} may
  3510. also be used within sections of @code{@@unnumbered} and
  3511. @code{@@appendix} chapters (@pxref{@code{@@section}}).
  3512. An @code{@@subheading} command produces a heading like that of a
  3513. subsection except that it is not numbered and does not appear in the
  3514. table of contents. Similarly, an @code{@@unnumberedsubsec} command
  3515. produces an unnumbered heading like that of a subsection and an
  3516. @code{@@appendixsubsec} command produces a subsection-like heading
  3517. labeled with a letter and numbers; both of these commands produce
  3518. headings that appear in the table of contents. In Info and plain
  3519. text, the @code{@@subsection}-like commands generate a title
  3520. underlined with hyphens.
  3521. @node @code{@@subsubsection}
  3522. @section @code{@@subsection} and Other Subsub Commands
  3523. @anchor{subsubsection}@c old name
  3524. @findex subsubsection
  3525. @findex unnumberedsubsubsec
  3526. @findex appendixsubsubsec
  3527. @findex subsubheading
  3528. @cindex Subsub sectioning commands
  3529. The fourth and lowest level sectioning commands in Texinfo are the
  3530. `subsub' commands. They are:
  3531. @table @code
  3532. @item @@subsubsection
  3533. Subsubsections are to subsections as subsections are to sections.
  3534. (@xref{@code{@@subsection}}.) Subsubsection titles appear in the
  3535. table of contents.
  3536. @item @@unnumberedsubsubsec
  3537. Unnumbered subsubsection titles appear in the table of contents,
  3538. but lack numbers. Otherwise, unnumbered subsubsections are the same
  3539. as subsubsections.
  3540. @item @@appendixsubsubsec
  3541. Conventionally, appendix commands are used only for appendices and are
  3542. lettered and numbered appropriately. They also appear in the table
  3543. of contents.
  3544. @item @@subsubheading
  3545. The @code{@@subsubheading} command may be used anywhere that you want
  3546. a small heading that will not appear in the table of contents.
  3547. @end table
  3548. As with subsections, @code{@@unnumberedsubsubsec} and
  3549. @code{@@appendixsubsubsec} do not need to be used in ordinary
  3550. circumstances, because @code{@@subsubsection} may also be used within
  3551. subsections of @code{@@unnumbered} and @code{@@appendix} chapters
  3552. (@pxref{@code{@@section}}).
  3553. In Info, `subsub' titles are underlined with periods. For example,
  3554. @example
  3555. @@subsubsection This is a subsubsection
  3556. @end example
  3557. @noindent
  3558. might produce
  3559. @example
  3560. @group
  3561. 1.2.3.4 This is a subsubsection
  3562. ...............................
  3563. @end group
  3564. @end example
  3565. The @TeX{}, HTML, Docbook, and XML output is all analogous to the
  3566. chapter-level output, just ``three levels down''; @pxref{@code{@@chapter}}.
  3567. @node @code{@@part}
  3568. @section @code{@@part}: Groups of Chapters
  3569. @findex part
  3570. @cindex Part pages
  3571. The final sectioning command is @code{@@part}, to mark a @dfn{part} of
  3572. a manual, that is, a group of chapters or (rarely) appendices. This
  3573. behaves quite differently from the other sectioning commands, to fit
  3574. with the way such ``parts'' are conventionally used in books.
  3575. No @code{@@node} command is associated with @code{@@part}. Just write
  3576. the command on a line by itself, including the part title, at the
  3577. place in the document you want to mark off as starting that part. For
  3578. example:
  3579. @example
  3580. @@part Part I:@@* The beginning
  3581. @end example
  3582. As can be inferred from this example, no automatic numbering or
  3583. labeling of the @code{@@part} text is done. The text is taken as-is.
  3584. Because parts are not associated with nodes, no general text can
  3585. follow the @code{@@part} line. To produce the intended output, it
  3586. must be followed by a chapter-level command (including its node).
  3587. Thus, to continue the example:
  3588. @example
  3589. @@part Part I:@@* The beginning
  3590. @@node Introduction
  3591. @@chapter Introduction
  3592. ...
  3593. @end example
  3594. In the @TeX{} output, the @code{@@part} text is included in both the
  3595. normal and short tables of contents (@pxref{Contents}), without a page
  3596. number (since that is the normal convention). In addition, a ``part
  3597. page'' is output in the body of the document, with just the
  3598. @code{@@part} text. In the example above, the @code{@@*} causes a
  3599. line break on the part page (but is replaced with a space in the
  3600. tables of contents). This part page is always forced to be on an odd
  3601. (right-hand) page, regardless of the chapter pagination
  3602. (@pxref{@code{@@setchapternewpage}}).
  3603. In the HTML output, the @code{@@part} text is similarly included in
  3604. the tables of contents, and a heading is included in the main document
  3605. text, as part of the following chapter or appendix node.
  3606. In the XML and Docbook output, the @code{<part>} element includes all
  3607. the following chapters, up to the next @code{<part>}. A @code{<part>}
  3608. containing chapters is also closed at an appendix.
  3609. In the Info and plain text output, @code{@@part} has no effect.
  3610. @code{@@part} is ignored when raising or lowering sections (see next
  3611. section). That is, it is never lowered and nothing can be raised to it.
  3612. @node Raise/lower sections
  3613. @section Raise/lower Sections: @code{@@raisesections} and @code{@@lowersections}
  3614. @findex raisesections
  3615. @findex lowersections
  3616. @cindex Raising and lowering sections
  3617. @cindex Lowering and raising sections
  3618. @cindex Sections, raising and lowering
  3619. The @code{@@raisesections} and @code{@@lowersections} commands
  3620. implicitly raise and lower the hierarchical level of following
  3621. chapters, sections and the other sectioning commands (excluding parts).
  3622. That is, the @code{@@raisesections} command changes sections to
  3623. chapters, subsections to sections, and so on. Conversely, the
  3624. @code{@@lowersections} command changes chapters to sections, sections
  3625. to subsections, and so on. Thus, a @code{@@lowersections} command
  3626. cancels a @code{@@raisesections} command, and vice versa.
  3627. @cindex Include files, and section levels
  3628. You can use @code{@@lowersections} to include text written as an outer
  3629. or standalone Texinfo file in another Texinfo file as an inner,
  3630. included file (@pxref{Include Files}). Typical usage looks like this:
  3631. @example
  3632. @@lowersections
  3633. @@include somefile.texi
  3634. @@raisesections
  3635. @end example
  3636. @noindent (Without the @code{@@raisesections}, all the subsequent
  3637. sections in the main file would also be lowered.)
  3638. If the included file being lowered has a @code{@@top} node, you'll
  3639. need to conditionalize its inclusion with a flag (@pxref{@code{@@set
  3640. @@value}}).
  3641. As a practical matter, you generally only want to raise or lower large
  3642. chunks, usually in external files as shown above. The final result has
  3643. to have menus that take the raising and lowering into account, so you
  3644. cannot just arbitrarily sprinkle @code{@@raisesections} and
  3645. @code{@@lowersections} commands throughout the document.
  3646. Repeated use of the commands continues to raise or lower the
  3647. hierarchical level a step at a time. An attempt to raise above
  3648. `chapter' reproduces chapter commands; an attempt to lower below
  3649. `subsubsection' reproduces subsubsection commands. Also, lowered
  3650. subsubsections and raised chapters will not work with
  3651. @command{makeinfo}'s feature of implicitly determining node pointers,
  3652. since the menu structure cannot be represented correctly.
  3653. Write each @code{@@raisesections} and @code{@@lowersections} command
  3654. on a line of its own.
  3655. @node Cross References
  3656. @chapter Cross-references
  3657. @cindex Making cross-references
  3658. @cindex Cross-references
  3659. @cindex References
  3660. @dfn{Cross-references} are used to refer the reader to other parts of the
  3661. same or different Texinfo files.
  3662. @menu
  3663. * References:: What cross-references are for.
  3664. * Cross Reference Commands:: A summary of the different commands.
  3665. * Cross Reference Parts:: A cross-reference has several parts.
  3666. * @code{@@xref}:: Begin a reference with `See' @dots{}
  3667. * Referring to a Manual as a Whole:: Refer to an entire manual.
  3668. * @code{@@ref}:: A reference for the last part of a sentence.
  3669. * @code{@@pxref}:: How to write a parenthetical cross-reference.
  3670. * @code{@@anchor}:: Defining arbitrary cross-reference targets
  3671. * @code{@@inforef}:: How to refer to an Info-only file.
  3672. * @code{@@url}:: How to refer to a uniform resource locator.
  3673. * @code{@@cite}:: How to refer to books not in the Info system.
  3674. @end menu
  3675. @node References
  3676. @section What References Are For
  3677. Often, but not always, a printed document should be designed so that
  3678. it can be read sequentially. People tire of flipping back and forth
  3679. to find information that should be presented to them as they need
  3680. it.
  3681. However, in any document, some information will be too detailed for
  3682. the current context, or incidental to it; use cross-references to
  3683. provide access to such information. Also, an online help system or a
  3684. reference manual is not like a novel; few read such documents in
  3685. sequence from beginning to end. Instead, people look up what they
  3686. need. For this reason, such creations should contain many cross
  3687. references to help readers find other information that they may not
  3688. have read.
  3689. In a printed manual, a cross-reference results in a page reference,
  3690. unless it is to another manual altogether, in which case the
  3691. cross-reference names that manual. In Info, a cross-reference results
  3692. in an entry that you can follow using the Info @samp{f} command.
  3693. (@xref{Help-Xref,, Following cross-references, info, Info}.) In HTML, a
  3694. cross-reference results in an hyperlink.
  3695. The various cross-reference commands use nodes (or anchors,
  3696. @pxref{@code{@@anchor}}) to define cross-reference locations.
  3697. @TeX{} needs nodes to define cross-reference locations. When @TeX{}
  3698. generates a DVI file, it records each node's page number and uses the
  3699. page numbers in making references. Thus, even if you are writing a
  3700. manual that will only be printed, and not used online, you must
  3701. nonetheless write @code{@@node} lines in order to name the places to
  3702. which you make cross-references.
  3703. @need 800
  3704. @node Cross Reference Commands
  3705. @section Different Cross-reference Commands
  3706. @cindex Different cross-reference commands
  3707. There are three different cross-reference commands:
  3708. @table @code
  3709. @item @@xref
  3710. Used to start a sentence in the printed manual and in HTML with
  3711. @w{`See @dots{}'} or an Info cross-reference saying @samp{*Note
  3712. @var{name}: @var{node}.}.
  3713. @item @@ref
  3714. Used within or, more often, at the end of a sentence; produces just
  3715. the reference in the printed manual and in HTML without the preceding
  3716. `See' (same as @code{@@xref} for Info).
  3717. @item @@pxref
  3718. Used within parentheses, at the end of a sentence, or otherwise before
  3719. punctuation, to make a reference. Its output starts with a lowercase
  3720. `see' in the printed manual and in HTML, and a lowercase @samp{*note}
  3721. in Info. (@samp{p} is for `parenthesis'.)
  3722. @end table
  3723. Additionally, there are commands to produce references to documents
  3724. outside the Texinfo system. The @code{@@cite} command is used
  3725. to make references to books and manuals. @code{@@url} produces
  3726. a @acronym{URL}, for example a reference to a page on the World
  3727. Wide Web. @code{@@inforef} is used to make a reference to an Info
  3728. file for which there is no printed manual.
  3729. @node Cross Reference Parts
  3730. @section Parts of a Cross-reference
  3731. @cindex Cross-reference parts
  3732. @cindex Parts of a cross-reference
  3733. @anchor{Reference Syntax} @c merged node
  3734. A cross-reference command requires only one argument, which is
  3735. the name of the node to which it refers. Here is a simple example:
  3736. @example
  3737. @@xref@{Node name@}.
  3738. @end example
  3739. @noindent
  3740. In Info output, this produces
  3741. @example
  3742. *Note Node name::.
  3743. @end example
  3744. @noindent
  3745. In a printed manual, the output is
  3746. @quotation
  3747. See Section @var{nnn} [Node name], page @var{ppp}.
  3748. @end quotation
  3749. A cross-reference command may contain up to four additional arguments.
  3750. By using these arguments, you can provide a cross-reference name,
  3751. a topic description or section title for the printed output, the name
  3752. of a different manual file, and the name of a different printed manual.
  3753. To refer to another manual as a whole, the manual file and/or the name
  3754. of the printed manual are the only required arguments (@pxref{Referring
  3755. to a Manual as a Whole}).
  3756. @need 700
  3757. Here is an example of a full five-part cross-reference:
  3758. @example
  3759. @group
  3760. @@xref@{Node name, Online Label, Printed Label,
  3761. info-file-name, A Printed Manual@}, for details.
  3762. @end group
  3763. @end example
  3764. @noindent
  3765. which produces
  3766. @example
  3767. *Note Online Label: (info-file-name)Node name,
  3768. for details.
  3769. @end example
  3770. @noindent
  3771. in Info and
  3772. @quotation
  3773. See section ``Printed Label'' in @i{A Printed Manual}, for details.
  3774. @end quotation
  3775. @noindent
  3776. in a printed book.
  3777. The five possible arguments for a cross-reference are:
  3778. @enumerate
  3779. @item
  3780. The node or anchor name (required, except for reference to whole
  3781. manuals). This is the location to which the cross-reference takes
  3782. you. In a printed document, the location of the node provides the
  3783. page reference only for references within the same document.
  3784. Use @code{@@node} to define the node (@pxref{Writing a Node}), or
  3785. @code{@@anchor} (@pxref{@code{@@anchor}}).
  3786. Write a node name in a cross-reference in exactly the same way as in
  3787. the @code{@@node} line, including the same capitalization; otherwise, the
  3788. formatters may not find the reference.
  3789. @item
  3790. A label for online output. It is usually omitted; then
  3791. the topic description (third argument) is used if it was specified;
  3792. if that was omitted as well, the node name is used.
  3793. @item
  3794. A label for printed output. Often, this is the title or topic of the
  3795. section. This is used as the name of the reference in the printed
  3796. manual. If omitted, the node name is used.
  3797. @item
  3798. The name of the manual file in which the reference is located, if it is
  3799. different from the current file. This name is used both for Info and
  3800. HTML.
  3801. @item
  3802. The name of a printed manual from a different Texinfo file.
  3803. @end enumerate
  3804. The template for a full five argument cross-reference looks like
  3805. this:
  3806. @example
  3807. @group
  3808. @@xref@{@var{node-name}, @var{online-label}, @var{printed-label},
  3809. @var{info-file-name}, @var{printed-manual-title}@}
  3810. @end group
  3811. @end example
  3812. Whitespace before and after the commas separating these arguments is
  3813. ignored. To include a comma in one of the arguments, use
  3814. @code{@@comma@{@}} (@pxref{Inserting a Comma}).
  3815. @cindex Comma after cross-reference
  3816. When processing with TeX, a comma is automatically inserted after the
  3817. page number for cross-references to within the same manual, unless the
  3818. closing brace of the argument is followed by non-whitespace (such as a
  3819. comma or period). This gives you the choice of whether to have a comma
  3820. there in Info or HTML output. For example,
  3821. @example
  3822. @@xref@{Another Section@} for more information
  3823. @end example
  3824. @noindent produces
  3825. @w{`See Another Section, page @var{ppp}, for more information'} in the
  3826. printed output, and
  3827. @w{@samp{*Note Another Section:: for more information}} in the Info
  3828. output.
  3829. If an unwanted comma is added, follow the argument
  3830. with a command such as @samp{@@:}. For example,
  3831. @w{@samp{@@xref@{Hurricanes@}@@: --- for the details}} produces
  3832. @quotation
  3833. See Hurricanes, page @var{ppp} --- for the details
  3834. @end quotation
  3835. @noindent instead of
  3836. @w{`See Hurricanes, page @var{ppp}, --- for the details'}.
  3837. Cross-references with one, two, three, four, and five arguments are
  3838. described separately following the description of @code{@@xref}.
  3839. @command{makeinfo} warns when the text of a cross-reference (and node
  3840. names and menu items) contains a problematic construct that will
  3841. interfere with its parsing in Info. If you don't want to see the
  3842. warnings, you can set the customization variable
  3843. @code{INFO_SPECIAL_CHARS_WARNING} to @samp{0} (@pxref{Other
  3844. Customization Variables}).
  3845. @node @code{@@xref}
  3846. @section @code{@@xref}
  3847. @anchor{xref}@c old name
  3848. @findex xref
  3849. @cindex Cross-references using @code{@@xref}
  3850. @cindex References using @code{@@xref}
  3851. The @code{@@xref} command generates a cross-reference for the
  3852. beginning of a sentence.
  3853. @menu
  3854. * One Argument:: @code{@@xref} with one argument.
  3855. * Two Arguments:: @code{@@xref} with two arguments.
  3856. * Three Arguments:: @code{@@xref} with three arguments.
  3857. * Four and Five Arguments:: @code{@@xref} with four and five arguments.
  3858. @end menu
  3859. @node One Argument
  3860. @subsection @code{@@xref} with One Argument
  3861. @cindex One-argument form of cross-references
  3862. The simplest form of @code{@@xref} takes one argument, the name of
  3863. another node in the same Texinfo file.
  3864. @need 700
  3865. @noindent
  3866. For example,
  3867. @example
  3868. @@xref@{Tropical Storms@}.
  3869. @end example
  3870. @noindent
  3871. produces
  3872. @example
  3873. *Note Tropical Storms::.
  3874. @end example
  3875. @noindent
  3876. in Info and
  3877. @quotation
  3878. See Section 3.1 [Tropical Storms], page 24.
  3879. @end quotation
  3880. @noindent
  3881. in a printed manual.
  3882. @node Two Arguments
  3883. @subsection @code{@@xref} with Two Arguments
  3884. @cindex Two-argument form of cross-references
  3885. With two arguments, the second is used as a label for the online output.
  3886. @need 750
  3887. @noindent
  3888. The template is like this:
  3889. @example
  3890. @@xref@{@var{node-name}, @var{online-label}@}.
  3891. @end example
  3892. @need 700
  3893. @noindent
  3894. For example,
  3895. @example
  3896. @@xref@{Electrical Effects, Lightning@}.
  3897. @end example
  3898. @noindent
  3899. produces:
  3900. @example
  3901. *Note Lightning: Electrical Effects.
  3902. @end example
  3903. @noindent
  3904. in Info and
  3905. @quotation
  3906. See Section 5.2 [Electrical Effects], page 57.
  3907. @end quotation
  3908. @noindent
  3909. in a printed manual, where the node name is printed.
  3910. The second argument to cross-references must observe some of the
  3911. restrictions for node names (@pxref{Node Line Requirements}). The
  3912. most common issue is that colons cannot be used, since that interferes
  3913. with the parsing of the Info file.
  3914. @node Three Arguments
  3915. @subsection @code{@@xref} with Three Arguments
  3916. @cindex Three-argument form of cross-references
  3917. A third argument replaces the node name in the @TeX{} output. The third
  3918. argument should be the name of the section in the printed output, or
  3919. else state the topic discussed by that section.
  3920. @need 750
  3921. @noindent
  3922. The template is like this:
  3923. @example
  3924. @group
  3925. @@xref@{@var{node-name}, @var{online-label}, @var{printed-label}@}.
  3926. @end group
  3927. @end example
  3928. @need 700
  3929. @noindent
  3930. For example,
  3931. @example
  3932. @group
  3933. @@xref@{Electrical Effects, Lightning, Thunder and Lightning@},
  3934. for details.
  3935. @end group
  3936. @end example
  3937. @noindent
  3938. produces
  3939. @example
  3940. *Note Lightning: Electrical Effects, for details.
  3941. @end example
  3942. @noindent
  3943. in Info and
  3944. @quotation
  3945. See Section 5.2 [Thunder and Lightning], page 57, for details.
  3946. @end quotation
  3947. @noindent
  3948. in a printed manual.
  3949. If a third argument is given and the second one is empty, then the
  3950. third argument serves for both. (Note how two commas, side by side, mark
  3951. the empty second argument.)
  3952. @example
  3953. @group
  3954. @@xref@{Electrical Effects, , Thunder and Lightning@},
  3955. for details.
  3956. @end group
  3957. @end example
  3958. @noindent
  3959. produces
  3960. @example
  3961. *Note Thunder and Lightning: Electrical Effects, for details.
  3962. @end example
  3963. @noindent
  3964. in Info and
  3965. @quotation
  3966. See Section 5.2 [Thunder and Lightning], page 57, for details.
  3967. @end quotation
  3968. @noindent
  3969. in a printed manual.
  3970. The third argument to cross-references must observe some of the
  3971. restrictions for node names (@pxref{Node Line Requirements}). The
  3972. most common issue is that colons cannot be used, since that interferes
  3973. with the parsing of the Info file.
  3974. As a practical matter, it is often best to write cross-references with
  3975. just the first argument if the node name and the section title are the
  3976. same (or nearly so), and with the first and third arguments only if the
  3977. node name and title are different.
  3978. @findex xrefautomaticsectiontitle
  3979. Texinfo offers a setting to use the section title instead of node
  3980. names by default in cross-references (an explicitly specified third
  3981. argument still takes precedence):
  3982. @example
  3983. @@xrefautomaticsectiontitle on
  3984. @end example
  3985. Typically this line would be given near the beginning of the document
  3986. and used for the whole manual. But you can turn it off if you want
  3987. (@code{@@xrefautomaticsectiontitle off}), for example, if you're
  3988. including some other sub-document that doesn't have suitable section
  3989. names.
  3990. @node Four and Five Arguments
  3991. @subsection @code{@@xref} with Four and Five Arguments
  3992. @cindex Four- and five argument forms of cross-references
  3993. In a cross-reference, a fourth argument specifies the name of another
  3994. Info file, different from the file in which the reference appears, and
  3995. a fifth argument specifies its title as a printed manual.
  3996. @need 800
  3997. @noindent
  3998. The full template is:
  3999. @example
  4000. @group
  4001. @@xref@{@var{node-name}, @var{online-label}, @var{printed-label},
  4002. @var{info-file-name}, @var{printed-manual-title}@}.
  4003. @end group
  4004. @end example
  4005. @need 700
  4006. @noindent
  4007. For example,
  4008. @example
  4009. @@xref@{Electrical Effects, Lightning, Thunder and Lightning,
  4010. weather, An Introduction to Meteorology@}.
  4011. @end example
  4012. @noindent
  4013. produces this output in Info:
  4014. @example
  4015. *Note Lightning: (weather)Electrical Effects.
  4016. @end example
  4017. @noindent
  4018. As you can see, the name of the Info file is enclosed in parentheses
  4019. and precedes the name of the node.
  4020. @noindent
  4021. In a printed manual, the reference looks like this:
  4022. @quotation
  4023. See section ``Thunder and Lightning'' in @cite{An Introduction to
  4024. Meteorology}.
  4025. @end quotation
  4026. @noindent
  4027. The title of the printed manual is typeset like @code{@@cite}; and the
  4028. reference lacks a page number since @TeX{} cannot know to which page a
  4029. reference refers when that reference is to another manual.
  4030. Next case: often, you will leave out the second argument when you use
  4031. the long version of @code{@@xref}. In this case, the third argument,
  4032. the topic description, will be used as the cross-reference name in
  4033. Info. For example,
  4034. @example
  4035. @@xref@{Electrical Effects, , Thunder and Lightning,
  4036. weather, An Introduction to Meteorology@}.
  4037. @end example
  4038. @noindent
  4039. produces
  4040. @example
  4041. @group
  4042. *Note Thunder and Lightning: (weather)Electrical Effects.
  4043. @end group
  4044. @end example
  4045. @noindent
  4046. in Info and
  4047. @quotation
  4048. See section ``Thunder and Lightning'' in @cite{An Introduction to
  4049. Meteorology}.
  4050. @end quotation
  4051. @noindent
  4052. in a printed manual.
  4053. Next case: If the node name and the section title are the same in the
  4054. other manual, you may also leave out the section title. In this case,
  4055. the node name is used in both instances. For example,
  4056. @example
  4057. @@xref@{Electrical Effects,,,
  4058. weather, An Introduction to Meteorology@}.
  4059. @end example
  4060. @noindent
  4061. produces
  4062. @example
  4063. @group
  4064. *Note (weather)Electrical Effects::.
  4065. @end group
  4066. @end example
  4067. @noindent
  4068. in Info and
  4069. @quotation
  4070. See section ``Electrical Effects'' in @cite{An Introduction to
  4071. Meteorology}.
  4072. @end quotation
  4073. @noindent
  4074. in a printed manual.
  4075. A very unusual case: you may want to refer to another manual file that
  4076. is within a single printed manual---when multiple Texinfo files are
  4077. incorporated into the same @TeX{} run but can create separate Info or
  4078. HTML output files. In this case, you need to specify only the fourth
  4079. argument, and not the fifth.
  4080. Finally, it's also allowed to leave out all the arguments
  4081. @emph{except} the fourth and fifth, to refer to another manual as a
  4082. whole. See the next section.
  4083. @node Referring to a Manual as a Whole
  4084. @section Referring to a Manual as a Whole
  4085. @cindex Manual, referring to as a whole
  4086. @cindex Referring to an entire manual
  4087. @anchor{Top Node Naming} @c old name
  4088. Ordinarily, you must always name a node in a cross-reference.
  4089. However, it's not unusual to want to refer to another manual as a
  4090. whole, rather than a particular section within it. In this case,
  4091. giving any section name is an unnecessary distraction.
  4092. So, with cross-references to other manuals (@pxref{Four and Five
  4093. Arguments}), if the first argument is either @samp{Top} (capitalized
  4094. just that way) or omitted entirely, and the third argument is omitted,
  4095. the printed output includes no node or section name. (The Info output
  4096. includes @samp{Top} if it was given.) For example,
  4097. @example
  4098. @@xref@{Top,,, make, The GNU Make Manual@}.
  4099. @end example
  4100. @noindent produces
  4101. @example
  4102. @group
  4103. *Note (make)Top::.
  4104. @end group
  4105. @end example
  4106. @noindent and
  4107. @quotation
  4108. See @cite{The GNU Make Manual}.
  4109. @end quotation
  4110. @noindent
  4111. Info readers will go to the Top node of the manual whether
  4112. or not the `Top' node is explicitly specified.
  4113. It's also possible (and is historical practice) to refer to a whole
  4114. manual by specifying the `Top' node and an appropriate entry for the
  4115. third argument to the @code{@@xref} command. Using this idiom, to
  4116. make a cross-reference to @cite{The GNU Make Manual}, you would write:
  4117. @example
  4118. @@xref@{Top,, Overview, make, The GNU Make Manual@}.
  4119. @end example
  4120. @noindent
  4121. which produces
  4122. @example
  4123. *Note Overview: (make)Top.
  4124. @end example
  4125. @noindent
  4126. in Info and
  4127. @quotation
  4128. See section ``Overview'' in @cite{The GNU Make Manual}.
  4129. @end quotation
  4130. @noindent
  4131. in a printed manual.
  4132. In this example, @samp{Top} is the name of the first node, and
  4133. @samp{Overview} is the name of the first section of the manual. There
  4134. is no widely-used convention for naming the first section in a printed
  4135. manual, this is just what the Make manual happens to use. This
  4136. arbitrariness of the first name is a principal reason why omitting the
  4137. third argument in whole-manual cross-references is preferable.
  4138. @node @code{@@ref}
  4139. @section @code{@@ref}
  4140. @anchor{ref}@c old name
  4141. @findex ref
  4142. @cindex Cross-references using @code{@@ref}
  4143. @cindex References using @code{@@ref}
  4144. @code{@@ref} is nearly the same as @code{@@xref} except that it does
  4145. not generate a `See' in the printed output, just the reference itself.
  4146. This makes it useful as the last part of a sentence.
  4147. @noindent For example,
  4148. @cindex Hurricanes
  4149. @example
  4150. For more information, @@pxref@{This@}, and @@ref@{That@}.
  4151. @end example
  4152. @noindent
  4153. produces in Info:
  4154. @example
  4155. For more information, *note This::, and *note That::.
  4156. @end example
  4157. @noindent
  4158. and in printed output:
  4159. @quotation
  4160. For more information, see Section 1.1 [This], page 1,
  4161. and Section 1.2 [That], page 2.
  4162. @end quotation
  4163. The @code{@@ref} command can tempt writers to express themselves in a
  4164. manner that is suitable for a printed manual but looks awkward in the
  4165. Info format. Bear in mind that your audience could be using both the
  4166. printed and the Info format. For example:
  4167. @cindex Sea surges
  4168. @example
  4169. Sea surges are described in @@ref@{Hurricanes@}.
  4170. @end example
  4171. @noindent
  4172. looks ok in the printed output:
  4173. @quotation
  4174. Sea surges are described in Section 6.7 [Hurricanes], page 72.
  4175. @end quotation
  4176. @noindent
  4177. but is awkward to read in Info, ``note'' being a verb:
  4178. @example
  4179. Sea surges are described in *note Hurricanes::.
  4180. @end example
  4181. @node @code{@@pxref}
  4182. @section @code{@@pxref}
  4183. @anchor{pxref}@c old name
  4184. @findex pxref
  4185. @cindex Cross-references using @code{@@pxref}
  4186. @cindex References using @code{@@pxref}
  4187. The parenthetical reference command, @code{@@pxref}, is nearly the
  4188. same as @code{@@xref}, but it is best used at the end of a sentence or
  4189. before a closing parenthesis. The command differs from @code{@@xref}
  4190. in that @TeX{} typesets the reference for the printed manual with a
  4191. lowercase `see' rather than an uppercase `See'.
  4192. @noindent
  4193. With one argument, a parenthetical cross-reference looks like this:
  4194. @cindex Flooding
  4195. @example
  4196. @dots{} storms cause flooding (@@pxref@{Hurricanes@}) @dots{}
  4197. @end example
  4198. @need 800
  4199. @noindent
  4200. which produces
  4201. @example
  4202. @group
  4203. @dots{} storms cause flooding (*note Hurricanes::) @dots{}
  4204. @end group
  4205. @end example
  4206. @noindent
  4207. in Info and
  4208. @quotation
  4209. @dots{} storms cause flooding (see Section 6.7 [Hurricanes], page 72) @dots{}
  4210. @end quotation
  4211. @noindent
  4212. in a printed manual.
  4213. With two arguments, a parenthetical cross-reference has this template:
  4214. @example
  4215. @dots{} (@@pxref@{@var{node-name}, @var{cross-reference-name}@}) @dots{}
  4216. @end example
  4217. @noindent
  4218. which produces
  4219. @example
  4220. @dots{} (*note @var{cross-reference-name}: @var{node-name}.) @dots{}
  4221. @end example
  4222. @noindent
  4223. in Info and
  4224. @quotation
  4225. @dots{} (see Section @var{nnn} [@var{node-name}], page @var{ppp}) @dots{}
  4226. @end quotation
  4227. @noindent
  4228. in a printed manual.
  4229. @code{@@pxref} can be used with up to five arguments, just like
  4230. @code{@@xref} (@pxref{@code{@@xref}}).
  4231. In past versions of Texinfo, it was not allowed to write punctuation
  4232. after a @code{@@pxref}, so it could be used @emph{only} before a
  4233. right parenthesis. This is no longer the case, so now it can be used
  4234. (for example) at the end of a sentence, where a lowercase ``see''
  4235. works best. For instance:
  4236. @example
  4237. @dots{} For more information, @@pxref@{More@}.
  4238. @end example
  4239. @noindent
  4240. which outputs (in Info):
  4241. @example
  4242. @dots{} For more information, *note More::.
  4243. @end example
  4244. As a matter of style, @code{@@pxref} is best used at the ends of
  4245. sentences. Although it technically works in the middle of a sentence,
  4246. that location breaks up the flow of reading.
  4247. @node @code{@@anchor}
  4248. @section @code{@@anchor}: Defining Arbitrary Cross-reference Targets
  4249. @anchor{anchor}@c old name
  4250. @findex anchor
  4251. @cindex Anchors
  4252. @cindex Cross-reference targets, arbitrary
  4253. @cindex Targets for cross-references, arbitrary
  4254. An @dfn{anchor} is a position in your document, labelled so that
  4255. cross-references can refer to it, just as they can to nodes. You
  4256. create an anchor with the @code{@@anchor} command, and give the label
  4257. as a normal brace-delimited argument. For example:
  4258. @example
  4259. This marks the @@anchor@{x-spot@}spot.
  4260. @dots{}
  4261. @@xref@{x-spot,,the spot@}.
  4262. @end example
  4263. @noindent produces:
  4264. @example
  4265. This marks the spot.
  4266. @dots{}
  4267. See [the spot], page 1.
  4268. @end example
  4269. As you can see, the @code{@@anchor} command itself produces no output.
  4270. This example defines an anchor `x-spot' just before the word `spot'.
  4271. You can refer to it later with an @code{@@xref} or other cross
  4272. reference command, as shown (@pxref{Cross References}).
  4273. It is best to put @code{@@anchor} commands just before the position you
  4274. wish to refer to; that way, the reader's eye is led on to the correct
  4275. text when they jump to the anchor. You can put the @code{@@anchor}
  4276. command on a line by itself if that helps readability of the source.
  4277. Whitespace (including newlines) is ignored after @code{@@anchor}.
  4278. Anchor names and node names may not conflict. Anchors and nodes are
  4279. given similar treatment in some ways; for example, the
  4280. @code{goto-node} command takes either an anchor name or a node name as
  4281. an argument. (@xref{Go to node,,, info, Info}.)
  4282. Also like node names, anchor names cannot include some characters
  4283. (@pxref{Node Line Requirements}).
  4284. @cindex Nodes, deleting or renaming
  4285. Because of this duality, when you delete or rename a node, it is
  4286. usually a good idea to define an @code{@@anchor} with the old name.
  4287. That way, any links to the old node, whether from other Texinfo
  4288. manuals or general web pages, keep working. You can also do this with
  4289. the @file{RENAMED_NODES_FILE} feature of @command{makeinfo}
  4290. (@pxref{HTML Xref Link Preservation}). Both methods keep links
  4291. on the web working; the only substantive difference is that defining
  4292. anchors also makes the old node names available when reading the
  4293. document in Info.
  4294. @node @code{@@inforef}
  4295. @section @code{@@inforef}: Cross-references to Info-only Material
  4296. @anchor{inforef}@c old name
  4297. @findex inforef
  4298. @cindex Cross-references using @code{@@inforef}
  4299. @cindex References using @code{@@inforef}
  4300. @code{@@inforef} is used for making cross-references to Info
  4301. documents---even from a printed manual. This might be because you
  4302. want to refer to conditional @code{@@ifinfo} text
  4303. (@pxref{Conditionals}), or because printed output is not available
  4304. (perhaps because there is no Texinfo source), among other
  4305. possibilities.
  4306. The command takes either two or three arguments, in the following
  4307. order:
  4308. @enumerate
  4309. @item
  4310. The node name.
  4311. @item
  4312. The cross-reference name (optional).
  4313. @item
  4314. The Info file name.
  4315. @end enumerate
  4316. @noindent
  4317. The template is:
  4318. @example
  4319. @@inforef@{@var{node-name}, @var{cross-reference-name}, @var{info-file-name}@}
  4320. @end example
  4321. @need 800
  4322. @noindent
  4323. For example,
  4324. @example
  4325. @group
  4326. @@inforef@{Advanced, Advanced Info commands, info@},
  4327. for more information.
  4328. @end group
  4329. @end example
  4330. @need 800
  4331. @noindent
  4332. produces (in Info):
  4333. @example
  4334. @group
  4335. *Note Advanced Info commands: (info)Advanced,
  4336. for more information.
  4337. @end group
  4338. @end example
  4339. @need 800
  4340. @noindent
  4341. and (in the printed output):
  4342. @quotation
  4343. See Info file @file{info}, node @samp{Advanced}, for more information.
  4344. @end quotation
  4345. (This particular example is not realistic, since the Info manual is
  4346. written in Texinfo, so all formats are available. In fact, we don't
  4347. know of any extant Info-only manuals.)
  4348. The converse of @code{@@inforef} is @code{@@cite}, which is used to
  4349. refer to printed works for which no Info form exists.
  4350. @xref{@code{@@cite}}.
  4351. @node @code{@@url}
  4352. @section @code{@@url}, @code{@@uref@{@var{url}[, @var{text}][, @var{replacement}]@}}
  4353. @anchor{uref}@c old name
  4354. @findex uref
  4355. @cindex Uniform resource locator, referring to
  4356. @cindex URL, referring to
  4357. @cindex @code{href}, producing HTML
  4358. @code{@@uref} produces a reference to a uniform resource locator
  4359. (url). It takes one mandatory argument, the url, and two optional
  4360. arguments which control the text that is displayed. In HTML and PDF
  4361. output, @code{@@uref} produces a link you can follow. (To merely
  4362. indicate a url without creating a link people can follow, use
  4363. @code{@@indicateurl}, @pxref{@code{@@indicateurl}}.)
  4364. @findex url
  4365. @anchor{url}@code{@@url} is a synonym for @code{@@uref}.
  4366. (Originally, @code{@@url} had the meaning of @code{@@indicateurl}, but
  4367. in practice it was almost always misused. So we've changed the
  4368. meaning.)
  4369. The second argument, if specified, is the text to display (the default
  4370. is the url itself); in Info, DVI, and PDF output, but not in HTML
  4371. output, the url is output in addition to this text.
  4372. @cindex Man page, reference to
  4373. The third argument, if specified, is the text to display, but in this
  4374. case the url is not output in any format. This is useful when the
  4375. text is already sufficiently referential, as in a man page. Also, if
  4376. the third argument is given, the second argument is ignored.
  4377. @menu
  4378. * @code{@@url} Examples:: Examples of using all the forms of @code{@@url}.
  4379. * URL Line Breaking:: How lines are broken within @code{@@url} text.
  4380. * @code{@@url} PDF Output Format:: A special option to hide links in PDF output.
  4381. * PDF Colors:: Colorizing urls and other links in PDF output.
  4382. @end menu
  4383. @node @code{@@url} Examples
  4384. @subsection @code{@@url} Examples
  4385. @cindex @code{@@url}, examples of using
  4386. @cindex URL, examples of displaying
  4387. First, here is an example of the simplest form of @code{@@url}, with
  4388. just one argument. The given url is both the target and the visible
  4389. text of the link:
  4390. @example
  4391. The official GNU ftp site is @@uref@{http://ftp.gnu.org/gnu@}.
  4392. @end example
  4393. @noindent produces:
  4394. @display
  4395. The official GNU ftp site is @uref{http://ftp.gnu.org/gnu}.
  4396. @end display
  4397. @subsubheading Two-argument form of @code{@@url}
  4398. Here is an example of the two-argument form:
  4399. @example
  4400. The official @@uref@{http://ftp.gnu.org/gnu, GNU ftp site@}
  4401. holds programs and texts.
  4402. @end example
  4403. @noindent which produces:
  4404. @display
  4405. The official @uref{http://ftp.gnu.org/gnu, GNU ftp site}
  4406. holds programs and texts.
  4407. @end display
  4408. @noindent that is, the Info (and @TeX{}, etc.)@: output is this:
  4409. @example
  4410. The official GNU ftp site (http://ftp.gnu.org/gnu)
  4411. holds programs and texts.
  4412. @end example
  4413. @noindent while the HTML output is this:
  4414. @example
  4415. The official <a href="http://ftp.gnu.org/gnu">GNU ftp site</a>
  4416. holds programs and texts.
  4417. @end example
  4418. @subsubheading Three-argument form of @code{@@url}
  4419. Finally, an example of the three-argument form:
  4420. @example
  4421. The @@uref@{/man.cgi/1/ls,,ls@} program @dots{}
  4422. @end example
  4423. @noindent which, except for HTML, produces:
  4424. @display
  4425. The @uref{/man.cgi/1/ls,,ls} program @dots{}
  4426. @end display
  4427. @noindent but with HTML:
  4428. @example
  4429. The <a href="/man.cgi/1/ls">ls</a> program @dots{}
  4430. @end example
  4431. By the way, some people prefer to display urls in the unambiguous
  4432. format:
  4433. @display
  4434. <URL:http://@var{host}/@var{path}>
  4435. @end display
  4436. @noindent
  4437. @cindex @code{<URL...>} convention, not used
  4438. You can use this form in the input file if you wish. We feel it's not
  4439. necessary to include the @samp{<URL:} and @samp{>} in the output,
  4440. since to be useful any software that tries to detect urls in text
  4441. already has to detect them without the @samp{<URL:}.
  4442. @node URL Line Breaking
  4443. @subsection URL Line Breaking
  4444. @cindex Line breaking, and urls
  4445. @cindex Breakpoints within urls
  4446. @TeX{} allows line breaking within urls at only a few characters
  4447. (which are special in urls): @samp{&}, @samp{.}, @samp{#}, @samp{?},
  4448. and @samp{/} (but not between two @samp{/} characters). A tiny amount
  4449. of stretchable space is also inserted around these characters to help
  4450. with line breaking.
  4451. For HTML output, modern browsers will also do line breaking within
  4452. displayed urls. If you need to allow breaks at other characters you
  4453. can insert @code{@@/} as needed (@pxref{Line Breaks}).
  4454. @findex urefbreakstyle
  4455. By default, in @TeX{} any such breaks at special characters will occur
  4456. after the character. Some people prefer such breaks to happen before
  4457. the special character. This can be controlled with the
  4458. @code{@@urefbreakstyle} command (this command has effect only in
  4459. @TeX{}):
  4460. @example
  4461. @@urefbreakstyle @var{how}
  4462. @end example
  4463. @noindent where the argument @var{how} is one of these words:
  4464. @vindex after@r{, value for @code{@@urefbreakstyle}}
  4465. @vindex before@r{, value for @code{@@urefbreakstyle}}
  4466. @vindex none@r{, value for @code{@@urefbreakstyle}}
  4467. @table @samp
  4468. @item after
  4469. (the default) Potentially break after the special characters.
  4470. @item before
  4471. Potentially break before the special characters.
  4472. @item none
  4473. Do not consider breaking at the special characters at all; any potential
  4474. breaks must be manually inserted.
  4475. @end table
  4476. @node @code{@@url} PDF Output Format
  4477. @subsection @code{@@url} PDF Output Format
  4478. @cindex PDF output of urls
  4479. @cindex URLs, PDF output of
  4480. If the ultimate purpose of a PDF is only to be viewed online, perhaps
  4481. similar to HTML in some inchoate way, you may not want the urls to be
  4482. included in the visible text (just as urls are not visible to readers
  4483. of web pages). Texinfo provides a PDF-specific option for this, which
  4484. must be used inside @code{@@tex}:
  4485. @findex \urefurlonlylinktrue
  4486. @example
  4487. @@tex
  4488. \global\urefurlonlylinktrue
  4489. @@end tex
  4490. @end example
  4491. The result is that @code{@@url@{http://www.gnu.org, GNU@}} has the
  4492. visible output of just `GNU', with a link target of
  4493. @url{http://www.gnu.org}. Ordinarily, the visible output would
  4494. include both the label and the url: `GNU (@url{http://www.gnu.org})'.
  4495. This option only has effect when the PDF output is produced with the
  4496. pdf@TeX{} program, not with other ways of getting from Texinfo to PDF
  4497. (e.g., @TeX{} to DVI to PDF)@. Consequently, it is ok to specify this
  4498. option unconditionally within @code{@@tex}, as shown above. It is
  4499. ignored when DVI is being produced.
  4500. @node PDF Colors
  4501. @subsection PDF Colors
  4502. @cindex Colored links, in PDF output
  4503. @cindex Links, coloring in PDF output
  4504. @cindex URLs, coloring in PDF output
  4505. By default, urls and cross-reference links are printed in black in PDF
  4506. output. Very occasionally, however, you may want to highlight such
  4507. ``live'' links with a different color, as is commonly done on web
  4508. pages. Texinfo provides a PDF-specific option for specifying these
  4509. colors, which must be used inside @code{@@tex}:
  4510. @findex \linkcolor
  4511. @findex \urlcolor
  4512. @example
  4513. @@tex
  4514. \global\def\linkcolor@{1 0 0@} % red
  4515. \global\def\urlcolor@{0 1 0@} % green
  4516. @@end tex
  4517. @end example
  4518. @code{\urlcolor} changes the color of @code{@@url} output (both the
  4519. actual url and any textual label), while @code{\linkcolor} changes the
  4520. color for cross-references to nodes, etc. They are independent.
  4521. @cindex RGB color specification.
  4522. The three given values must be numbers between 0 and 1, specifying the
  4523. amount of red, green, and blue respectively.
  4524. These definitions only have an effect when the PDF output is produced
  4525. with the pdf@TeX{} program, not with other ways of getting from
  4526. Texinfo to PDF (e.g., @TeX{} to DVI to PDF)@. Consequently, it is ok
  4527. to specify this option unconditionally within @code{@@tex}, as shown
  4528. above. It is ignored when DVI is being produced.
  4529. We do not recommend colorizing just for fun; unless you have a
  4530. specific reason to use colors, best to skip it.
  4531. @node @code{@@cite}
  4532. @section @code{@@cite}@{@var{reference}@}
  4533. @anchor{cite}@c old name
  4534. @findex cite
  4535. Use the @code{@@cite} command for the name of a book that lacks a
  4536. companion Info file. The command produces italics in the printed
  4537. manual, and quotation marks in the Info file.
  4538. If a book is written in Texinfo, it is better to use a cross-reference
  4539. command since a reader can easily follow such a reference in Info.
  4540. @xref{@code{@@xref}}.
  4541. @node Marking Text
  4542. @chapter Marking Text, Words and Phrases
  4543. @cindex Paragraph, marking text within
  4544. @cindex Marking words and phrases
  4545. @cindex Words and phrases, marking them
  4546. @cindex Marking text within a paragraph
  4547. @cindex Text, marking up
  4548. In Texinfo, you can mark words and phrases in a variety of ways.
  4549. The Texinfo formatters use this information to determine how to
  4550. highlight the text.
  4551. You can specify, for example, whether a word or phrase is a
  4552. defining occurrence, a metasyntactic variable, or a symbol used in a
  4553. program. Also, you can emphasize text, in several different ways.
  4554. @menu
  4555. * Indicating:: How to indicate definitions, files, etc.
  4556. * Emphasis:: How to emphasize text.
  4557. @end menu
  4558. @node Indicating
  4559. @section Indicating Definitions, Commands, etc.
  4560. @cindex Highlighting text
  4561. @cindex Indicating commands, definitions, etc.
  4562. Texinfo has commands for indicating just what kind of object a piece
  4563. of text refers to. For example, email addresses are marked by
  4564. @code{@@email}; that way, the result can be a live link to send email
  4565. when the output format supports it. If the email address was simply
  4566. marked as ``print in a typewriter font'', that would not be possible.
  4567. @menu
  4568. * Useful Highlighting:: Highlighting provides useful information.
  4569. * @code{@@code}:: Indicating program code.
  4570. * @code{@@kbd}:: Showing keyboard input.
  4571. * @code{@@key}:: Specifying keys.
  4572. * @code{@@samp}:: Indicating a literal sequence of characters.
  4573. * @code{@@verb}:: Indicating a verbatim sequence of characters.
  4574. * @code{@@var}:: Indicating metasyntactic variables.
  4575. * @code{@@env}:: Indicating environment variables.
  4576. * @code{@@file}:: Indicating file names.
  4577. * @code{@@command}:: Indicating command names.
  4578. * @code{@@option}:: Indicating option names.
  4579. * @code{@@dfn}:: Specifying definitions.
  4580. * @code{@@abbr}:: Indicating abbreviations.
  4581. * @code{@@acronym}:: Indicating acronyms.
  4582. * @code{@@indicateurl}:: Indicating an example url.
  4583. * @code{@@email}:: Indicating an electronic mail address.
  4584. @end menu
  4585. @node Useful Highlighting
  4586. @subsection Highlighting Commands are Useful
  4587. The commands serve a variety of purposes:
  4588. @table @code
  4589. @item @@code@{@var{sample-code}@}
  4590. Indicate text that is a literal example of a piece of a program.
  4591. @xref{@code{@@code}}.
  4592. @item @@kbd@{@var{keyboard-characters}@}
  4593. Indicate keyboard input. @xref{@code{@@kbd}}.
  4594. @item @@key@{@var{key-name}@}
  4595. Indicate the conventional name for a key on a keyboard.
  4596. @xref{@code{@@key}}.
  4597. @item @@samp@{@var{text}@}
  4598. Indicate text that is a literal example of a sequence of characters.
  4599. @xref{@code{@@samp}}.
  4600. @item @@verb@{@var{text}@}
  4601. Write a verbatim sequence of characters.
  4602. @xref{@code{@@verb}}.
  4603. @item @@var@{@var{metasyntactic-variable}@}
  4604. Indicate a metasyntactic variable. @xref{@code{@@var}}.
  4605. @item @@env@{@var{environment-variable}@}
  4606. Indicate an environment variable. @xref{@code{@@env}}.
  4607. @item @@file@{@var{file-name}@}
  4608. Indicate the name of a file. @xref{@code{@@file}}.
  4609. @item @@command@{@var{command-name}@}
  4610. Indicate the name of a command.
  4611. @xref{@code{@@command}}.
  4612. @item @@option@{@var{option}@}
  4613. Indicate a command-line option.
  4614. @xref{@code{@@option}}.
  4615. @item @@dfn@{@var{term}@}
  4616. Indicate the introductory or defining use of a term.
  4617. @xref{@code{@@dfn}}.
  4618. @item @@cite@{@var{reference}@}
  4619. Indicate the name of a book. @xref{@code{@@cite}}.
  4620. @item @@abbr@{@var{abbreviation}@}
  4621. Indicate an abbreviation, such as `Comput.'.
  4622. @item @@acronym@{@var{acronym}@}
  4623. Indicate an acronym. @xref{@code{@@acronym}}.
  4624. @item @@indicateurl@{@var{uniform-resource-locator}@}
  4625. Indicate an example (that is, nonfunctional) uniform resource locator.
  4626. @xref{@code{@@indicateurl}}. (Use @code{@@url} (@pxref{@code{@@url}}) for
  4627. live urls.)
  4628. @item @@email@{@var{email-address}[, @var{displayed-text}]@}
  4629. Indicate an electronic mail address. @xref{@code{@@email}}.
  4630. @end table
  4631. @node @code{@@code}
  4632. @subsection @code{@@code}@{@var{sample-code}@}
  4633. @anchor{code}@c old name
  4634. @findex code
  4635. @cindex Syntactic tokens, indicating
  4636. Use the @code{@@code} command to indicate text that is a piece of a
  4637. program and which consists of entire syntactic tokens. Enclose the
  4638. text in braces.
  4639. @cindex Expressions in a program, indicating
  4640. @cindex Keywords, indicating
  4641. @cindex Reserved words, indicating
  4642. Thus, you should use @code{@@code} for an expression in a program, for
  4643. the name of a variable or function used in a program, or for a
  4644. keyword in a programming language.
  4645. Use @code{@@code} for command names in languages that resemble
  4646. programming languages, such as Texinfo. For example, @code{@@code} and
  4647. @code{@@samp} are produced by writing @samp{@@code@{@@@@code@}} and
  4648. @samp{@@code@{@@@@samp@}} in the Texinfo source, respectively.
  4649. @cindex Case, not altering in @code{@@code}
  4650. It is incorrect to alter the case of a word inside a @code{@@code}
  4651. command when it appears at the beginning of a sentence. Most computer
  4652. languages are case sensitive. In C, for example, @code{Printf} is
  4653. different from the identifier @code{printf}, and most likely is a
  4654. misspelling of it. Even in languages which are not case sensitive, it
  4655. is confusing to a human reader to see identifiers spelled in different
  4656. ways. Pick one spelling and always use that. If you do not want to
  4657. start a sentence with a command name written all in lowercase, you
  4658. should rearrange the sentence.
  4659. In the Info output, @code{@@code} results in single quotation marks
  4660. around the text. In other formats, @code{@@code} argument is typeset
  4661. in a typewriter (monospace) font. For example,
  4662. @example
  4663. The function returns @@code@{nil@}.
  4664. @end example
  4665. @noindent
  4666. produces this:
  4667. @quotation
  4668. The function returns @code{nil}.
  4669. @end quotation
  4670. Here are some cases for which it is preferable @emph{not} to use @code{@@code}:
  4671. @itemize @bullet
  4672. @item
  4673. For shell command names such as @command{ls} (use @code{@@command}).
  4674. @item
  4675. For environment variable such as @env{TEXINPUTS} (use @code{@@env}).
  4676. @item
  4677. For shell options such as @samp{-c} when such options stand alone (use
  4678. @code{@@option}).
  4679. @item
  4680. An entire shell command often looks better if written using
  4681. @code{@@samp} rather than @code{@@code}. In this case, the rule is to
  4682. choose the more pleasing format.
  4683. @item
  4684. For a string of characters shorter than a syntactic token. For example,
  4685. if you are writing about @samp{goto-ch}, which is just a part of the
  4686. name for the @code{goto-char} Emacs Lisp function, you should use
  4687. @code{@@samp}.
  4688. @item
  4689. In general, when writing about the characters used in a token; for
  4690. example, do not use @code{@@code} when you are explaining what letters
  4691. or printable symbols can be used in the names of functions. (Use
  4692. @code{@@samp}.) Also, you should not use @code{@@code} to mark text
  4693. that is considered input to programs unless the input is written in a
  4694. language that is like a programming language. For example, you should
  4695. not use @code{@@code} for the keystroke commands of GNU Emacs (use
  4696. @code{@@kbd} instead) although you may use @code{@@code} for the names
  4697. of the Emacs Lisp functions that the keystroke commands invoke.
  4698. @end itemize
  4699. By default, @TeX{} will consider breaking lines at @samp{-} and
  4700. @samp{_} characters within @code{@@code} and related commands. This
  4701. can be controlled with @code{@@allowcodebreaks}
  4702. (@pxref{@code{@@allowcodebreaks}}). The HTML output attempts to
  4703. respect this for @samp{-}, but ultimately it is up to the browser's
  4704. behavior. For Info, it seems better never to make such breaks.
  4705. For Info, the quotes are omitted in the output of the @code{@@code}
  4706. command and related commands (e.g., @code{@@kbd}, @code{@@command}),
  4707. in typewriter-like contexts such as the @code{@@example} environment
  4708. (@pxref{@code{@@example}}) and @code{@@code} itself, etc.
  4709. To control which quoting characters are implicitly inserted by Texinfo
  4710. processors in the output of @samp{@@code}, etc., see the
  4711. @code{OPEN_QUOTE_SYMBOL} and @code{CLOSE_QUOTE_SYMBOL} customization
  4712. variables (@pxref{Other Customization Variables}). This is separate
  4713. from how actual quotation characters in the input document are handled
  4714. (@pxref{Inserting Quote Characters}).
  4715. @node @code{@@kbd}
  4716. @subsection @code{@@kbd}@{@var{keyboard-characters}@}
  4717. @anchor{kbd}@c old name
  4718. @findex kbd
  4719. @cindex Keyboard input
  4720. Use the @code{@@kbd} command for characters of input to be typed by
  4721. users. For example, to refer to the characters @kbd{M-a}, write:
  4722. @example
  4723. @@kbd@{M-a@}
  4724. @end example
  4725. @noindent
  4726. and to refer to the characters @kbd{M-x shell}, write:
  4727. @example
  4728. @@kbd@{M-x shell@}
  4729. @end example
  4730. @cindex User input
  4731. @cindex Slanted typewriter font, for @code{@@kbd}
  4732. By default, the @code{@@kbd} command produces a different font
  4733. (slanted typewriter instead of normal typewriter),
  4734. so users can distinguish the characters that they are supposed
  4735. to type from those that the computer outputs.
  4736. @findex kbdinputstyle
  4737. Since the usage of @code{@@kbd} varies from manual to manual, you can
  4738. control the font switching with the @code{@@kbdinputstyle} command.
  4739. This command has no effect on Info output. Write this command at the
  4740. beginning of a line with a single word as an argument, one of the
  4741. following:
  4742. @vindex distinct@r{, value for @code{@@kbdinputstyle}}
  4743. @vindex example@r{, value for @code{@@kbdinputstyle}}
  4744. @vindex code@r{, value for @code{@@kbdinputstyle}}
  4745. @table @samp
  4746. @item code
  4747. Always use the same font for @code{@@kbd} as @code{@@code}.
  4748. @item example
  4749. Use the distinguishing font for @code{@@kbd} only in @code{@@example}
  4750. and similar environments.
  4751. @item distinct
  4752. (the default) Always use the distinguishing font for @code{@@kbd}.
  4753. @end table
  4754. You can embed another @@-command inside the braces of a @code{@@kbd}
  4755. command. Here, for example, is the way to describe a command that
  4756. would be described more verbosely as ``press the @samp{r} key and then
  4757. press the @key{RETURN} key'':
  4758. @example
  4759. @@kbd@{r @@key@{RET@}@}
  4760. @end example
  4761. @noindent
  4762. This produces: @kbd{r @key{RET}}. (The present manual uses the
  4763. default for @code{@@kbdinputstyle}.)
  4764. You also use the @code{@@kbd} command if you are spelling out the letters
  4765. you type; for example:
  4766. @example
  4767. To give the @@code@{logout@} command,
  4768. type the characters @@kbd@{l o g o u t @@key@{RET@}@}.
  4769. @end example
  4770. @noindent
  4771. This produces:
  4772. @quotation
  4773. To give the @code{logout} command,
  4774. type the characters @kbd{l o g o u t @key{RET}}.
  4775. @end quotation
  4776. (Also, this example shows that you can add spaces for clarity. If you
  4777. explicitly want to mention a space character as one of the characters of
  4778. input, write @kbd{@@key@{SPC@}} for it.)
  4779. @node @code{@@key}
  4780. @subsection @code{@@key}@{@var{key-name}@}
  4781. @anchor{key}@c old name
  4782. @findex key
  4783. Use the @code{@@key} command for the conventional name for a key on a
  4784. keyboard, as in:
  4785. @example
  4786. @@key@{RET@}
  4787. @end example
  4788. You can use the @code{@@key} command within the argument of an
  4789. @code{@@kbd} command when the sequence of characters to be typed
  4790. includes one or more keys that are described by name.
  4791. For example, to produce @kbd{C-x @key{ESC}} and @kbd{M-@key{TAB}} you
  4792. would type:
  4793. @example
  4794. @@kbd@{C-x @@key@{ESC@}@}
  4795. @@kbd@{M-@@key@{TAB@}@}
  4796. @end example
  4797. Here is a list of the recommended names for keys:
  4798. @cindex Recommended names for keys
  4799. @cindex Keys, recommended names
  4800. @cindex Names recommended for keys
  4801. @cindex Abbreviations for keys
  4802. @cindex Control keys, specifying
  4803. @cindex Meta keys, specifying
  4804. @quotation
  4805. @table @t
  4806. @item SPC
  4807. Space
  4808. @item RET
  4809. Return
  4810. @item LFD
  4811. Linefeed (however, since most keyboards nowadays do not have a Linefeed key,
  4812. it might be better to call this character @kbd{C-j})
  4813. @item TAB
  4814. Tab
  4815. @item BS
  4816. Backspace
  4817. @item ESC
  4818. Escape
  4819. @item DELETE
  4820. Delete
  4821. @item SHIFT
  4822. Shift
  4823. @item CTRL
  4824. Control
  4825. @item META
  4826. Meta
  4827. @end table
  4828. @end quotation
  4829. @cindex META key
  4830. There are subtleties to handling words like `meta' or `ctrl' that are
  4831. names of modifier keys. When mentioning a character in which the
  4832. modifier key is used, such as @kbd{Meta-a}, use the @code{@@kbd} command
  4833. alone; do not use the @code{@@key} command; but when you are referring
  4834. to the modifier key in isolation, use the @code{@@key} command. For
  4835. example, write @samp{@@kbd@{Meta-a@}} to produce @kbd{Meta-a} and
  4836. @samp{@@key@{META@}} to produce @key{META}.
  4837. @c per rms.
  4838. As a convention in GNU manuals, @code{@@key} should not be used in
  4839. index entries.
  4840. @node @code{@@samp}
  4841. @subsection @code{@@samp}@{@var{text}@}
  4842. @anchor{samp}@c old name
  4843. @findex samp
  4844. Use the @code{@@samp} command to indicate text that is a literal example
  4845. or `sample' of a sequence of characters in a file, string, pattern, etc.
  4846. Enclose the text in braces. The argument appears within single
  4847. quotation marks in both the Info file and the printed manual; in
  4848. addition, it is printed in a fixed-width font.
  4849. @example
  4850. To match @@samp@{foo@} at the end of the line,
  4851. use the regexp @@samp@{foo$@}.
  4852. @end example
  4853. @noindent
  4854. produces
  4855. @quotation
  4856. To match @samp{foo} at the end of the line, use the regexp
  4857. @samp{foo$}.
  4858. @end quotation
  4859. Any time you are referring to single characters, you should use
  4860. @code{@@samp} unless @code{@@kbd} or @code{@@key} is more appropriate.
  4861. Also, you may use @code{@@samp} for entire statements in C and for entire
  4862. shell commands---in this case, @code{@@samp} often looks better than
  4863. @code{@@code}. Basically, @code{@@samp} is a catchall for whatever is
  4864. not covered by @code{@@code}, @code{@@kbd}, @code{@@key},
  4865. @code{@@command}, etc.
  4866. Only include punctuation marks within braces if they are part of the
  4867. string you are specifying. Write punctuation marks outside the braces
  4868. if those punctuation marks are part of the English text that surrounds
  4869. the string. In the following sentence, for example, the commas and
  4870. period are outside of the braces:
  4871. @example
  4872. @group
  4873. In English, the vowels are @@samp@{a@}, @@samp@{e@},
  4874. @@samp@{i@}, @@samp@{o@}, @@samp@{u@}, and sometimes
  4875. @@samp@{y@}.
  4876. @end group
  4877. @end example
  4878. @noindent
  4879. This produces:
  4880. @quotation
  4881. In English, the vowels are @samp{a}, @samp{e},
  4882. @samp{i}, @samp{o}, @samp{u}, and sometimes
  4883. @samp{y}.
  4884. @end quotation
  4885. @node @code{@@verb}
  4886. @subsection @code{@@verb}@{@var{char}@var{text}@var{char}@}
  4887. @anchor{verb}@c old name
  4888. @findex verb
  4889. @cindex Verbatim in-line text
  4890. @cindex Delimiter character, for verbatim
  4891. Use the @code{@@verb} command to print a verbatim sequence of
  4892. characters.
  4893. Like @LaTeX{}'s @code{\verb} command, the verbatim text can be quoted using
  4894. any unique delimiter character. Enclose the verbatim text, including the
  4895. delimiters, in braces. Text is printed in a fixed-width font:
  4896. @example
  4897. How many @@verb@{|@@|@}-escapes does one need to print this
  4898. @@verb@{.@@a @@b.@@c.@} string or @@verb@{+@@'e?`@{@}!`\+@} this?
  4899. @end example
  4900. @noindent
  4901. produces
  4902. @example
  4903. How many @verb{|@|}-escapes does one need to print this
  4904. @verb{.@a @b.@c.} string or @verb{+@'e?`{}!`\+} this?
  4905. @end example
  4906. This is in contrast to @code{@@samp} (see the previous section),
  4907. @code{@@code}, and similar commands; in those cases, the argument is
  4908. normal Texinfo text, where the three characters @code{@@@{@}} are
  4909. special, as usual. With @code{@@verb}, nothing is special except the
  4910. delimiter character you choose.
  4911. The delimiter character itself may appear inside the verbatim text, as
  4912. shown above. As another example, @samp{@@verb@{...@}} prints a single
  4913. (fixed-width) period.
  4914. It is not reliable to use @code{@@verb} inside other Texinfo
  4915. constructs. In particular, it does not work to use @code{@@verb} in
  4916. anything related to cross-referencing, such as section titles or
  4917. figure captions.
  4918. @node @code{@@var}
  4919. @subsection @code{@@var}@{@var{metasyntactic-variable}@}
  4920. @anchor{var}@c old name
  4921. @findex var
  4922. Use the @code{@@var} command to indicate metasyntactic variables. A
  4923. @dfn{metasyntactic variable} is something that stands for another
  4924. piece of text. For example, you should use a metasyntactic variable
  4925. in the documentation of a function to describe the arguments that are
  4926. passed to that function.
  4927. Do not use @code{@@var} for the names of normal variables in computer
  4928. programs. These are specific names, so @code{@@code} is correct for
  4929. them (@code{@@code}). For example, the Emacs Lisp variable
  4930. @code{texinfo-tex-command} is not a metasyntactic variable; it is
  4931. properly formatted using @code{@@code}.
  4932. Do not use @code{@@var} for environment variables either; @code{@@env}
  4933. is correct for them (see the next section).
  4934. The effect of @code{@@var} in the Info file is to change the case of
  4935. the argument to all uppercase. In the printed manual and HTML
  4936. output, the argument is output in slanted type.
  4937. @need 700
  4938. For example,
  4939. @example
  4940. To delete file @@var@{filename@},
  4941. type @@samp@{rm @@var@{filename@}@}.
  4942. @end example
  4943. @noindent
  4944. produces
  4945. @quotation
  4946. To delete file @var{filename}, type @samp{rm @var{filename}}.
  4947. @end quotation
  4948. @noindent
  4949. (Note that @code{@@var} may appear inside @code{@@code},
  4950. @code{@@samp}, @code{@@file}, etc.)
  4951. Write a metasyntactic variable all in lowercase without spaces, and
  4952. use hyphens to make it more readable. Thus, the Texinfo source for
  4953. the illustration of how to begin a Texinfo manual looks like
  4954. this:
  4955. @example
  4956. @group
  4957. \input texinfo
  4958. @@@@settitle @@var@{name-of-manual@}
  4959. @end group
  4960. @end example
  4961. @noindent
  4962. This produces:
  4963. @example
  4964. @group
  4965. \input texinfo
  4966. @@settitle @var{name-of-manual}
  4967. @end group
  4968. @end example
  4969. In some documentation styles, metasyntactic variables are shown with
  4970. angle brackets, for example:
  4971. @example
  4972. @dots{}, type rm <filename>
  4973. @end example
  4974. @noindent
  4975. However, that is not the style that Texinfo uses.
  4976. @c FIXME add a customization variable? Add an example on how to do that
  4977. @c for HTML?
  4978. @c (You can, of course, modify the sources to @file{texinfo.tex}
  4979. @c and the Info formatting commands
  4980. @c to output the @code{<@dots{}>} format if you wish.)
  4981. @node @code{@@env}
  4982. @subsection @code{@@env}@{@var{environment-variable}@}
  4983. @anchor{env}@c old name
  4984. @findex env
  4985. Use the @code{@@env} command to indicate environment variables, as
  4986. used by many operating systems, including GNU@. Do not use it for
  4987. @emph{meta}syntactic variables; use @code{@@var} for those (see the
  4988. previous section).
  4989. @code{@@env} is equivalent to @code{@@code} in its effects.
  4990. For example:
  4991. @example
  4992. The @@env@{PATH@} environment variable @dots{}
  4993. @end example
  4994. @noindent produces
  4995. @quotation
  4996. The @env{PATH} environment variable @dots{}
  4997. @end quotation
  4998. @node @code{@@file}
  4999. @subsection @code{@@file}@{@var{file-name}@}
  5000. @anchor{file}@c old name
  5001. @findex file
  5002. Use the @code{@@file} command to indicate text that is the name of a
  5003. file, buffer, or directory, or is the name of a node in Info. You can
  5004. also use the command for file name suffixes. Do not use @code{@@file}
  5005. for symbols in a programming language; use @code{@@code}.
  5006. @code{@@file} is equivalent to @code{code} in its effects. For
  5007. example,
  5008. @example
  5009. The @@file@{.el@} files are in
  5010. the @@file@{/usr/local/emacs/lisp@} directory.
  5011. @end example
  5012. @noindent
  5013. produces
  5014. @quotation
  5015. The @file{.el} files are in
  5016. the @file{/usr/local/emacs/lisp} directory.
  5017. @end quotation
  5018. @node @code{@@command}
  5019. @subsection @code{@@command}@{@var{command-name}@}
  5020. @anchor{command}@c old name
  5021. @findex command
  5022. @cindex Command names, indicating
  5023. @cindex Program names, indicating
  5024. Use the @code{@@command} command to indicate command names, such as
  5025. @command{ls} or @command{cc}.
  5026. @code{@@command} is equivalent to @code{@@code} in its effects.
  5027. For example:
  5028. @example
  5029. The command @@command@{ls@} lists directory contents.
  5030. @end example
  5031. @noindent produces
  5032. @quotation
  5033. The command @command{ls} lists directory contents.
  5034. @end quotation
  5035. You should write the name of a program in the ordinary text font, rather
  5036. than using @code{@@command}, if you regard it as a new English word,
  5037. such as `Emacs' or `Bison'.
  5038. When writing an entire shell command invocation, as in @samp{ls -l},
  5039. you should use either @code{@@samp} or @code{@@code} at your discretion.
  5040. @node @code{@@option}
  5041. @subsection @code{@@option}@{@var{option-name}@}
  5042. @anchor{option}@c old name
  5043. @findex option
  5044. Use the @code{@@option} command to indicate a command-line option; for
  5045. example, @option{-l} or @option{--version} or
  5046. @option{--output=@var{filename}}.
  5047. @code{@@option} is equivalent to @code{@@code} in its effects.
  5048. For example:
  5049. @example
  5050. The option @@option@{-l@} produces a long listing.
  5051. @end example
  5052. @noindent produces
  5053. @quotation
  5054. The option @option{-l} produces a long listing.
  5055. @end quotation
  5056. @node @code{@@dfn}
  5057. @subsection @code{@@dfn}@{@var{term}@}
  5058. @anchor{dfn}@c old name
  5059. @findex dfn
  5060. Use the @code{@@dfn} command to identify the introductory or defining
  5061. use of a technical term. Use the command only in passages whose
  5062. purpose is to introduce a term which will be used again or which the
  5063. reader ought to know. Mere passing mention of a term for the first
  5064. time does not deserve @code{@@dfn}. The command generates italics in
  5065. the printed manual, and double quotation marks in the Info file. For
  5066. example:
  5067. @example
  5068. Getting rid of a file is called @@dfn@{deleting@} it.
  5069. @end example
  5070. @noindent
  5071. produces
  5072. @quotation
  5073. Getting rid of a file is called @dfn{deleting} it.
  5074. @end quotation
  5075. As a general rule, a sentence containing the defining occurrence of a
  5076. term should be a definition of the term. The sentence does not need
  5077. to say explicitly that it is a definition, but it should contain the
  5078. information of a definition---it should make the meaning clear.
  5079. @node @code{@@abbr}
  5080. @subsection @code{@@abbr}@{@var{abbreviation}[, @var{meaning}]@}
  5081. @anchor{abbr}@c old name
  5082. @findex abbr
  5083. @cindex Abbreviations, tagging
  5084. You can use the @code{@@abbr} command for general abbreviations. The
  5085. abbreviation is given as the single argument in braces, as in
  5086. @samp{@@abbr@{Comput.@}}. As a matter of style, or for particular
  5087. abbreviations, you may prefer to omit periods, as in
  5088. @samp{@@abbr@{Mr@} Stallman}.
  5089. @code{@@abbr} accepts an optional second argument, intended to be used
  5090. for the meaning of the abbreviation.
  5091. If the abbreviation ends with a lowercase letter and a period, and is
  5092. not at the end of a sentence, and has no second argument, remember to
  5093. use the @code{@@.} command (@pxref{Ending a Sentence}) to get the
  5094. correct spacing. However, you do not have to use @code{@@.} within
  5095. the abbreviation itself; Texinfo automatically assumes periods within
  5096. the abbreviation do not end a sentence.
  5097. @cindex @code{<abbr>} and @code{<abbrev>} tags
  5098. In @TeX{} and in the Info output, the first argument is printed as-is;
  5099. if the second argument is present, it is printed in parentheses after
  5100. the abbreviation. In HTML the @code{<abbr>} tag is used; in Docbook,
  5101. the @code{<abbrev>} tag is used. For instance:
  5102. @example
  5103. @@abbr@{Comput. J., Computer Journal@}
  5104. @end example
  5105. @noindent produces:
  5106. @display
  5107. @abbr{Comput. J., Computer Journal}
  5108. @end display
  5109. For abbreviations consisting of all capital letters, you may prefer to
  5110. use the @code{@@acronym} command instead. See the next section for
  5111. more on the usage of these two commands.
  5112. @node @code{@@acronym}
  5113. @subsection @code{@@acronym}@{@var{acronym}[, @var{meaning}]@}
  5114. @anchor{acronym}@c old name
  5115. @findex acronym
  5116. @cindex NASA, as acronym
  5117. @cindex Acronyms, tagging
  5118. You can use the @code{@@acronym} command for abbreviations written in
  5119. all capital letters, such as `@acronym{NASA}'. The abbreviation is
  5120. given as the single argument in braces, as in
  5121. @samp{@@acronym@{NASA@}}. As a matter of style, or for particular
  5122. acronyms, you may prefer to use periods, as in
  5123. @samp{@@acronym@{N.A.S.A.@}}.
  5124. @code{@@acronym} accepts an optional second argument, intended to be
  5125. used for the meaning of the acronym.
  5126. If the acronym is at the end of a sentence, and if there is no second
  5127. argument, remember to use the @code{@@.} or similar command
  5128. (@pxref{Ending a Sentence}) to get the correct spacing.
  5129. @cindex @code{<acronym>} tag
  5130. In @TeX{}, the acronym is printed in slightly smaller font. In the
  5131. Info output, the argument is printed as-is. In either format, if the
  5132. second argument is present, it is printed in parentheses after the
  5133. acronym. In HTML and Docbook the @code{<acronym>} tag is used.
  5134. For instance (since GNU is a recursive acronym, we use
  5135. @code{@@acronym} recursively):
  5136. @example
  5137. @@acronym@{GNU, @@acronym@{GNU@}'s Not Unix@}
  5138. @end example
  5139. @noindent produces:
  5140. @display
  5141. @acronym{GNU, @acronym{GNU}'s Not Unix}
  5142. @end display
  5143. @cindex Family names, in all capitals
  5144. In some circumstances, it is conventional to print family names in all
  5145. capitals. Don't use @code{@@acronym} for this, since a name is not an
  5146. acronym. Use @code{@@sc} instead (@pxref{Smallcaps}).
  5147. @code{@@abbr} and @code{@@acronym} are closely related commands: they
  5148. both signal to the reader that a shortened form is being used, and
  5149. possibly give a meaning. When choosing whether to use these two
  5150. commands, please bear the following in mind.
  5151. @itemize @minus
  5152. @item
  5153. In common English usage, acronyms are a subset of abbreviations: they
  5154. include pronounceable words like `@acronym{NATO}', `radar', and
  5155. `snafu'; some sources also include syllable acronyms like
  5156. `Usenet', hybrids like `@acronym{SIGGRAPH}', and unpronounceable
  5157. initialisms like `@acronym{FBI}'.
  5158. @item
  5159. In Texinfo, an acronym (but not an abbreviation) should consist only
  5160. of capital letters and periods, no lowercase.
  5161. @item
  5162. In @TeX{}, an acronym (but not an abbreviation) is printed in a
  5163. slightly smaller font.
  5164. @item
  5165. Some browsers place a dotted bottom border under abbreviations but not
  5166. acronyms.
  5167. @item
  5168. It usually turns out to be quite difficult and/or time-consuming to
  5169. consistently use @code{@@acronym} for all sequences of uppercase
  5170. letters. Furthermore, it looks strange for some acronyms to be in the
  5171. normal font size and others to be smaller. Thus, a simpler approach
  5172. you may wish to consider is to avoid @code{@@acronym} and just typeset
  5173. everything as normal text in all capitals: @samp{GNU}, producing the
  5174. output `GNU'.
  5175. @item
  5176. In general, it's not essential to use either of these commands for all
  5177. abbreviations; use your judgment. Text is perfectly readable without
  5178. them.
  5179. @end itemize
  5180. @node @code{@@indicateurl}
  5181. @subsection @code{@@indicateurl}@{@var{uniform-resource-locator}@}
  5182. @anchor{indicateurl}@c old name
  5183. @findex indicateurl
  5184. @cindex Uniform resource locator, indicating
  5185. @cindex URL, indicating
  5186. Use the @code{@@indicateurl} command to indicate a uniform resource
  5187. locator on the World Wide Web. This is purely for markup purposes and
  5188. does not produce a link you can follow (use the @code{@@url} or
  5189. @code{@@uref} command for that, @pxref{@code{@@url}}).
  5190. @code{@@indicateurl} is useful for urls which do not actually exist.
  5191. For example:
  5192. @example
  5193. For example, the url might be @@indicateurl@{http://example.org/path@}.
  5194. @end example
  5195. @noindent which produces:
  5196. @display
  5197. For example, the url might be @indicateurl{http://example.org/path}.
  5198. @end display
  5199. The output from @code{@@indicateurl} is more or less like that of
  5200. @code{@@samp} (@pxref{@code{@@samp}}).
  5201. @node @code{@@email}
  5202. @subsection @code{@@email}@{@var{email-address}[, @var{displayed-text}]@}
  5203. @anchor{email}@c old name
  5204. @findex email
  5205. Use the @code{@@email} command to indicate an electronic mail address.
  5206. It takes one mandatory argument, the address, and one optional argument, the
  5207. text to display (the default is the address itself).
  5208. @cindex Mailto link
  5209. In Info, the address is shown in angle brackets, preceded by the text
  5210. to display if any. In @TeX{}, the angle brackets are omitted. In
  5211. HTML output, @code{@@email} produces a @samp{mailto} link that usually
  5212. brings up a mail composition window. For example:
  5213. @example
  5214. Send bug reports to @@email@{bug-texinfo@@@@gnu.org@},
  5215. suggestions to the @@email@{bug-texinfo@@@@gnu.org, same place@}.
  5216. @end example
  5217. @noindent produces
  5218. @display
  5219. Send bug reports to @email{bug-texinfo@@gnu.org},
  5220. suggestions to the @email{bug-texinfo@@gnu.org, same place}.
  5221. @end display
  5222. @node Emphasis
  5223. @section Emphasizing Text
  5224. @cindex Emphasizing text
  5225. Usually, Texinfo changes the font to mark words in the text according
  5226. to the category the words belong to; an example is the @code{@@code}
  5227. command. Most often, this is the best way to mark words. However,
  5228. sometimes you will want to emphasize text without indicating a
  5229. category. Texinfo has two commands to do this. Also, Texinfo has
  5230. several commands that specify the font in which text will be output.
  5231. These commands have no effect in Info and only one of them, the
  5232. @code{@@r} command, has any regular use.
  5233. @menu
  5234. * @code{@@emph @@strong}:: How to emphasize text in Texinfo.
  5235. * Smallcaps:: How to use the small caps font.
  5236. * Fonts:: Various font commands for printed output.
  5237. @end menu
  5238. @node @code{@@emph @@strong}
  5239. @subsection @code{@@emph}@{@var{text}@} and @code{@@strong}@{@var{text}@}
  5240. @anchor{emph & strong}@c oldname
  5241. @findex emph
  5242. @findex strong
  5243. @cindex Emphasizing text, font for
  5244. The @code{@@emph} and @code{@@strong} commands are for emphasis;
  5245. @code{@@strong} is stronger. In printed output, @code{@@emph} produces
  5246. @emph{italics} and @code{@@strong} produces @strong{bold}.
  5247. In the Info output, @code{@@emph} surrounds the text with underscores
  5248. (@samp{_}), and @code{@@strong} puts asterisks around the text.
  5249. For example,
  5250. @example
  5251. @group
  5252. @@strong@{Caution:@} @@samp@{rm *@}
  5253. removes @@emph@{all@} normal files.
  5254. @end group
  5255. @end example
  5256. @noindent
  5257. produces the following:
  5258. @quotation
  5259. @strong{Caution}: @samp{rm * .[^.]*}
  5260. removes @emph{all} normal files.
  5261. @end quotation
  5262. The @code{@@strong} command is seldom used except to mark what is, in
  5263. effect, a typographical element, such as the word `Caution' in the
  5264. preceding example.
  5265. @quotation Caution
  5266. Do not use @code{@@strong} with the word @samp{Note} followed by a
  5267. space; Info will mistake the combination for a cross-reference. Use a
  5268. phrase such as @strong{Please notice} or @strong{Caution} instead, or
  5269. the optional argument to @code{@@quotation}---@samp{Note} is allowable
  5270. there.
  5271. @end quotation
  5272. @node Smallcaps
  5273. @subsection @code{@@sc}@{@var{text}@}: The Small Caps Font
  5274. @cindex Small caps font
  5275. @findex sc @r{(small caps font)}
  5276. Use the @samp{@@sc} command to set text in @sc{a small caps font}
  5277. (where possible). Write the text you want to be in small caps between
  5278. braces in lowercase, like this:
  5279. @example
  5280. Richard @@sc@{Stallman@} commenc@'{e} GNU.
  5281. @end example
  5282. @noindent
  5283. This produces:
  5284. @display
  5285. Richard @sc{Stallman} commenc@'{e} GNU.
  5286. @end display
  5287. As shown here, we recommend reserving @code{@@sc} for special cases
  5288. where you want typographic small caps; family names are one such,
  5289. especially in languages other than English, though there are no
  5290. hard-and-fast rules about such things.
  5291. @cindex @code{<small>} tag
  5292. @TeX{} typesets any uppercase letters between the braces of an
  5293. @code{@@sc} command in full-size capitals; only lowercase letters are
  5294. printed in the small caps font. In the Info output, the argument to
  5295. @code{@@sc} is printed in all uppercase. In HTML, the argument is
  5296. uppercased and the output marked with the @code{<small>} tag to reduce
  5297. the font size, since HTML cannot easily represent true small caps.
  5298. Overall, we recommend using standard upper- and lowercase letters
  5299. wherever possible.
  5300. @node Fonts
  5301. @subsection Fonts for Printing
  5302. @cindex Fonts for printing
  5303. @findex fonttextsize
  5304. @cindex Font size, reducing
  5305. @cindex Reducing font size
  5306. @cindex Smaller fonts
  5307. Texinfo provides one command to change the size of the main body font
  5308. in the @TeX{} output for a document: @code{@@fonttextsize}. It has no
  5309. effect in other output. It takes a single argument on the remainder
  5310. of the line, which must be either @samp{10} or @samp{11}. For
  5311. example:
  5312. @example
  5313. @@fonttextsize 10
  5314. @end example
  5315. @cindex Printing cost, reducing
  5316. The effect is to reduce the body font to a 10@dmn{pt} size (the
  5317. default is 11@dmn{pt}). Fonts for other elements, such as sections
  5318. and chapters, are reduced accordingly. This should only be used in
  5319. conjunction with @code{@@smallbook} (@pxref{@code{@@smallbook}}) or
  5320. similar, since 10@dmn{pt} fonts on standard paper (8.5x11 or A4) are
  5321. too small. One reason to use this command is to save pages, and hence
  5322. printing cost, for physical books.
  5323. Texinfo does not at present have commands to switch the font family
  5324. to use, or more general size-changing commands.
  5325. Texinfo also provides a number of font commands that specify font
  5326. changes in the printed manual and (where possible) in the HTML output.
  5327. They have no effect in Info. All the commands apply to a following
  5328. argument surrounded by braces.
  5329. @table @code
  5330. @item @@b
  5331. @findex b @r{(bold font)}
  5332. @cindex Bold font
  5333. selects @b{bold} face;
  5334. @item @@i
  5335. @findex i @r{(italic font)}
  5336. @cindex Italic font
  5337. selects an @i{italic} font;
  5338. @item @@r
  5339. @findex r @r{(roman font)}
  5340. @cindex Roman font
  5341. @cindex Default font
  5342. selects a @r{roman} font, which is the usual font in which text is
  5343. printed. It may or may not be seriffed.
  5344. @item @@sansserif
  5345. @findex sansserif @r{(sans serif font)}
  5346. @cindex Sans serif font
  5347. selects a @sansserif{sans serif} font;
  5348. @item @@slanted
  5349. @findex slanted @r{(slanted font)}
  5350. @cindex Slanted font
  5351. @cindex Oblique font
  5352. selects a @slanted{slanted} font;
  5353. @item @@t
  5354. @findex t @r{(typewriter font)}
  5355. @cindex Monospace font
  5356. @cindex Fixed-width font
  5357. @cindex Typewriter font
  5358. selects the @t{fixed-width}, typewriter-style font used by @code{@@code};
  5359. @end table
  5360. (The commands with longer names were invented much later than the
  5361. others, at which time it did not seem desirable to use very short
  5362. names for such infrequently needed features.)
  5363. @cindex @code{<lineannotation>} Docbook tag
  5364. The @code{@@r} command can be useful in example-like environments, to
  5365. write comments in the standard roman font instead of the fixed-width
  5366. font. This looks better in printed output, and produces a
  5367. @code{<lineannotation>} tag in Docbook output.
  5368. For example,
  5369. @example
  5370. @group
  5371. @@lisp
  5372. (+ 2 2) ; @@r@{Add two plus two.@}
  5373. @@end lisp
  5374. @end group
  5375. @end example
  5376. @noindent
  5377. produces
  5378. @lisp
  5379. (+ 2 2) ; @r{Add two plus two.}
  5380. @end lisp
  5381. The @code{@@t} command can occasionally be useful to produce output in
  5382. a typewriter font where that is supported (e.g., HTML and PDF), but no
  5383. distinction is needed in Info or plain text: @code{@@t@{foo@}}
  5384. produces @t{foo}, cf. @code{@@code@{foo@}} producing @code{foo}.
  5385. In general, the other font commands are unlikely to be useful; they
  5386. exist primarily to make it possible to document the functionality of
  5387. specific font effects, such as in @TeX{} and related packages.
  5388. @node Quotations and Examples
  5389. @chapter Quotations and Examples
  5390. Quotations and examples are blocks of text consisting of one or more
  5391. whole paragraphs that are set off from the bulk of the text and
  5392. treated differently. They are usually indented in the output.
  5393. @findex end
  5394. In Texinfo, you always begin a quotation or example by writing an
  5395. @@-command at the beginning of a line by itself, and end it by writing
  5396. an @code{@@end} command that is also at the beginning of a line by
  5397. itself. For instance, you begin an example by writing
  5398. @code{@@example} by itself at the beginning of a line and end the
  5399. example by writing @code{@@end example} on a line by itself, at the
  5400. beginning of that line, and with only one space between the
  5401. @code{@@end} and the @code{example}.
  5402. @menu
  5403. * Block Enclosing Commands:: Different constructs for different purposes.
  5404. * @code{@@quotation}:: Writing a quotation.
  5405. * @code{@@indentedblock}:: Block of text indented on left.
  5406. * @code{@@example}:: Writing an example in a fixed-width font.
  5407. * @code{@@verbatim}:: Writing a verbatim example.
  5408. * @code{@@lisp}:: Illustrating Lisp code.
  5409. * @code{@@display}:: Writing an example in the current font.
  5410. * @code{@@format}:: Writing an example without narrowed margins.
  5411. * @code{@@exdent}:: Undo indentation on a line.
  5412. * @code{@@flushleft @@flushright}:: Pushing text flush left or flush right.
  5413. * @code{@@raggedright}:: Avoiding justification on the right.
  5414. * @code{@@noindent}:: Preventing paragraph indentation.
  5415. * @code{@@indent}:: Forcing paragraph indentation.
  5416. * @code{@@cartouche}:: Drawing rounded rectangles around text.
  5417. * @code{@@small@dots{}}:: Examples in a smaller font.
  5418. @end menu
  5419. @node Block Enclosing Commands
  5420. @section Block Enclosing Commands
  5421. Here is a summary of commands that enclose blocks of text, also known
  5422. as @dfn{environments}. They're explained further in the following
  5423. sections.
  5424. @table @code
  5425. @item @@quotation
  5426. Indicate text that is quoted. The text is filled, indented (from both
  5427. margins), and printed in a roman font by default.
  5428. @item @@indentedblock
  5429. Like @code{@@quotation}, but the text is indented only on the left.
  5430. @item @@example
  5431. Illustrate code, commands, and the like. The text is printed
  5432. in a fixed-width font, and indented but not filled.
  5433. @item @@lisp
  5434. Like @code{@@example}, but specifically for illustrating Lisp code. The
  5435. text is printed in a fixed-width font, and indented but not filled.
  5436. @item @@verbatim
  5437. Mark a piece of text that is to be printed verbatim; no character
  5438. substitutions are made and all commands are ignored, until the next
  5439. @code{@@end verbatim}. The text is printed in a fixed-width font,
  5440. and not indented or filled. Extra spaces and blank lines are
  5441. significant, and tabs are expanded.
  5442. @item @@display
  5443. Display illustrative text. The text is indented but not filled, and
  5444. no font is selected (so, by default, the font is roman).
  5445. @item @@format
  5446. Like @code{@@display} (the text is not filled and no font is
  5447. selected), but the text is not indented.
  5448. @item @@smallquotation
  5449. @itemx @@smallindentedblock
  5450. @itemx @@smallexample
  5451. @itemx @@smalllisp
  5452. @itemx @@smalldisplay
  5453. @itemx @@smallformat
  5454. These @code{@@small...} commands are just like their non-small
  5455. counterparts, except that they output text in a smaller font size,
  5456. where possible.
  5457. @item @@flushleft
  5458. @itemx @@flushright
  5459. Text is not filled, but is set flush with the left or right margin,
  5460. respectively.
  5461. @item @@raggedright
  5462. Text is filled, but only justified on the left, leaving the right
  5463. margin ragged.
  5464. @item @@cartouche
  5465. Highlight text, often an example or quotation, by drawing a box with
  5466. rounded corners around it.
  5467. @end table
  5468. The @code{@@exdent} command is used within the above constructs to
  5469. undo the indentation of a line.
  5470. The @code{@@noindent} command may be used after one of the above
  5471. constructs (or at the beginning of any paragraph) to prevent the
  5472. following text from being indented as a new paragraph.
  5473. @node @code{@@quotation}
  5474. @section @code{@@quotation}: Block Quotations
  5475. @anchor{quotation}@c old name
  5476. @cindex Quotations
  5477. @findex quotation
  5478. The text of a quotation is processed like normal text (regular font,
  5479. text is filled) except that:
  5480. @itemize @bullet
  5481. @item
  5482. both the left and right margins are closer to the center of the page,
  5483. so the whole of the quotation is indented;
  5484. @item
  5485. the first lines of paragraphs are indented no more than other lines; and
  5486. @item
  5487. an @code{@@author} command may be given to specify the author of the
  5488. quotation.
  5489. @end itemize
  5490. @quotation
  5491. This is an example of text written between a @code{@@quotation}
  5492. command and an @code{@@end quotation} command. A @code{@@quotation}
  5493. command is most often used to indicate text that is excerpted from
  5494. another (real or hypothetical) printed work.
  5495. @end quotation
  5496. Write a @code{@@quotation} command as text on a line by itself. This
  5497. line will disappear from the output. Mark the end of the quotation
  5498. with a line beginning with and containing only @code{@@end quotation}.
  5499. The @code{@@end quotation} line will likewise disappear from the
  5500. output.
  5501. @code{@@quotation} takes one optional argument, given on the remainder
  5502. of the line. This text, if present, is included at the beginning of
  5503. the quotation in bold or otherwise emphasized, and followed with a
  5504. @samp{:}. For example:
  5505. @example
  5506. @@quotation Note
  5507. This is
  5508. a foo.
  5509. @@end quotation
  5510. @end example
  5511. @noindent
  5512. produces
  5513. @quotation Note
  5514. This is
  5515. a foo.
  5516. @end quotation
  5517. If the @code{@@quotation} argument is one of these English words
  5518. (case-insensitive):
  5519. @example
  5520. Caution Important Note Tip Warning
  5521. @end example
  5522. @cindex @code{<caution>} Docbook tag
  5523. @cindex @code{<important>} Docbook tag
  5524. @cindex @code{<note>} Docbook tag
  5525. @cindex @code{<tip>} Docbook tag
  5526. @cindex @code{<warning>} Docbook tag
  5527. @cindex @code{<blockquote>} HTML tag
  5528. @noindent then the Docbook output uses corresponding special tags
  5529. (@code{<note>}, etc.)@: instead of the default @code{<blockquote>}.
  5530. HTML output always uses @code{<blockquote>}.
  5531. If the author of the quotation is specified in the @code{@@quotation}
  5532. block with the @code{@@author} command, a line with the author name is
  5533. displayed after the quotation:
  5534. @example
  5535. @@quotation
  5536. People sometimes ask me if it is a sin in the Church of Emacs to use
  5537. vi. Using a free version of vi is not a sin; it is a penance. So happy
  5538. hacking.
  5539. @@author Richard Stallman
  5540. @@end quotation
  5541. @end example
  5542. @noindent
  5543. produces
  5544. @quotation
  5545. People sometimes ask me if it is a sin in the Church of Emacs to use
  5546. vi. Using a free version of vi is not a sin; it is a penance. So happy
  5547. hacking.
  5548. @author Richard Stallman
  5549. @end quotation
  5550. @findex smallquotation
  5551. Texinfo also provides a command @code{@@smallquotation}, which is just
  5552. like @code{@@quotation} but uses a smaller font size where possible.
  5553. @xref{@code{@@small@dots{}}}.
  5554. @node @code{@@indentedblock}
  5555. @section @code{@@indentedblock}: Indented text blocks
  5556. @cindex Indented text block
  5557. @findex indentedblock
  5558. The @code{@@indentedblock} environment is similar to
  5559. @code{@@quotation}, except that text is only indented on the left (and
  5560. there is no optional argument for an author). Thus, the text font
  5561. remains unchanged, and text is gathered and filled as usual, but the
  5562. left margin is increased. For example:
  5563. @indentedblock
  5564. This is an example of text written between an @code{@@indentedblock}
  5565. command and an @code{@@end indentedblock} command. The
  5566. @code{@@indentedblock} environment can contain any text or other
  5567. commands desired.
  5568. @end indentedblock
  5569. This is written in the Texinfo source as:
  5570. @example
  5571. @@indentedblock
  5572. This is an example ...
  5573. @@end indentedblock
  5574. @end example
  5575. @findex smallindentedblock
  5576. Texinfo also provides a command @code{@@smallindentedblock}, which is
  5577. just like @code{@@indentedblock} but uses a smaller font size where
  5578. possible. @xref{@code{@@small@dots{}}}.
  5579. @node @code{@@example}
  5580. @section @code{@@example}: Example Text
  5581. @anchor{example}@c old name
  5582. @findex example
  5583. @cindex Examples, formatting them
  5584. @cindex Formatting examples
  5585. The @code{@@example} environment is used to indicate an example that
  5586. is not part of the running text, such as computer input or output.
  5587. Write an @code{@@example} command at the beginning of a line by
  5588. itself. Mark the end of the example with an @code{@@end example}
  5589. command, also written at the beginning of a line by itself.
  5590. An @code{@@example} environment has the following characteristics:
  5591. @itemize
  5592. @item Each line in the input file is a line in the output; that is,
  5593. the source text is not filled as it normally is.
  5594. @item Extra spaces and blank lines are significant.
  5595. @item The output is indented.
  5596. @item The output uses a fixed-width font.
  5597. @item Texinfo commands @emph{are} expanded; if you want the output to
  5598. be the input verbatim, use the @code{@@verbatim} environment instead
  5599. (@pxref{@code{@@verbatim}}).
  5600. @end itemize
  5601. For example,
  5602. @example
  5603. @@example
  5604. cp foo @@var@{dest1@}; \
  5605. cp foo @@var@{dest2@}
  5606. @@end example
  5607. @end example
  5608. @noindent
  5609. produces
  5610. @example
  5611. cp foo @var{dest1}; \
  5612. cp foo @var{dest2}
  5613. @end example
  5614. The lines containing @code{@@example} and @code{@@end example} will
  5615. disappear from the output. To make the output look good, you should
  5616. put a blank line before the @code{@@example} and another blank line
  5617. after the @code{@@end example}. Blank lines inside the beginning
  5618. @code{@@example} and the ending @code{@@end example}, on the other
  5619. hand, do appear in the output.
  5620. @quotation Caution
  5621. Do not use tabs in the lines of an example! (Or anywhere else in
  5622. Texinfo, except in verbatim environments.) @TeX{} treats tabs as
  5623. single spaces, and that is not what they look like. In Emacs, you can
  5624. use @kbd{M-x untabify} to convert tabs in a region to multiple spaces.
  5625. @end quotation
  5626. Examples are often, logically speaking, ``in the middle'' of a
  5627. paragraph, and the text that continues afterwards should not be
  5628. indented, as in the example above. The @code{@@noindent} command
  5629. prevents a piece of text from being indented as if it were a new
  5630. paragraph (@pxref{@code{@@noindent}}).
  5631. If you want to embed code fragments within sentences, instead of
  5632. displaying them, use the @code{@@code} command or its relatives
  5633. (@pxref{@code{@@code}}).
  5634. If you wish to write a ``comment'' on a line of an example in the
  5635. normal roman font, you can use the @code{@@r} command (@pxref{Fonts}).
  5636. @node @code{@@verbatim}
  5637. @section @code{@@verbatim}: Literal Text
  5638. @anchor{verbatim}@c old name
  5639. @findex verbatim
  5640. @cindex Verbatim environment
  5641. Use the @code{@@verbatim} environment for printing of text that may
  5642. contain special characters or commands that should not be interpreted,
  5643. such as computer input or output (@code{@@example} interprets its text
  5644. as regular Texinfo commands). This is especially useful for including automatically
  5645. generated files in a Texinfo manual.
  5646. In general, the output will be just the same as the input. No
  5647. character substitutions are made, e.g., all spaces and blank lines are
  5648. significant, including tabs. In the printed manual, the text is
  5649. typeset in a fixed-width font, and not indented or filled.
  5650. Write a @code{@@verbatim} command at the beginning of a line by
  5651. itself. This line will disappear from the output. Mark the end of
  5652. the verbatim block with an @code{@@end verbatim} command, also written
  5653. at the beginning of a line by itself. The @code{@@end verbatim} will
  5654. also disappear from the output.
  5655. For example:
  5656. @c oops, got to trick this a bit: can't use @end verbatim inside @verbatim
  5657. @example
  5658. @exdent @t{@@verbatim}
  5659. @exdent @t{@{}
  5660. @exdent @key{TAB}@t{@@command with strange characters: @@'e}
  5661. @exdent @t{expand@key{TAB}me}
  5662. @exdent @t{@}}
  5663. @exdent @t{@@end verbatim}
  5664. @end example
  5665. @noindent
  5666. This produces:
  5667. @verbatim
  5668. {
  5669. @command with strange characters: @'e
  5670. expand me
  5671. }
  5672. @end verbatim
  5673. Since the lines containing @code{@@verbatim} and @code{@@end verbatim}
  5674. produce no output, typically you should put a blank line before the
  5675. @code{@@verbatim} and another blank line after the @code{@@end
  5676. verbatim}. Blank lines between the beginning @code{@@verbatim} and
  5677. the ending @code{@@end verbatim} will appear in the output.
  5678. @cindex Verbatim, small
  5679. @cindex Small verbatim
  5680. You can get a ``small'' verbatim by enclosing the @code{@@verbatim} in
  5681. an @code{@@smallformat} environment, as shown here:
  5682. @c more cheating ...
  5683. @smallexample
  5684. @exdent @t{@@smallformat}
  5685. @exdent @t{@@verbatim}
  5686. @exdent @t{... still verbatim, but in a smaller font ...}
  5687. @exdent @t{@@end verbatim}
  5688. @exdent @t{@@end smallformat}
  5689. @end smallexample
  5690. Finally, a word of warning: it is not reliable to use
  5691. @code{@@verbatim} inside other Texinfo constructs.
  5692. See also @ref{@code{@@verbatiminclude}}.
  5693. @node @code{@@lisp}
  5694. @section @code{@@lisp}: Marking a Lisp Example
  5695. @anchor{lisp}@c old name
  5696. @findex lisp
  5697. @cindex Lisp example
  5698. The @code{@@lisp} command is used for Lisp code. It is synonymous
  5699. with the @code{@@example} command.
  5700. @lisp
  5701. This is an example of text written between an
  5702. @code{@@lisp} command and an @code{@@end lisp} command.
  5703. @end lisp
  5704. Use @code{@@lisp} instead of @code{@@example} to preserve information
  5705. regarding the nature of the example. This is useful, for example, if
  5706. you write a function that evaluates only and all the Lisp code in a
  5707. Texinfo file. Then you can use the Texinfo file as a Lisp
  5708. library. Mark the end of @code{@@lisp} with @code{@@end lisp} on a line
  5709. by itself.
  5710. @node @code{@@display}
  5711. @section @code{@@display}: Examples Using the Text Font
  5712. @anchor{display}@c old name
  5713. @findex display
  5714. @cindex Display formatting
  5715. The @code{@@display} command begins another kind of environment, where
  5716. the font is left unchanged, not switched to typewriter as with
  5717. @code{@@example}. Each line of input still produces a line of output,
  5718. and the output is still indented.
  5719. @display
  5720. This is an example of text written between a @code{@@display} command
  5721. and an @code{@@end display} command. The @code{@@display} command
  5722. indents the text, but does not fill it.
  5723. @end display
  5724. @findex smalldisplay
  5725. Texinfo also provides the environment @code{@@smalldisplay}, which is
  5726. like @code{@@display} but uses a smaller font size.
  5727. @xref{@code{@@small@dots{}}}.
  5728. @node @code{@@format}
  5729. @section @code{@@format}: Examples Using the Full Line Width
  5730. @anchor{format}@c old name
  5731. @findex format
  5732. The @code{@@format} command is similar to @code{@@display}, except it
  5733. leaves the text unindented. Like @code{@@display}, it does not select
  5734. the fixed-width font.
  5735. @format
  5736. This is an example of text written between a @code{@@format} command
  5737. and an @code{@@end format} command. As you can see
  5738. from this example,
  5739. the @code{@@format} command does not fill the text.
  5740. @end format
  5741. @findex smallformat
  5742. Texinfo also provides the environment @code{@@smallformat}, which is
  5743. like @code{@@format} but uses a smaller font size.
  5744. @xref{@code{@@small@dots{}}}.
  5745. @node @code{@@exdent}
  5746. @section @code{@@exdent}: Undoing a Line's Indentation
  5747. @anchor{exdent}@c old name
  5748. @findex exdent
  5749. @cindex Indentation undoing
  5750. The @code{@@exdent} command removes any indentation a line might have.
  5751. The command is written at the beginning of a line and applies only to
  5752. the text that follows the command that is on the same line. Do not use
  5753. braces around the text. In a printed manual, the text on an
  5754. @code{@@exdent} line is printed in the roman font.
  5755. @code{@@exdent} is usually used within examples. Thus,
  5756. @example
  5757. @group
  5758. @@example
  5759. This line follows an @@@@example command.
  5760. @@exdent This line is exdented.
  5761. This line follows the exdented line.
  5762. The @@@@end example comes on the next line.
  5763. @@end example
  5764. @end group
  5765. @end example
  5766. @noindent
  5767. produces
  5768. @example
  5769. @group
  5770. This line follows an @@example command.
  5771. @exdent This line is exdented.
  5772. This line follows the exdented line.
  5773. The @@end example comes on the next line.
  5774. @end group
  5775. @end example
  5776. In practice, the @code{@@exdent} command is rarely used. Usually, you
  5777. un-indent text by ending the example and returning the page to its
  5778. normal width.
  5779. @code{@@exdent} has no effect in HTML output.
  5780. @node @code{@@flushleft @@flushright}
  5781. @section @code{@@flushleft} and @code{@@flushright}
  5782. @anchor{flushleft & flushright}@c old name
  5783. @findex flushleft
  5784. @findex flushright
  5785. @cindex Ragged right, without filling
  5786. @cindex Ragged left, without filling
  5787. The @code{@@flushleft} and @code{@@flushright} commands line up the
  5788. ends of lines on the left and right margins of a page,
  5789. but do not fill the text. The commands are written on lines of their
  5790. own, without braces. The @code{@@flushleft} and @code{@@flushright}
  5791. commands are ended by @code{@@end flushleft} and @code{@@end
  5792. flushright} commands on lines of their own.
  5793. @need 1500
  5794. For example,
  5795. @example
  5796. @group
  5797. @@flushleft
  5798. This text is
  5799. written flushleft.
  5800. @@end flushleft
  5801. @end group
  5802. @end example
  5803. @noindent
  5804. produces
  5805. @quotation
  5806. @flushleft
  5807. This text is
  5808. written flushleft.
  5809. @end flushleft
  5810. @end quotation
  5811. @code{@@flushright} produces the type of indentation often used in the
  5812. return address of letters. For example,
  5813. @example
  5814. @group
  5815. @@flushright
  5816. Here is an example of text written
  5817. flushright. The @@code@{@@flushright@} command
  5818. right justifies every line but leaves the
  5819. left end ragged.
  5820. @@end flushright
  5821. @end group
  5822. @end example
  5823. @noindent
  5824. produces
  5825. @flushright
  5826. Here is an example of text written
  5827. flushright. The @code{@@flushright} command
  5828. right justifies every line but leaves the
  5829. left end ragged.
  5830. @end flushright
  5831. @node @code{@@raggedright}
  5832. @section @code{@@raggedright}: Ragged Right Text
  5833. @anchor{raggedright}@c old name
  5834. @findex raggedright
  5835. @cindex Ragged right, with filling
  5836. The @code{@@raggedright} fills text as usual, but the text is only
  5837. justified on the left; the right margin is ragged. The command is
  5838. written on a line of its own, without braces. The
  5839. @code{@@raggedright} command is ended by @code{@@end raggedright} on a
  5840. line of its own. This command has no effect in Info and HTML output,
  5841. where text is always set ragged right.
  5842. The @code{@@raggedright} command can be useful with paragraphs
  5843. containing lists of commands with long names, when it is known in
  5844. advance that justifying the text on both margins will make the
  5845. paragraph look bad.
  5846. An example (from elsewhere in this manual):
  5847. @example
  5848. @group
  5849. @@raggedright
  5850. Commands for double and single angle quotation marks:
  5851. @@code@{@@@@guillemetleft@@@{@@@}@}, @@code@{@@@@guillemetright@@@{@@@}@},
  5852. @@code@{@@@@guillemotleft@@@{@@@}@}, @@code@{@@@@guillemotright@@@{@@@}@},
  5853. @@code@{@@@@guilsinglleft@@@{@@@}@}, @@code@{@@@@guilsinglright@@@{@@@}@}.
  5854. @@end raggedright
  5855. @end group
  5856. @end example
  5857. @noindent
  5858. produces
  5859. @raggedright
  5860. Commands for double and single angle quotation marks:
  5861. @code{@@guillemetleft@{@}}, @code{@@guillemetright@{@}},
  5862. @code{@@guillemotleft@{@}}, @code{@@guillemotright@{@}},
  5863. @code{@@guilsinglleft@{@}}, @code{@@guilsinglright@{@}}.
  5864. @end raggedright
  5865. @node @code{@@noindent}
  5866. @section @code{@@noindent}: Omitting Indentation
  5867. @anchor{noindent}@c old name
  5868. @findex noindent
  5869. @cindex Omitting indentation
  5870. @cindex Suppressing indentation
  5871. @cindex Indentation, omitting
  5872. An example or other inclusion can break a paragraph into segments.
  5873. Ordinarily, the formatters indent text that follows an example as a new
  5874. paragraph. You can prevent this on a case-by-case basis by writing
  5875. @code{@@noindent} at the beginning of a line, preceding the continuation
  5876. text. You can also disable indentation for all paragraphs globally with
  5877. @code{@@paragraphindent} (@pxref{@code{@@paragraphindent}}).
  5878. Here is an example showing how to eliminate the normal indentation of
  5879. the text after an @code{@@example}, a common situation:
  5880. @example
  5881. @group
  5882. @@example
  5883. This is an example
  5884. @@end example
  5885. @@noindent
  5886. This line is not indented. As you can see, the
  5887. beginning of the line is fully flush left with the
  5888. line that follows after it.
  5889. @end group
  5890. @end example
  5891. @noindent produces:
  5892. @display
  5893. @example
  5894. This is an example
  5895. @end example
  5896. @noindent
  5897. This line is not indented. As you can see, the
  5898. beginning of the line is fully flush left with the
  5899. line that follows after it.
  5900. @end display
  5901. The standard usage of @code{@@noindent} is just as above: at the
  5902. beginning of what would otherwise be a paragraph, to eliminate the
  5903. indentation that normally happens there. It can either be followed by
  5904. text or be on a line by itself. There is no reason to use it
  5905. in other contexts, such as in the middle of a paragraph or inside an
  5906. environment (@pxref{Quotations and Examples}).
  5907. You can control the number of blank lines in the Info file output by
  5908. adjusting the input as desired: a line containing just
  5909. @code{@@noindent} does not generate a blank line, and neither does an
  5910. @code{@@end} line for an environment.
  5911. Do not put braces after a @code{@@noindent} command; they are not
  5912. used, since @code{@@noindent} is a command used outside of paragraphs
  5913. (@pxref{Command Syntax}).
  5914. @node @code{@@indent}
  5915. @section @code{@@indent}: Forcing Indentation
  5916. @anchor{indent}@c old name
  5917. @findex indent
  5918. @cindex Forcing indentation
  5919. @cindex Inserting indentation
  5920. @cindex Indentation, forcing
  5921. @indent
  5922. To complement the @code{@@noindent} command (see the previous
  5923. section), Texinfo provides the @code{@@indent} command to force a
  5924. paragraph to be indented. For instance, this paragraph (the first in
  5925. this section) is indented using an @code{@@indent} command.
  5926. And indeed, the first paragraph of a section is the most likely place
  5927. to use @code{@@indent}, to override the normal behavior of no
  5928. indentation there (@pxref{@code{@@paragraphindent}}). It can either be
  5929. followed by text or be on a line by itself.
  5930. As a special case, when @code{@@indent} is used in an environment
  5931. where text is not filled, it produces a paragraph indentation space in
  5932. the @TeX{} output. (These environments are where a line of input
  5933. produces a line of output, such as @code{@@example} and
  5934. @code{@@display}; for a summary of all environments, @pxref{Block
  5935. Enclosing Commands}.)
  5936. Do not put braces after an @code{@@indent} command; they are not used,
  5937. since @code{@@indent} is a command used outside of paragraphs
  5938. (@pxref{Command Syntax}).
  5939. @node @code{@@cartouche}
  5940. @section @code{@@cartouche}: Rounded Rectangles
  5941. @anchor{cartouche}@c old name
  5942. @findex cartouche
  5943. @cindex Box with rounded corners
  5944. @cindex Rounded rectangles, around text
  5945. In a printed manual, the @code{@@cartouche} command draws a box with
  5946. rounded corners around its contents. In HTML, a normal rectangle is
  5947. drawn. @code{@@cartouche} has no effect in Info output.
  5948. You can use this command to further highlight an example or quotation.
  5949. For instance, you could write a manual in which one type of example is
  5950. surrounded by a cartouche for emphasis.
  5951. For example,
  5952. @example
  5953. @@cartouche
  5954. @@example
  5955. % pwd
  5956. /usr/local/share/emacs
  5957. @@end example
  5958. @@end cartouche
  5959. @end example
  5960. @noindent
  5961. surrounds the two-line example with a box with rounded corners, in the
  5962. printed manual.
  5963. The output from the example looks like this (if you're reading this in
  5964. Info, you'll see the @code{@@cartouche} had no effect):
  5965. @cartouche
  5966. @example
  5967. % pwd
  5968. /usr/local/share/emacs
  5969. @end example
  5970. @end cartouche
  5971. @code{@@cartouche} also implies @code{@@group} (@pxref{@code{@@group}}).
  5972. @node @code{@@small@dots{}}
  5973. @section @code{@@small@dots{}} Block Commands
  5974. @anchor{small}@c old name
  5975. @findex smallexample
  5976. @findex smallformat
  5977. @findex smalllisp
  5978. @findex smallquotation
  5979. @cindex Small examples
  5980. @cindex Examples in smaller fonts
  5981. @cindex Quotations in smaller fonts
  5982. @cindex Lisp examples in smaller fonts
  5983. In addition to the regular @code{@@example} and similar commands,
  5984. Texinfo has ``small'' example-style commands. These are
  5985. @code{@@smallquotation}, @code{@@smallindentedblock},
  5986. @code{@@smalldisplay}, @code{@@smallexample}, @code{@@smallformat},
  5987. and @code{@@smalllisp}.
  5988. In Info output, the @code{@@small@dots{}} commands are equivalent to
  5989. their non-small companion commands.
  5990. In @TeX{}, however, the @code{@@small@dots{}} commands typeset text in
  5991. a smaller font than the non-small example commands. Thus, for
  5992. instance, code examples can contain longer lines and still fit on a
  5993. page without needing to be rewritten.
  5994. A smaller font size is also requested in HTML output, and (as usual)
  5995. retained in the Texinfo@tie{}XML transliteration.
  5996. Mark the end of a @code{@@small@dots{}} block with a corresponding
  5997. @code{@@end small@dots{}}. For example, pair @code{@@smallexample} with
  5998. @code{@@end smallexample}.
  5999. Here is an example of the font used by the @code{@@smallexample}
  6000. command (in Info, the output will be the same as usual):
  6001. @smallexample
  6002. @dots{} to make sure that you have the freedom to
  6003. distribute copies of free software (and charge for
  6004. this service if you wish), that you receive source
  6005. code or can get it if you want it, that you can
  6006. change the software or use pieces of it in new free
  6007. programs; and that you know you can do these things.
  6008. @end smallexample
  6009. The @code{@@small@dots{}} commands use the same font style as their
  6010. normal counterparts: @code{@@smallexample} and @code{@@smalllisp} use
  6011. a fixed-width font, and everything else uses the regular font.
  6012. They also have the same behavior in other respects---whether filling
  6013. is done and whether margins are narrowed.
  6014. As a general rule, a printed document looks better if you use only one
  6015. of (for instance) @code{@@example} or @code{@@smallexample}
  6016. consistently within a chapter.
  6017. @node Lists and Tables
  6018. @chapter Lists and Tables
  6019. @cindex Making lists and tables
  6020. @cindex Lists and tables, making
  6021. @cindex Tables and lists, making
  6022. Texinfo has several ways of making lists and tables. Lists can be
  6023. bulleted or numbered; two-column tables can highlight the items in
  6024. the first column; multi-column tables are also supported.
  6025. @menu
  6026. * Introducing Lists:: Texinfo formats lists for you.
  6027. * @code{@@itemize}:: How to construct a simple list.
  6028. * @code{@@enumerate}:: How to construct a numbered list.
  6029. * Two-column Tables:: How to construct a two-column table.
  6030. * Multi-column Tables:: How to construct generalized tables.
  6031. @end menu
  6032. @node Introducing Lists
  6033. @section Introducing Lists
  6034. Texinfo automatically indents the text in lists or tables, and numbers
  6035. an enumerated list. This last feature is useful if you modify the
  6036. list, since you do not need to renumber it yourself.
  6037. Numbered lists and tables begin with the appropriate @@-command at the
  6038. beginning of a line, and end with the corresponding @code{@@end}
  6039. command on a line by itself. The table and itemized-list commands
  6040. also require that you write formatting information on the same line as
  6041. the beginning @@-command.
  6042. Begin an enumerated list, for example, with an @code{@@enumerate}
  6043. command and end the list with an @code{@@end enumerate} command.
  6044. Begin an itemized list with an @code{@@itemize} command, followed on
  6045. the same line by a formatting command such as @code{@@bullet}, and end
  6046. the list with an @code{@@end itemize} command.
  6047. @findex end
  6048. Precede each element of a list with an @code{@@item} or @code{@@itemx}
  6049. command.
  6050. @sp 1
  6051. @noindent
  6052. Here is an itemized list of the different kinds of table and lists:
  6053. @itemize @bullet
  6054. @item
  6055. Itemized lists with and without bullets.
  6056. @item
  6057. Enumerated lists, using numbers or letters.
  6058. @item
  6059. Two-column tables with highlighting.
  6060. @end itemize
  6061. @sp 1
  6062. @noindent
  6063. Here is an enumerated list with the same items:
  6064. @enumerate
  6065. @item
  6066. Itemized lists with and without bullets.
  6067. @item
  6068. Enumerated lists, using numbers or letters.
  6069. @item
  6070. Two-column tables with highlighting.
  6071. @end enumerate
  6072. @sp 1
  6073. @noindent
  6074. And here is a two-column table with the same items and their
  6075. @w{@@-commands}:
  6076. @table @code
  6077. @item @@itemize
  6078. Itemized lists with and without bullets.
  6079. @item @@enumerate
  6080. Enumerated lists, using numbers or letters.
  6081. @item @@table
  6082. @itemx @@ftable
  6083. @itemx @@vtable
  6084. Two-column tables, optionally with indexing.
  6085. @end table
  6086. @node @code{@@itemize}
  6087. @section @code{@@itemize}: Making an Itemized List
  6088. @anchor{itemize}@c old name
  6089. @findex itemize
  6090. @cindex Itemization
  6091. The @code{@@itemize} command produces a sequence of ``items'', each
  6092. starting with a bullet or other mark inside the left margin, and
  6093. generally indented.
  6094. @cindex @code{@@w}, for blank items
  6095. Begin an itemized list by writing @code{@@itemize} at the beginning of
  6096. a line. Follow the command, on the same line, with a character or a
  6097. Texinfo command that generates a mark. Usually, you will use
  6098. @code{@@bullet} after @code{@@itemize}, but you can use
  6099. @code{@@minus}, or any command or character that results in a single
  6100. character in the Info file. (When you write the mark command such as
  6101. @code{@@bullet} after an @code{@@itemize} command, you may omit the
  6102. @samp{@{@}}.) If you don't specify a mark command, the default is
  6103. @code{@@bullet}. If you don't want any mark at all, but still want
  6104. logical items, use @code{@@w@{@}} (in this case the braces are
  6105. required).
  6106. @findex item
  6107. After the @code{@@itemize}, write your items, each starting with
  6108. @code{@@item}. Text can follow on the same line as the @code{@@item}.
  6109. The text of an item can continue for more than one paragraph.
  6110. There should be at least one @code{@@item} inside the @code{@@itemize}
  6111. environment. If none are present, @code{makeinfo} gives a warning.
  6112. If you just want indented text and not a list of items, use
  6113. @code{@@indentedblock}; @pxref{@code{@@indentedblock}}.
  6114. Index entries and comments that are given before an @code{@@item}
  6115. including the first, are automatically moved (internally) to after the
  6116. @code{@@item}, so the output is as expected. Historically this has
  6117. been a common practice.
  6118. Usually, you should put a blank line between items. This puts a blank
  6119. line in the Info file. (@TeX{} inserts the proper vertical space in
  6120. any case.) Except when the entries are very brief, these blank lines
  6121. make the list look better.
  6122. Here is an example of the use of @code{@@itemize}, followed by the
  6123. output it produces. @code{@@bullet} produces an @samp{*} in Info and
  6124. a round dot in other output formats.
  6125. @example
  6126. @group
  6127. @@itemize @@bullet
  6128. @@item
  6129. Some text for foo.
  6130. @@item
  6131. Some text
  6132. for bar.
  6133. @@end itemize
  6134. @end group
  6135. @end example
  6136. @noindent
  6137. This produces:
  6138. @quotation
  6139. @itemize @bullet
  6140. @item
  6141. Some text for foo.
  6142. @item
  6143. Some text
  6144. for bar.
  6145. @end itemize
  6146. @end quotation
  6147. Itemized lists may be embedded within other itemized lists. Here is a
  6148. list marked with dashes embedded in a list marked with bullets:
  6149. @example
  6150. @group
  6151. @@itemize @@bullet
  6152. @@item
  6153. First item.
  6154. @@itemize @@minus
  6155. @@item
  6156. Inner item.
  6157. @@item
  6158. Second inner item.
  6159. @@end itemize
  6160. @@item
  6161. Second outer item.
  6162. @@end itemize
  6163. @end group
  6164. @end example
  6165. @noindent
  6166. This produces:
  6167. @quotation
  6168. @itemize @bullet
  6169. @item
  6170. First item.
  6171. @itemize @minus
  6172. @item
  6173. Inner item.
  6174. @item
  6175. Second inner item.
  6176. @end itemize
  6177. @item
  6178. Second outer item.
  6179. @end itemize
  6180. @end quotation
  6181. @node @code{@@enumerate}
  6182. @section @code{@@enumerate}: Making a Numbered or Lettered List
  6183. @anchor{enumerate}@c old name
  6184. @findex enumerate
  6185. @cindex Enumeration
  6186. @code{@@enumerate} is like @code{@@itemize} (@pxref{@code{@@itemize}}),
  6187. except that the labels on the items are successive integers or letters
  6188. instead of bullets.
  6189. Write the @code{@@enumerate} command at the beginning of a line. The
  6190. command does not require an argument, but accepts either a number or a
  6191. letter as an option. Without an argument, @code{@@enumerate} starts the
  6192. list with the number @samp{1}. With a numeric argument, such as
  6193. @samp{3}, the command starts the list with that number. With an upper-
  6194. or lowercase letter, such as @samp{a} or @samp{A}, the command starts
  6195. the list with that letter.
  6196. Write the text of the enumerated list in the same way as an itemized
  6197. list: write a line starting with @code{@@item} at the beginning of
  6198. each item in the enumeration. It is ok to have text following the
  6199. @code{@@item}, and the text for an item can continue for several
  6200. paragraphs.
  6201. You should put a blank line between entries in the list.
  6202. This generally makes it easier to read the Info file.
  6203. @need 1500
  6204. Here is an example of @code{@@enumerate} without an argument:
  6205. @example
  6206. @group
  6207. @@enumerate
  6208. @@item
  6209. Underlying causes.
  6210. @@item
  6211. Proximate causes.
  6212. @@end enumerate
  6213. @end group
  6214. @end example
  6215. @noindent
  6216. This produces:
  6217. @enumerate
  6218. @item
  6219. Underlying causes.
  6220. @item
  6221. Proximate causes.
  6222. @end enumerate
  6223. @sp 1
  6224. Here is an example with an argument of @kbd{3}:
  6225. @sp 1
  6226. @example
  6227. @group
  6228. @@enumerate 3
  6229. @@item
  6230. Predisposing causes.
  6231. @@item
  6232. Precipitating causes.
  6233. @@item
  6234. Perpetuating causes.
  6235. @@end enumerate
  6236. @end group
  6237. @end example
  6238. @noindent
  6239. This produces:
  6240. @enumerate 3
  6241. @item
  6242. Predisposing causes.
  6243. @item
  6244. Precipitating causes.
  6245. @item
  6246. Perpetuating causes.
  6247. @end enumerate
  6248. @sp 1
  6249. Here is a brief summary of the alternatives. The summary is constructed
  6250. using @code{@@enumerate} with an argument of @kbd{a}.
  6251. @sp 1
  6252. @enumerate a
  6253. @item
  6254. @code{@@enumerate}
  6255. Without an argument, produce a numbered list, with the first item
  6256. numbered@tie{}1.
  6257. @item
  6258. @code{@@enumerate @var{unsigned-integer}}
  6259. With an (unsigned) numeric argument, start a numbered list with that
  6260. number. You can use this to continue a list that you interrupted with
  6261. other text.
  6262. @item
  6263. @code{@@enumerate @var{upper-case-letter}}
  6264. With an uppercase letter as argument, start a list
  6265. in which each item is marked
  6266. by a letter, beginning with that uppercase letter.
  6267. @item
  6268. @code{@@enumerate @var{lower-case-letter}}
  6269. With a lowercase letter as argument, start a list
  6270. in which each item is marked by
  6271. a letter, beginning with that lowercase letter.
  6272. @end enumerate
  6273. You can also nest enumerated lists, as in an outline.
  6274. @node Two-column Tables
  6275. @section Making a Two-column Table
  6276. @cindex Tables, making two-column
  6277. @findex table
  6278. @code{@@table} is similar to @code{@@itemize}
  6279. (@pxref{@code{@@itemize}}), but allows you to specify a name or
  6280. heading line for each item. The @code{@@table} command is used to
  6281. produce two-column tables, and is especially useful for glossaries,
  6282. explanatory exhibits, and command-line option summaries.
  6283. @menu
  6284. * @code{@@table}:: How to construct a two-column table.
  6285. * @code{@@ftable @@vtable}:: Automatic indexing for two-column tables.
  6286. * @code{@@itemx}:: How to put more entries in the first column.
  6287. @end menu
  6288. @node @code{@@table}
  6289. @subsection Using the @code{@@table} Command
  6290. @anchor{table}@c old name
  6291. @cindex Definition lists, typesetting
  6292. Use the @code{@@table} command to produce a two-column table. This
  6293. command is typically used when you have a list of items and a brief text
  6294. with each one, such as a list of definitions.
  6295. Write the @code{@@table} command at the beginning of a line, after a
  6296. blank line, and follow it on the same line with an argument that is an
  6297. `indicating' command, such as @code{@@code}, @code{@@samp},
  6298. @code{@@var}, @code{@@option}, or @code{@@kbd} (@pxref{Indicating}).
  6299. This command will be applied to the text in the first column. For
  6300. example, @code{@@table @@code} will cause the text in the first column
  6301. to be output as if it had been the argument to a @code{@@code} command.
  6302. @anchor{@code{@@asis}}@c command name with @, for consistency
  6303. @findex asis
  6304. You may use the @code{@@asis} command as an argument to
  6305. @code{@@table}. @code{@@asis} is a command that does nothing: if you
  6306. use this command after @code{@@table}, the first column entries are
  6307. output without added highlighting (``as is'').
  6308. The @code{@@table} command works with other commands besides those
  6309. explicitly mentioned here. However, you can only use predefined
  6310. Texinfo commands that take an argument in braces. You cannot
  6311. reliably use a new command defined with @code{@@macro}, although an
  6312. @code{@@alias} (for a suitable predefined command) is acceptable.
  6313. @xref{Defining New Texinfo Commands}.
  6314. @findex item
  6315. Begin each table entry with an @code{@@item} command at the beginning
  6316. of a line. Write the text for the first column on the same line as the
  6317. @code{@@item} command. Write the text for the second column on the line
  6318. following the @code{@@item} line and on subsequent lines. You may
  6319. write as many lines of supporting text as you wish, even several
  6320. paragraphs. But only the text on the same line as the @code{@@item}
  6321. will be placed in the first column (including any footnotes).
  6322. You do not need to type anything for an empty second column.
  6323. Normally, you should put a blank line before an @code{@@item} line
  6324. (except the first one). This puts a blank line in the Info file.
  6325. Except when the entries are very brief, a blank line looks better.
  6326. End the table with a line consisting of @code{@@end table}, followed
  6327. by a blank line. @TeX{} will always start a new paragraph after the
  6328. table, so the blank line is needed for the Info output to be analogous.
  6329. @need 1500
  6330. For example, the following table highlights the text in the first
  6331. column with the @code{@@samp} command:
  6332. @example
  6333. @group
  6334. @@table @@samp
  6335. @@item foo
  6336. This is the text for
  6337. @@samp@{foo@}.
  6338. @@item bar
  6339. Text for @@samp@{bar@}.
  6340. @@end table
  6341. @end group
  6342. @end example
  6343. @noindent
  6344. This produces:
  6345. @table @samp
  6346. @item foo
  6347. This is the text for
  6348. @samp{foo}.
  6349. @item bar
  6350. Text for @samp{bar}.
  6351. @end table
  6352. If you want to list two or more named items with a single block of
  6353. text, use the @code{@@itemx} command. (@xref{@code{@@itemx}}.)
  6354. The @code{@@table} command (@pxref{@code{@@table}}) is not supported
  6355. inside @code{@@display}. Since @code{@@display} is line-oriented, it
  6356. doesn't make sense to use them together. If you want to indent a
  6357. table, try @code{@@quotation} (@pxref{@code{@@quotation}}) or
  6358. @code{@@indentedblock} (@pxref{@code{@@indentedblock}}).
  6359. @node @code{@@ftable @@vtable}
  6360. @subsection @code{@@ftable} and @code{@@vtable}
  6361. @anchor{ftable vtable}@c old name
  6362. @findex ftable
  6363. @findex vtable
  6364. @cindex Tables with indexing
  6365. @cindex Indexing table entries automatically
  6366. The @code{@@ftable} and @code{@@vtable} commands are the same as the
  6367. @code{@@table} command except that @code{@@ftable} automatically enters
  6368. each of the items in the first column of the table into the index of
  6369. functions and @code{@@vtable} automatically enters each of the items in
  6370. the first column of the table into the index of variables. This
  6371. simplifies the task of creating indices. Only the items on the same
  6372. line as the @code{@@item} or @code{@@itemx} commands are indexed, and
  6373. they are indexed in exactly the form that they appear on that line.
  6374. @xref{Indices}, for more information about indices.
  6375. Begin a two-column table using @code{@@ftable} or @code{@@vtable} by
  6376. writing the @@-command at the beginning of a line, followed on the same
  6377. line by an argument that is a Texinfo command such as @code{@@code},
  6378. exactly as you would for a @code{@@table} command; and end the table
  6379. with an @code{@@end ftable} or @code{@@end vtable} command on a line by
  6380. itself.
  6381. See the example for @code{@@table} in the previous section.
  6382. @node @code{@@itemx}
  6383. @subsection @code{@@itemx}: Second and Subsequent Items
  6384. @anchor{itemx}@c old name
  6385. @cindex Two named items for @code{@@table}
  6386. @findex itemx
  6387. Use the @code{@@itemx} command inside a table when you have two or more
  6388. first column entries for the same item, each of which should appear on a
  6389. line of its own.
  6390. Use @code{@@item} for the first entry, and @code{@@itemx} for all
  6391. subsequent entries; @code{@@itemx} must always follow an @code{@@item}
  6392. command, with no blank line intervening.
  6393. The @code{@@itemx} command works exactly like @code{@@item} except
  6394. that it does not generate extra vertical space above the first column
  6395. text. If you have multiple consecutive @code{@@itemx} commands, do
  6396. not insert any blank lines between them.
  6397. For example,
  6398. @example
  6399. @group
  6400. @@table @@code
  6401. @@item upcase
  6402. @@itemx downcase
  6403. These two functions accept a character or a string as
  6404. argument, and return the corresponding uppercase (lowercase)
  6405. character or string.
  6406. @@end table
  6407. @end group
  6408. @end example
  6409. @noindent
  6410. This produces:
  6411. @table @code
  6412. @item upcase
  6413. @itemx downcase
  6414. These two functions accept a character or a string as
  6415. argument, and return the corresponding uppercase (lowercase)
  6416. character or string.
  6417. @end table
  6418. @noindent
  6419. (Note also that this example illustrates multi-line supporting text in
  6420. a two-column table.)
  6421. @node Multi-column Tables
  6422. @section @code{@@multitable}: Multi-column Tables
  6423. @findex multitable
  6424. @cindex Tables, making multi-column
  6425. @code{@@multitable} allows you to construct tables with any number of
  6426. columns, with each column having any width you like.
  6427. You define the column widths on the @code{@@multitable} line itself, and
  6428. write each row of the actual table following an @code{@@item} command,
  6429. with columns separated by a @code{@@tab} command. Finally, @code{@@end
  6430. multitable} completes the table. Details in the sections below.
  6431. @menu
  6432. * Multitable Column Widths:: Defining multitable column widths.
  6433. * Multitable Rows:: Defining multitable rows, with examples.
  6434. @end menu
  6435. @node Multitable Column Widths
  6436. @subsection Multitable Column Widths
  6437. @cindex Multitable column widths
  6438. @cindex Column widths, defining for multitables
  6439. @cindex Widths, defining multitable column
  6440. You can define the column widths for a multitable in two ways: as
  6441. fractions of the line length; or with a prototype row. Mixing the two
  6442. methods is not supported. In either case, the widths are defined
  6443. entirely on the same line as the @code{@@multitable} command.
  6444. @enumerate
  6445. @item
  6446. @findex columnfractions
  6447. @cindex Line length, column widths as fraction of
  6448. To specify column widths as fractions of the line length, write
  6449. @code{@@columnfractions} and the decimal numbers (presumably less than
  6450. 1; a leading zero is allowed and ignored) after the
  6451. @code{@@multitable} command, as in:
  6452. @example
  6453. @@multitable @@columnfractions .33 .33 .33
  6454. @end example
  6455. The fractions need not add up exactly to 1.0, as these do not. This
  6456. allows you to produce tables that do not need the full line length.
  6457. @item
  6458. @cindex Prototype row, column widths defined by
  6459. To specify a prototype row, write the longest entry for each column
  6460. enclosed in braces after the @code{@@multitable} command. For example:
  6461. @example
  6462. @@multitable @{some text for column one@} @{for column two@}
  6463. @end example
  6464. @noindent
  6465. The first column will then have the width of the typeset `some text for
  6466. column one', and the second column the width of `for column two'.
  6467. The prototype entries need not appear in the table itself.
  6468. Although we used simple text in this example, the prototype entries can
  6469. contain Texinfo commands; markup commands such as @code{@@code} are
  6470. particularly likely to be useful.
  6471. @end enumerate
  6472. @node Multitable Rows
  6473. @subsection Multitable Rows
  6474. @cindex Multitable rows
  6475. @cindex Rows, of a multitable
  6476. @findex item
  6477. @findex tab
  6478. After the @code{@@multitable} command defining the column widths (see
  6479. the previous section), you begin each row in the body of a multitable
  6480. with @code{@@item}, and separate the column entries with @code{@@tab}.
  6481. Line breaks are not special within the table body, and you may break
  6482. input lines in your source file as necessary.
  6483. @findex headitem
  6484. @cindex Heading row, in table
  6485. @cindex @code{<thead>} HTML/XML tag
  6486. You can also use @code{@@headitem} instead of @code{@@item} to produce
  6487. a @dfn{heading row}. The @TeX{} output for such a row is in bold, and
  6488. the HTML and Docbook output uses the @code{<thead>} tag. In Info, the
  6489. heading row is followed by a separator line made of dashes (@samp{-}
  6490. characters).
  6491. @findex headitemfont
  6492. @cindex Font for multitable heading rows
  6493. The command @code{@@headitemfont} can be used in templates when the
  6494. entries in a @code{@@headitem} row need to be used in a template. It
  6495. is a synonym for @code{@@b}, but using @code{@@headitemfont} avoids
  6496. any dependency on that particular font style, in case we provide a way
  6497. to change it in the future.
  6498. Here is a complete example of a multi-column table (the text is from
  6499. @cite{The GNU Emacs Manual}, @pxref{Split Window,, Splitting Windows,
  6500. emacs, The GNU Emacs Manual}):
  6501. @example
  6502. @@multitable @@columnfractions .15 .45 .4
  6503. @@headitem Key @@tab Command @@tab Description
  6504. @@item C-x 2
  6505. @@tab @@code@{split-window-vertically@}
  6506. @@tab Split the selected window into two windows,
  6507. with one above the other.
  6508. @@item C-x 3
  6509. @@tab @@code@{split-window-horizontally@}
  6510. @@tab Split the selected window into two windows
  6511. positioned side by side.
  6512. @@item C-Mouse-2
  6513. @@tab
  6514. @@tab In the mode line or scroll bar of a window,
  6515. split that window.
  6516. @@end multitable
  6517. @end example
  6518. @noindent produces:
  6519. @multitable @columnfractions .15 .45 .4
  6520. @headitem Key @tab Command @tab Description
  6521. @item C-x 2
  6522. @tab @code{split-window-vertically}
  6523. @tab Split the selected window into two windows,
  6524. with one above the other.
  6525. @item C-x 3
  6526. @tab @code{split-window-horizontally}
  6527. @tab Split the selected window into two windows
  6528. positioned side by side.
  6529. @item C-Mouse-2
  6530. @tab
  6531. @tab In the mode line or scroll bar of a window,
  6532. split that window.
  6533. @end multitable
  6534. @node Special Displays
  6535. @chapter Special Displays
  6536. @cindex Special displays
  6537. The commands in this chapter allow you to write text that is specially
  6538. displayed (output format permitting), outside of the normal document
  6539. flow.
  6540. One set of such commands is for creating ``floats'', that is, figures,
  6541. tables, and the like, set off from the main text, possibly numbered,
  6542. captioned, and/or referred to from elsewhere in the document. Images
  6543. are often included in these displays.
  6544. Another group of commands is for creating footnotes in Texinfo.
  6545. @menu
  6546. * Floats:: Figures, tables, and the like.
  6547. * Images:: Including graphics and images.
  6548. * Footnotes:: Writing footnotes.
  6549. @end menu
  6550. @node Floats
  6551. @section Floats
  6552. @cindex Floats, in general
  6553. A @dfn{float} is a display which is set off from the main text. It is
  6554. typically labeled as being a ``Figure'', ``Table'', ``Example'', or
  6555. some similar type.
  6556. @cindex Floating, not yet implemented
  6557. A float is so-named because, in principle, it can be moved to the
  6558. bottom or top of the current page, or to a following page, in the
  6559. printed output. (Floating does not make sense in other output
  6560. formats.) In the present version of Texinfo, however, this floating
  6561. is unfortunately not yet implemented. Instead, the floating material
  6562. is simply output at the current location, more or less as if it were
  6563. an @code{@@group} (@pxref{@code{@@group}}).
  6564. @menu
  6565. * @code{@@float}:: Producing floating material.
  6566. * @code{@@caption @@shortcaption}:: Specifying descriptions for floats.
  6567. * @code{@@listoffloats}:: A table of contents for floats.
  6568. @end menu
  6569. @node @code{@@float}
  6570. @subsection @code{@@float} [@var{type}][,@var{label}]: Floating Material
  6571. @anchor{float}@c old name
  6572. @findex float
  6573. @cindex Float environment
  6574. To produce floating material, enclose the material you want to be
  6575. displayed separate between @code{@@float} and @code{@@end float}
  6576. commands, on lines by themselves.
  6577. Floating material often uses @code{@@image} to display an
  6578. already-existing graphic (@pxref{Images}), or @code{@@multitable} to
  6579. display a table (@pxref{Multi-column Tables}). However, the contents
  6580. of the float can be anything. Here's an example with simple text:
  6581. @example
  6582. @@float Figure,fig:ex1
  6583. This is an example float.
  6584. @@end float
  6585. @end example
  6586. @noindent And the output:
  6587. @float Figure,fig:ex1
  6588. This is an example float.
  6589. @end float
  6590. As shown in the example, @code{@@float} takes two arguments (separated
  6591. by a comma), @var{type} and @var{label}. Both are optional.
  6592. @table @var
  6593. @item type
  6594. Specifies the sort of float this is; typically a word such as
  6595. ``Figure'', ``Table'', etc. If this is not given, and @var{label} is,
  6596. any cross-referencing will simply use a bare number.
  6597. @item label
  6598. Specifies a cross-reference label for this float. If given, this
  6599. float is automatically given a number, and will appear in any
  6600. @code{@@listoffloats} output (@pxref{@code{@@listoffloats}}). Cross
  6601. references to @var{label} are allowed.
  6602. @cindex Floats, making unnumbered
  6603. @cindex Unnumbered float, creating
  6604. On the other hand, if @var{label} is not given, then the float will
  6605. not be numbered and consequently will not appear in the
  6606. @code{@@listoffloats} output or be cross-referenceable.
  6607. @end table
  6608. @noindent Ordinarily, you specify both @var{type} and @var{label}, to get a
  6609. labeled and numbered float.
  6610. @cindex Floats, numbering of
  6611. @cindex Numbering of floats
  6612. In Texinfo, all floats are numbered in the same way: with the chapter
  6613. number (or appendix letter), a period, and the float number, which
  6614. simply counts 1, 2, 3, @dots{}, and is reset at each chapter. Each
  6615. float type is counted independently.
  6616. Floats within an @code{@@unnumbered}, or outside of any chapter, are
  6617. simply numbered consecutively from 1.
  6618. These numbering conventions are not, at present, changeable.
  6619. @node @code{@@caption @@shortcaption}
  6620. @subsection @code{@@caption} & @code{@@shortcaption}
  6621. @anchor{caption shortcaption}@c old name
  6622. @findex caption
  6623. @findex shortcaption
  6624. @cindex Captions, for floats
  6625. @cindex Short captions, for lists of floats
  6626. You may write a @code{@@caption} anywhere within a @code{@@float}
  6627. environment, to define a caption for the float. It is not allowed in
  6628. any other context. @code{@@caption} takes a single argument, enclosed
  6629. in braces. Here's an example:
  6630. @example
  6631. @@float
  6632. An example float, with caption.
  6633. @@caption@{Caption for example float.@}
  6634. @@end float
  6635. @end example
  6636. @noindent The output is:
  6637. @float
  6638. An example float, with caption.
  6639. @caption{Caption for example float.}
  6640. @end float
  6641. @code{@@caption} can appear anywhere within the float; it is not
  6642. processed until the @code{@@end float}. The caption text is usually a
  6643. sentence or two, but may consist of several paragraphs if necessary.
  6644. In the output, the caption always appears below the float; this is not
  6645. currently changeable. It is preceded by the float type and/or number,
  6646. as specified to the @code{@@float} command (see the previous section).
  6647. The @code{@@shortcaption} command likewise may be used only within
  6648. @code{@@float}, and takes a single argument in braces. The short
  6649. caption text is used instead of the caption text in a list of floats
  6650. (see the next section). Thus, you can write a long caption for the
  6651. main document, and a short title to appear in the list of floats. For
  6652. example:
  6653. @example
  6654. @@float
  6655. ... as above ...
  6656. @@shortcaption@{Text for list of floats.@}
  6657. @@end float
  6658. @end example
  6659. The text for @code{@@shortcaption} may not contain comments
  6660. (@code{@@c}), verbatim text (@code{@@verb}), environments such as
  6661. @code{@@example}, footnotes (@code{@@footnote}) or other complex
  6662. constructs. The same constraints apply to @code{@@caption} unless
  6663. there is a @code{@@shortcaption}.
  6664. @node @code{@@listoffloats}
  6665. @subsection @code{@@listoffloats}: Tables of Contents for Floats
  6666. @anchor{listoffloats}@c old name
  6667. @findex listoffloats
  6668. @cindex List of floats
  6669. @cindex Floats, list of
  6670. @cindex Table of contents, for floats
  6671. You can write a @code{@@listoffloats} command to generate a list of
  6672. floats for a given float type (@pxref{@code{@@float}}), analogous to
  6673. the document's overall table of contents. Typically, it is written in
  6674. its own @code{@@unnumbered} node to provide a heading and structure,
  6675. rather like @code{@@printindex} (@pxref{Printing Indices & Menus}).
  6676. @code{@@listoffloats} takes one optional argument, the float type.
  6677. Here's an example:
  6678. @example
  6679. @@node List of Figures
  6680. @@unnumbered List of Figures
  6681. @@listoffloats Figure
  6682. @end example
  6683. @noindent And here's what the output from @code{@@listoffloats}
  6684. looks like, given the example figure earlier in this chapter (the Info
  6685. output is formatted as a menu):
  6686. @display
  6687. @ifinfo
  6688. * Figure 12.1: fig:ex1.
  6689. @end ifinfo
  6690. @ifnotinfo
  6691. @listoffloats Figure
  6692. @end ifnotinfo
  6693. @end display
  6694. Without any argument, @code{@@listoffloats} generates a list of floats
  6695. for which no float type was specified, i.e., no first argument to the
  6696. @code{@@float} command (@pxref{@code{@@float}}).
  6697. Each line in the list of floats contains the float type (if any),
  6698. the float number, and the caption, if any---the @code{@@shortcaption}
  6699. argument, if it was specified, else the @code{@@caption} argument.
  6700. In Info, the result is a menu where each float can be selected. In
  6701. HTML, each line is a link to the float. In printed output, the page
  6702. number is included.
  6703. Unnumbered floats (those without cross-reference labels) are omitted
  6704. from the list of floats.
  6705. @node Images
  6706. @section Inserting Images
  6707. @cindex Images, inserting
  6708. @cindex Pictures, inserting
  6709. @findex image
  6710. You can insert an image given in an external file with the
  6711. @code{@@image} command. Although images can be used anywhere,
  6712. including the middle of a paragraph, we describe them in this chapter
  6713. since they are most often part of a displayed figure or example.
  6714. @menu
  6715. * Image Syntax::
  6716. * Image Scaling::
  6717. @end menu
  6718. @node Image Syntax
  6719. @subsection Image Syntax
  6720. Here is the synopsis of the @code{@@image} command:
  6721. @example
  6722. @@image@{@var{filename}@r{[,} @var{width}@r{[,} @var{height}@r{[,} @var{alttext}@r{[, }@var{extension}@r{]]]]}@}
  6723. @end example
  6724. @cindex Formats for images
  6725. @cindex Image formats
  6726. The @var{filename} argument is mandatory, and must not have an
  6727. extension, because the different processors support different formats:
  6728. @itemize @bullet
  6729. @item
  6730. @pindex eps image format
  6731. @TeX{} (DVI output) reads the file @file{@var{filename}.eps}
  6732. (Encapsulated PostScript format).
  6733. @item
  6734. @pindex pdftex@r{, and images}
  6735. @pindex png image format
  6736. @pindex jpeg image format
  6737. @pindex pdf image inclusions
  6738. pdf@TeX{} reads @file{@var{filename}.pdf}, @file{@var{filename}.png},
  6739. @file{@var{filename}.jpg}, or @file{@var{filename}.jpeg} (in that
  6740. order). It also tries uppercase versions of the extensions. The PDF
  6741. format does not support EPS images, so such must be converted first.
  6742. @item
  6743. For Info, @code{makeinfo} includes @file{@var{filename}.txt} verbatim
  6744. (more or less as if it were in @code{@@verbatim}). The Info output
  6745. may also include a reference to @file{@var{filename}.png} or
  6746. @file{@var{filename}.jpg}. (See below.)
  6747. @item
  6748. For HTML, @code{makeinfo} outputs a reference to
  6749. @file{@var{filename}.png}, @file{@var{filename}.jpg},
  6750. @file{@var{filename}.jpeg} or @file{@var{filename}.gif} (in that
  6751. order). If none of those exist, it gives an error, and outputs a
  6752. reference to @file{@var{filename}.jpg} anyway.
  6753. @item
  6754. @cindex SVG images, used in Docbook
  6755. For Docbook, @code{makeinfo} outputs references to
  6756. @file{@var{filename}.eps}, @file{@var{filename}.gif}
  6757. @file{@var{filename}.jpeg}, @file{@var{filename}.jpg},
  6758. @file{@var{filename}.pdf}, @file{@var{filename}.png} and
  6759. @file{@var{filename}.svg}, for every file found. Also,
  6760. @file{@var{filename}.txt} is included verbatim, if present. (The
  6761. subsequent Docbook processor is supposed to choose the appropriate one.)
  6762. @item
  6763. For Info and HTML output, @code{makeinfo} uses the optional fifth
  6764. argument @var{extension} to @code{@@image} for the filename extension,
  6765. if it is specified and the file is found. Any leading period should
  6766. be included in @var{extension}. For example:
  6767. @pindex XPM image format
  6768. @example
  6769. @@image@{foo,,,,.xpm@}
  6770. @end example
  6771. @end itemize
  6772. If you want to install image files for use by Info readers too, we
  6773. recommend putting them in a subdirectory like @samp{@var{foo}-figures}
  6774. for a package @var{foo}. Copying the files into
  6775. @code{$(infodir)/@var{foo}-figures/} should be done in your
  6776. @code{Makefile}.
  6777. The @var{width} and @var{height} arguments are described in the next
  6778. section.
  6779. For @TeX{} output, if an image is the only thing in a paragraph it
  6780. will ordinarily be displayed on a line by itself, respecting the
  6781. current environment indentation, but without the normal paragraph
  6782. indentation. If you want it centered, use @code{@@center}
  6783. (@pxref{@code{@@titlefont @@center @@sp}}).
  6784. @cindex Alt attribute for images
  6785. @cindex Images, alternate text for
  6786. @findex @sortas{-} -@r{ (in image alt string)}
  6787. For HTML output, @code{makeinfo} sets the @dfn{alt attribute} for
  6788. inline images to the optional @var{alttext} (fourth) argument to
  6789. @code{@@image}, if supplied. If not supplied, @code{makeinfo} uses
  6790. the full file name of the image being displayed. The @var{alttext} is
  6791. processed as Texinfo text, so special characters such as @samp{"} and
  6792. @samp{<} and @samp{&} are escaped in the HTML output; also, you can
  6793. get an empty @code{alt} string with @code{@@-} (a command that
  6794. produces no output; @pxref{@code{@@- @@hyphenation}}).
  6795. For Info output, the @code{alt} string is also processed as Texinfo
  6796. text and output. In this case, @samp{\} is escaped as @samp{\\} and
  6797. @samp{"} as @samp{\"}; no other escapes are done.
  6798. In Info output, @code{makeinfo} writes a reference to the binary image
  6799. file (trying @var{filename} suffixed with @file{@var{extension}},
  6800. @file{@var{.extension}}, @file{.png}, or @file{.jpg}, in that order)
  6801. if one exists. It also literally includes the @file{.txt} file if one
  6802. exists. This way, Info readers which can display images (such as the
  6803. Emacs Info browser, running under X) can do so, whereas Info readers
  6804. which can only use text (such as the standalone Info reader) can
  6805. display the textual version.
  6806. @cindex @samp{^@@^H} for images in Info
  6807. The implementation of this is to put the following construct into the
  6808. Info output:
  6809. @example
  6810. ^@@^H[image src="@var{binaryfile}" text="@var{txtfile}"
  6811. alt="@var{alttext} ... ^@@^H]
  6812. @end example
  6813. @noindent where @samp{^@@} and @samp{^H} stand for the actual null and
  6814. backspace control characters. If one of the files is not present, the
  6815. corresponding argument is omitted.
  6816. The reason for mentioning this here is that older Info browsers (this
  6817. feature was introduced in Texinfo version 4.6) will display the above
  6818. literally, which, although not pretty, should not be harmful.
  6819. @node Image Scaling
  6820. @subsection Image Scaling
  6821. @cindex Images, scaling
  6822. @cindex Scaling images
  6823. @cindex Width of images
  6824. @cindex Height of images
  6825. @cindex Aspect ratio of images
  6826. @cindex Distorting images
  6827. The optional @var{width} and @var{height} arguments to the
  6828. @code{@@image} command (see the previous section) specify the size to
  6829. which to scale the image. They are only taken into account in @TeX{}.
  6830. If neither is specified, the image is presented in its natural size
  6831. (given in the file); if only one is specified, the other is scaled
  6832. proportionately; and if both are specified, both are respected, thus
  6833. likely distorting the original image by changing its aspect ratio.
  6834. @cindex Dimensions and image sizes
  6835. The @var{width} and @var{height} may be specified using any valid @TeX{}
  6836. dimension, namely:
  6837. @table @asis
  6838. @item pt
  6839. @cindex Points (dimension)
  6840. point (72.27pt = 1in)
  6841. @item pc
  6842. @cindex Picas
  6843. pica (1pc = 12pt)
  6844. @item bp
  6845. @cindex Big points
  6846. big point (72bp = 1in)
  6847. @item in
  6848. @cindex Inches
  6849. inch
  6850. @item cm
  6851. @cindex Centimeters
  6852. centimeter (2.54cm = 1in)
  6853. @item mm
  6854. @cindex Millimeters
  6855. millimeter (10mm = 1cm)
  6856. @item dd
  6857. @cindex Did@^ot points
  6858. did@^ot point (1157dd = 1238pt)
  6859. @item cc
  6860. @cindex Ciceros
  6861. cicero (1cc = 12dd)
  6862. @item sp
  6863. @cindex Scaled points
  6864. scaled point (65536sp = 1pt)
  6865. @end table
  6866. @pindex ridt.eps
  6867. For example, the following will scale a file @file{ridt.eps} to one
  6868. inch vertically, with the width scaled proportionately:
  6869. @example
  6870. @@image@{ridt,,1in@}
  6871. @end example
  6872. @pindex epsf.tex
  6873. For @code{@@image} to work with @TeX{}, the file @file{epsf.tex} must be
  6874. installed somewhere that @TeX{} can find it. (The standard location is
  6875. @file{@var{texmf}/tex/generic/dvips/epsf.tex}, where @var{texmf} is a
  6876. root of your @TeX{} directory tree.) This file is included in the
  6877. Texinfo distribution and is also available from
  6878. @uref{ftp://tug.org/tex/epsf.tex}, among other places.
  6879. @code{@@image} can be used within a line as well as for displayed
  6880. figures. Therefore, if you intend it to be displayed, be sure to leave
  6881. a blank line before the command, or the output will run into the
  6882. preceding text.
  6883. Image scaling is presently implemented only in @TeX{}, not in HTML or
  6884. any other sort of output.
  6885. @node Footnotes
  6886. @section Footnotes
  6887. @cindex Footnotes
  6888. @findex footnote
  6889. A @dfn{footnote} is for a reference that documents or elucidates the
  6890. primary text.@footnote{A footnote should complement or expand upon the
  6891. primary text, but a reader should not need to read a footnote to
  6892. understand the primary text. For a thorough discussion of footnotes,
  6893. see @cite{The Chicago Manual of Style}, which is published by the
  6894. University of Chicago Press.}
  6895. Footnotes are distracting; use them sparingly at most, and it is best
  6896. to avoid them completely. Standard bibliographical references are
  6897. usually better placed in a bibliography at the end of a document
  6898. instead of in footnotes throughout.
  6899. @menu
  6900. * Footnote Commands:: How to write a footnote in Texinfo.
  6901. * Footnote Styles:: Controlling how footnotes appear in Info.
  6902. @end menu
  6903. @node Footnote Commands
  6904. @subsection Footnote Commands
  6905. In Texinfo, footnotes are created with the @code{@@footnote} command.
  6906. This command is followed immediately by a left brace, then by the text
  6907. of the footnote, and then by a terminating right brace. Footnotes may
  6908. be of any length (they will be broken across pages if necessary), but
  6909. are usually short. The template is:
  6910. @example
  6911. ordinary text@@footnote@{@var{text of footnote}@}
  6912. @end example
  6913. As shown here, the @code{@@footnote} command should come right after the
  6914. text being footnoted, with no intervening space; otherwise, the footnote
  6915. marker might end up starting a line.
  6916. For example, this clause is followed by a sample footnote@footnote{Here
  6917. is the sample footnote.}; in the Texinfo source, it looks like
  6918. this:
  6919. @example
  6920. @dots{}a sample footnote@@footnote@{Here is the sample
  6921. footnote.@}; in the Texinfo source@dots{}
  6922. @end example
  6923. As you can see, this source includes two punctuation marks next to
  6924. each other; in this case, @samp{.@};} is the sequence. This is normal
  6925. (the first ends the footnote and the second belongs to the sentence
  6926. being footnoted), so don't worry that it looks odd. (Another style,
  6927. perfectly acceptable, is to put the footnote after punctuation
  6928. belonging to the sentence, as in @samp{;@@footnote@{...}.)
  6929. In a printed manual or book, the reference mark for a footnote is a
  6930. small, superscripted number; the text of the footnote appears at the
  6931. bottom of the page, below a horizontal line.
  6932. In Info, the reference mark for a footnote is a pair of parentheses
  6933. with the footnote number between them, like this: @samp{(1)}. The
  6934. reference mark is followed by a cross-reference link to the footnote
  6935. text if footnotes are put in separate nodes (@pxref{Footnote Styles}).
  6936. In the HTML output, footnote references are generally marked with a
  6937. small, superscripted number which is rendered as a hypertext link to
  6938. the footnote text.
  6939. @cindex Critical editions
  6940. @cindex Nested footnotes
  6941. Footnotes cannot be nested, and cannot appear in section headings of
  6942. any kind or other ``unusual'' places.
  6943. A final tip: footnotes in the argument of an @code{@@item} command for
  6944. an @code{@@table} must be entirely on the same line as the
  6945. @code{@@item} (as usual). @xref{Two-column Tables}.
  6946. @node Footnote Styles
  6947. @subsection Footnote Styles
  6948. Info has two footnote styles, which determine where the text of the
  6949. footnote is located:
  6950. @itemize @bullet
  6951. @cindex @samp{@r{End}} node footnote style
  6952. @item
  6953. In the `End' node style, all the footnotes for a single node are
  6954. placed at the end of that node. The footnotes are separated from the
  6955. rest of the node by a line of dashes with the word @samp{Footnotes}
  6956. within it. Each footnote begins with an @samp{(@var{n})} reference
  6957. mark.
  6958. @need 700
  6959. @noindent
  6960. Here is an example of the Info output for a single footnote in the
  6961. end-of-node style:
  6962. @example
  6963. @group
  6964. --------- Footnotes ---------
  6965. (1) Here is a sample footnote.
  6966. @end group
  6967. @end example
  6968. @cindex @samp{@r{Separate}} footnote style
  6969. @item
  6970. In the `Separate' node style, all the footnotes for a single
  6971. node are placed in an automatically constructed node of
  6972. their own. In this style, a ``footnote reference'' follows
  6973. each @samp{(@var{n})} reference mark in the body of the
  6974. node. The footnote reference is actually a cross-reference
  6975. which you use to reach the footnote node.
  6976. The name of the node with the footnotes is constructed
  6977. by appending @w{@samp{-Footnotes}} to the name of the node
  6978. that contains the footnotes. (Consequently, the footnotes'
  6979. node for the @file{Footnotes} node is
  6980. @w{@file{Footnotes-Footnotes}}!) The footnotes' node has an
  6981. `Up' node pointer that leads back to its parent node.
  6982. @noindent
  6983. Here is how the first footnote in this manual looks after being
  6984. formatted for Info in the separate node style:
  6985. @smallexample
  6986. @group
  6987. File: texinfo.info Node: Overview-Footnotes, Up: Overview
  6988. (1) The first syllable of "Texinfo" is pronounced like "speck", not
  6989. "hex". @dots{}
  6990. @end group
  6991. @end smallexample
  6992. @end itemize
  6993. Unless your document has long and important footnotes (as in, say,
  6994. Gibbon's @cite{Decline and Fall @dots{}}), we recommend the @samp{end}
  6995. style, as it is simpler for readers to follow.
  6996. @findex footnotestyle
  6997. Use the @code{@@footnotestyle} command to specify an Info file's
  6998. footnote style. Write this command at the beginning of a line followed
  6999. by an argument, either @samp{end} for the end node style or
  7000. @samp{separate} for the separate node style.
  7001. @need 700
  7002. For example,
  7003. @example
  7004. @@footnotestyle end
  7005. @end example
  7006. @noindent
  7007. or
  7008. @example
  7009. @@footnotestyle separate
  7010. @end example
  7011. Write a @code{@@footnotestyle} command before or shortly after the
  7012. end-of-header line at the beginning of a Texinfo file. (You should
  7013. include any @code{@@footnotestyle} command between the start-of-header
  7014. and end-of-header lines, so the region formatting commands will format
  7015. footnotes as specified.)
  7016. In HTML, when the footnote style is @samp{end}, or if the output is
  7017. not split, footnotes are put at the end of the output. If set to
  7018. @samp{separate}, and the output is split, they are placed in a
  7019. separate file.
  7020. @node Indices
  7021. @chapter Indices
  7022. @cindex Indices
  7023. Using Texinfo, you can generate indices without having to sort and
  7024. collate entries manually. In an index, the entries are listed in
  7025. alphabetical order, together with information on how to find the
  7026. discussion of each entry. In a printed manual, this information
  7027. consists of page numbers. In an Info file, this information is a menu
  7028. entry leading to the first node referenced.
  7029. Texinfo provides several predefined kinds of index: an index for
  7030. functions, an index for variables, an index for concepts, and so on.
  7031. You can combine indices or use them for other than their canonical
  7032. purpose. Lastly, you can define your own new indices.
  7033. @menu
  7034. * Predefined Indices:: Use different indices for different kinds
  7035. of entries.
  7036. * Indexing Commands:: How to make an index entry.
  7037. * Index Entries:: Choose different words for index entries.
  7038. * Printing Indices & Menus:: How to print an index in hardcopy and
  7039. generate index menus in Info.
  7040. * Combining Indices:: How to combine indices.
  7041. * New Indices:: How to define your own indices.
  7042. @end menu
  7043. @node Predefined Indices
  7044. @section Predefined Indices
  7045. Texinfo provides six predefined indices. Here are their nominal
  7046. meanings, abbreviations, and the corresponding index entry commands:
  7047. @table @samp
  7048. @item cp
  7049. @cindex @code{cp} (concept) index
  7050. @findex cindex
  7051. (@code{@@cindex}) concept index, for general concepts.
  7052. @item fn
  7053. @cindex @code{fn} (function) index
  7054. @findex findex
  7055. (@code{@@findex}) function index, for function and function-like
  7056. names (such as entry points of libraries).
  7057. @item ky
  7058. @cindex @code{ky} (keystroke) index
  7059. @findex kindex
  7060. (@code{@@kindex}) keystroke index, for keyboard commands.
  7061. @item pg
  7062. @cindex @code{pg} (program) index
  7063. @findex pindex
  7064. (@code{@@pindex}) program index, for names of programs.
  7065. @item tp
  7066. @cindex @code{tp} (data type) index
  7067. @findex tindex
  7068. (@code{@@tindex}) data type index, for type names (such as structures
  7069. defined in header files).
  7070. @item vr
  7071. @cindex @code{vr} (variable) index
  7072. @findex vindex
  7073. (@code{@@vindex}) variable index, for variable names (such as global
  7074. variables of libraries).
  7075. @end table
  7076. @noindent
  7077. Not every manual needs all of these, and most manuals use only two or
  7078. three at most. The present manual, for example, has two indices: a
  7079. concept index and an @@-command index (that is actually the function
  7080. index but is called a command index in the chapter heading).
  7081. You are not required to use the predefined indices strictly for their
  7082. canonical purposes. For example, suppose you wish to index some C
  7083. preprocessor macros. You could put them in the function index along
  7084. with actual functions, just by writing @code{@@findex} commands for
  7085. them; then, when you print the ``Function Index'' as an unnumbered
  7086. chapter, you could give it the title `Function and Macro Index' and
  7087. all will be consistent for the reader.
  7088. On the other hand, it is best not to stray too far from the meaning of
  7089. the predefined indices. Otherwise, in the event that your text is
  7090. combined with other text from other manuals, the index entries will
  7091. not match up. Instead, define your own new index (@pxref{New
  7092. Indices}).
  7093. We recommend having a single index in the final document whenever
  7094. possible, however many source indices you use, since then readers have
  7095. only one place to look. Two or more source indices can be combined
  7096. into one output index using the @code{@@synindex} or
  7097. @code{@@syncodeindex} commands (@pxref{Combining Indices}).
  7098. @node Indexing Commands
  7099. @section Defining the Entries of an Index
  7100. @cindex Defining indexing entries
  7101. @cindex Index entries
  7102. @cindex Entries for an index
  7103. @cindex Specifying index entries
  7104. @cindex Creating index entries
  7105. The data to make an index come from many individual indexing commands
  7106. scattered throughout the Texinfo source file. Each command says to add
  7107. one entry to a particular index; after formatting, the index will give
  7108. the current page number or node name as the reference.
  7109. An index entry consists of an indexing command at the beginning of a
  7110. line followed, on the rest of the line, by the entry.
  7111. For example, this section begins with the following five entries for
  7112. the concept index:
  7113. @example
  7114. @@cindex Defining indexing entries
  7115. @@cindex Index entries, defining
  7116. @@cindex Entries for an index
  7117. @@cindex Specifying index entries
  7118. @@cindex Creating index entries
  7119. @end example
  7120. Each predefined index has its own indexing command---@code{@@cindex}
  7121. for the concept index, @code{@@findex} for the function index, and so
  7122. on, as listed in the previous section.
  7123. Index entries should precede the visible material that is being
  7124. indexed. For instance:
  7125. @example
  7126. @@cindex hello
  7127. Hello, there!
  7128. @end example
  7129. @noindent Among other reasons, that way following indexing links (in
  7130. whatever context) ends up before the material, where readers want to
  7131. be, instead of after.
  7132. @cindex Index font types
  7133. By default, entries for a concept index are printed in a small roman
  7134. font and entries for the other indices are printed in a small
  7135. @code{@@code} font. You may change the way part of an entry is
  7136. printed with the usual Texinfo commands, such as @code{@@file} for
  7137. file names (@pxref{Marking Text}), and @code{@@r} for the normal roman
  7138. font (@pxref{Fonts}).
  7139. @findex sortas
  7140. @cindex sort keys for index entries
  7141. @cindex index sorting
  7142. For the printed output, you may specify an explicit sort key for an
  7143. index entry using @code{@@sortas} immediately following the index
  7144. command. For example: @samp{@@findex @@sortas@{\@} \ @@r@{(literal
  7145. \ in @@code@{@@@@math@})} sorts the index entry this produces under
  7146. backslash.
  7147. @vindex txiindexbackslashignore
  7148. @vindex txiindexhyphenignore
  7149. @vindex txiindexlessthanignore
  7150. @vindex txiindexatsignignore
  7151. To reduce the quantity of sort keys you need to provide explicitly,
  7152. you may choose to ignore certain characters in index entries
  7153. for the purposes of sorting. The characters that you can
  7154. currently choose to ignore are @samp{\}, @samp{-}, @samp{<}
  7155. and @samp{@@}, which are ignored by giving as an argument to the
  7156. @code{@@set} command, respectively, @code{txiindexbackslashignore},
  7157. @code{txiindexhyphenignore}, @code{txiindexlessthanignore} and
  7158. @code{txiindexatsignignore}. For example, specifying @samp{@@set
  7159. txiindexbackslashignore} causes the @samp{\mathopsup} entry in the
  7160. index for this manual to be sorted as if it were @samp{mathopsup},
  7161. so that it appears among the other entries beginning `M'.
  7162. @quotation Caution
  7163. Do not use a colon in an index entry. In Info, a colon separates the
  7164. menu entry name from the node name, so a colon in the entry itself
  7165. confuses Info. @xref{Menu Parts}, for more information about the
  7166. structure of a menu entry.
  7167. @end quotation
  7168. @node Index Entries
  7169. @section Making Index Entries
  7170. @cindex Index entries, making
  7171. @cindex Entries, making index
  7172. @cindex Writing index entries
  7173. @cindex Index entries, advice on writing
  7174. @cindex Advice on writing entries
  7175. @cindex Capitalization of index entries
  7176. Concept index entries consist of text. The best way to write an index
  7177. is to devise entries which are terse yet clear. If you can do this,
  7178. the index usually looks better if the entries are written just as they
  7179. would appear in the middle of a sentence, that is, capitalizing only
  7180. proper names and acronyms that always call for uppercase letters.
  7181. This is the case convention we use in most GNU manuals' indices.
  7182. If you don't see how to make an entry terse yet clear, make it longer
  7183. and clear---not terse and confusing. If many of the entries are
  7184. several words long, the index may look better if you use a different
  7185. convention: to capitalize the first word of each entry. Whichever
  7186. case convention you use, use it consistently.
  7187. In any event, do not ever capitalize a case-sensitive name such as a C
  7188. or Lisp function name or a shell command; that would be a spelling
  7189. error. Entries in indices other than the concept index are symbol
  7190. names in programming languages, or program names; these names are
  7191. usually case-sensitive, so likewise use upper- and lowercase as
  7192. required.
  7193. @cindex Unique index entries
  7194. It is a good idea to make index entries unique wherever feasible.
  7195. That way, people using the printed output or online completion of
  7196. index entries don't see undifferentiated lists. Consider this an
  7197. opportunity to make otherwise-identical index entries be more
  7198. specific, so readers can more easily find the exact place they are
  7199. looking for.
  7200. When you are making index entries, it is good practice to think of the
  7201. different ways people may look for something. Different people
  7202. @emph{do not} think of the same words when they look something up. A
  7203. helpful index will have items indexed under all the different words
  7204. that people may use. For example, one reader may think it obvious
  7205. that the two-letter names for indices should be listed under
  7206. ``Indices, two-letter names, since ``Indices'' are the general
  7207. concept. But another reader may remember the specific concept of
  7208. two-letter names and search for the entry listed as ``Two letter names
  7209. for indices''. A good index will have both entries and will help both
  7210. readers.
  7211. Like typesetting, the construction of an index is a skilled art, the
  7212. subtleties of which may not be appreciated until you need to do it
  7213. yourself.
  7214. @node Printing Indices & Menus
  7215. @section Printing Indices and Menus
  7216. @cindex Printing an index
  7217. @cindex Indices, printing and menus
  7218. @cindex Generating menus with indices
  7219. @cindex Menus generated with indices
  7220. To print an index means to include it as part of a manual or Info file.
  7221. This does not happen automatically just because you use @code{@@cindex}
  7222. or other index-entry generating commands in the Texinfo file; those just
  7223. cause the raw data for the index to be accumulated. To generate an
  7224. index, you must include the @code{@@printindex} command at the place in
  7225. the document where you want the index to appear. Also, as part of the
  7226. process of creating a printed manual, you must run a program called
  7227. @code{texindex} (@pxref{Hardcopy}) to sort the raw data to produce a
  7228. sorted index file. The sorted index file is what is actually used to
  7229. print the index.
  7230. Texinfo offers six separate types of predefined index, which suffice
  7231. in most cases. @xref{Indices}, for information on this, as well
  7232. defining your own new indices, combining indices, and, most
  7233. importantly advice on writing the actual index entries. This section
  7234. focuses on printing indices, which is done with the
  7235. @code{@@printindex} command.
  7236. @findex printindex
  7237. @code{@@printindex} takes one argument, a two-letter index
  7238. abbreviation. It reads the corresponding sorted index file (for
  7239. printed output), and formats it appropriately into an index.
  7240. The @code{@@printindex} command does not generate a chapter heading
  7241. for the index, since different manuals have different needs.
  7242. Consequently, you should precede the @code{@@printindex} command with
  7243. a suitable section or chapter command (usually @code{@@appendix} or
  7244. @code{@@unnumbered}) to supply the chapter heading and put the index
  7245. into the table of contents. Precede the chapter heading with an
  7246. @code{@@node} line as usual.
  7247. For example:
  7248. @smallexample
  7249. @group
  7250. @@node Variable Index
  7251. @@unnumbered Variable Index
  7252. @@printindex vr
  7253. @end group
  7254. @group
  7255. @@node Concept Index
  7256. @@unnumbered Concept Index
  7257. @@printindex cp
  7258. @end group
  7259. @end smallexample
  7260. If you have more than one index, we recommend placing the concept index last.
  7261. @itemize
  7262. @item
  7263. In printed output, @code{@@printindex} produces a traditional
  7264. two-column index, with dot leaders between the index terms and page
  7265. numbers.
  7266. @item
  7267. In Info output, @code{@@printindex} produces a special menu containing
  7268. the line number of the entry, relative to the start of the node. Info
  7269. readers can use this to go to the exact line of an entry, not just the
  7270. containing node. (Older Info readers will just go to the node.)
  7271. Here's an example:
  7272. @smallexample
  7273. * First index entry: Top. (line 7)
  7274. @end smallexample
  7275. @noindent The actual number of spaces is variable, to right-justify
  7276. the line number; it's been reduced here to make the line fit in the
  7277. printed manual.
  7278. @item
  7279. In plain text output, @code{@@printindex} produces the same menu, but
  7280. the line numbers are relative to the start of the file, since that's
  7281. more convenient for that format.
  7282. @item
  7283. In HTML output, @code{@@printindex} produces links to the index
  7284. entries.
  7285. @item
  7286. In XML and Docbook output, it simply records the index to be printed.
  7287. @end itemize
  7288. @node Combining Indices
  7289. @section Combining Indices
  7290. @cindex Combining indices
  7291. @cindex Indices, combining them
  7292. Sometimes you will want to combine two disparate indices such as
  7293. functions and concepts, perhaps because you have few enough entries
  7294. that a separate index would look silly.
  7295. You could put functions into the concept index by writing
  7296. @code{@@cindex} commands for them instead of @code{@@findex} commands,
  7297. and produce a consistent manual by printing the concept index with the
  7298. title `Function and Concept Index' and not printing the `Function
  7299. Index' at all; but this is not a robust procedure. It works only if
  7300. your document is never included as part of another document that is
  7301. designed to have a separate function index; if your document were to
  7302. be included with such a document, the functions from your document and
  7303. those from the other would not end up together. Also, to make your
  7304. function names appear in the right font in the concept index, you
  7305. would need to enclose every one of them between the braces of
  7306. @code{@@code}.
  7307. @menu
  7308. * @code{@@syncodeindex}:: How to merge two indices, using @code{@@code}
  7309. font for the merged-from index.
  7310. * @code{@@synindex}:: How to merge two indices, using the
  7311. roman font for the merged-from index.
  7312. @end menu
  7313. @node @code{@@syncodeindex}
  7314. @subsection @code{@@syncodeindex}: Combining indices using @code{@@code}
  7315. @anchor{syncodeindex}@c old name
  7316. @findex syncodeindex
  7317. When you want to combine functions and concepts into one index, you
  7318. should index the functions with @code{@@findex} and index the concepts
  7319. with @code{@@cindex}, and use the @code{@@syncodeindex} command to
  7320. redirect the function index entries into the concept index.
  7321. The @code{@@syncodeindex} command takes two arguments; they are the name
  7322. of the index to redirect, and the name of the index to redirect it to.
  7323. The template looks like this:
  7324. @example
  7325. @@syncodeindex @var{from} @var{to}
  7326. @end example
  7327. @cindex Predefined names for indices
  7328. @cindex Two letter names for indices
  7329. @cindex Indices, two letter names
  7330. @cindex Names for indices
  7331. For this purpose, the indices are given two-letter names:
  7332. @table @samp
  7333. @item cp
  7334. concept index
  7335. @item fn
  7336. function index
  7337. @item vr
  7338. variable index
  7339. @item ky
  7340. key index
  7341. @item pg
  7342. program index
  7343. @item tp
  7344. data type index
  7345. @end table
  7346. Write a @code{@@syncodeindex} command before or shortly after the
  7347. end-of-header line at the beginning of a Texinfo file. For example,
  7348. to merge a function index with a concept index, write the
  7349. following:
  7350. @example
  7351. @@syncodeindex fn cp
  7352. @end example
  7353. @noindent
  7354. This will cause all entries designated for the function index to merge
  7355. in with the concept index instead.
  7356. To merge both a variables index and a function index into a concept
  7357. index, write the following:
  7358. @example
  7359. @group
  7360. @@syncodeindex vr cp
  7361. @@syncodeindex fn cp
  7362. @end group
  7363. @end example
  7364. @cindex Fonts for indices
  7365. The @code{@@syncodeindex} command puts all the entries from the `from'
  7366. index (the redirected index) into the @code{@@code} font, overriding
  7367. whatever default font is used by the index to which the entries are
  7368. now directed. This way, if you direct function names from a function
  7369. index into a concept index, all the function names are printed in the
  7370. @code{@@code} font as you would expect.
  7371. @node @code{@@synindex}
  7372. @subsection @code{@@synindex}: Combining indices
  7373. @anchor{synindex}@c old name
  7374. @findex synindex
  7375. The @code{@@synindex} command is nearly the same as the
  7376. @code{@@syncodeindex} command, except that it does not put the `from'
  7377. index entries into the @code{@@code} font; rather it puts them in the
  7378. roman font. Thus, you use @code{@@synindex} when you merge a concept
  7379. index into a function index.
  7380. @xref{Printing Indices & Menus}, for information about printing an index
  7381. at the end of a book or creating an index menu in an Info file.
  7382. @node New Indices
  7383. @section Defining New Indices
  7384. @cindex Defining new indices
  7385. @cindex Indices, defining new
  7386. @cindex New index defining
  7387. @findex defindex
  7388. @findex defcodeindex
  7389. In addition to the predefined indices (@pxref{Predefined Indices}),
  7390. you may use the @code{@@defindex} and @code{@@defcodeindex} commands
  7391. to define new indices. These commands create new indexing @@-commands
  7392. with which you mark index entries. The @code{@@defindex} command is
  7393. used like this:
  7394. @example
  7395. @@defindex @var{name}
  7396. @end example
  7397. New index names are usually two-letter words, such as @samp{au}.
  7398. For example:
  7399. @example
  7400. @@defindex au
  7401. @end example
  7402. This defines a new index, called the @samp{au} index. At the same
  7403. time, it creates a new indexing command, @code{@@auindex}, that you
  7404. can use to make index entries. Use this new indexing command just as
  7405. you would use a predefined indexing command.
  7406. For example, here is a section heading followed by a concept index
  7407. entry and two @samp{au} index entries.
  7408. @example
  7409. @@section Cognitive Semantics
  7410. @@cindex kinesthetic image schemas
  7411. @@auindex Johnson, Mark
  7412. @@auindex Lakoff, George
  7413. @end example
  7414. @noindent
  7415. (Evidently, @samp{au} serves here as an abbreviation for ``author''.)
  7416. Texinfo constructs the new indexing command by concatenating the name
  7417. of the index with @samp{index}; thus, defining an @samp{xy} index
  7418. leads to the automatic creation of an @code{@@xyindex} command.
  7419. Use the @code{@@printindex} command to print the index, as you do with
  7420. the predefined indices. For example:
  7421. @example
  7422. @group
  7423. @@node Author Index
  7424. @@unnumbered Author Index
  7425. @@printindex au
  7426. @end group
  7427. @end example
  7428. The @code{@@defcodeindex} is like the @code{@@defindex} command,
  7429. except that, in the printed output, it prints entries in an
  7430. @code{@@code} font by default instead of a roman font.
  7431. You should define new indices before the end-of-header line of a
  7432. Texinfo file, and (of course) before any @code{@@synindex} or
  7433. @code{@@syncodeindex} commands (@pxref{Texinfo File Header}).
  7434. As mentioned earlier (@pxref{Predefined Indices}), we recommend having
  7435. a single index in the final document whenever possible, however many
  7436. source indices you use, since then readers have only one place to
  7437. look.
  7438. When creating an index, @TeX{} creates a file whose extension is the
  7439. name of the index (@pxref{Names of index files}). Therefore you
  7440. should avoid using index names that collide with extensions used for
  7441. other purposes, such as @samp{.aux} or @samp{.xml}.
  7442. @command{makeinfo} already reports an error if a new index conflicts
  7443. well-known extension name.
  7444. @node Insertions
  7445. @chapter Special Insertions
  7446. @cindex Inserting special characters and symbols
  7447. @cindex Special insertions
  7448. Texinfo provides several commands for inserting characters that have
  7449. special meaning in Texinfo, such as braces, and for other graphic
  7450. elements that do not correspond to simple characters you can type.
  7451. @iftex
  7452. These are:
  7453. @itemize @bullet
  7454. @item The Texinfo special characters: @samp{@@ @{@} , \ #}.
  7455. @item Whitespace within and around a sentence.
  7456. @item Accents.
  7457. @item Dots and bullets.
  7458. @item The @TeX{} logo and the copyright symbol.
  7459. @item The euro and pounds currency symbols.
  7460. @item The degrees symbol.
  7461. @item The minus sign.
  7462. @item Mathematical expressions.
  7463. @item Glyphs for examples of programming: evaluation, macros, errors, etc.
  7464. @item Footnotes.
  7465. @end itemize
  7466. @end iftex
  7467. @menu
  7468. * Special Characters:: Inserting @@ @{@} , \ #
  7469. * Inserting Quote Characters:: Inserting left and right quotes, in code.
  7470. * Inserting Space:: Inserting the right amount of whitespace.
  7471. * Inserting Accents:: Inserting accents and special characters.
  7472. * Inserting Quotation Marks:: Inserting quotation marks.
  7473. * Inserting Subscripts and Superscripts:: Inserting sub/superscripts.
  7474. * Inserting Math:: Formatting mathematical expressions.
  7475. * Glyphs for Text:: Inserting dots, bullets, currencies, etc.
  7476. * Glyphs for Programming:: Indicating results of evaluation,
  7477. expansion of macros, errors, etc.
  7478. * Inserting Unicode:: Inserting a Unicode character by code point.
  7479. @end menu
  7480. @node Special Characters
  7481. @section Special Characters: Inserting @@ @{@} , \ #
  7482. @anchor{Braces Atsign}@c previous names for this node
  7483. @anchor{Atsign Braces Comma}
  7484. @cindex Special characters, inserting
  7485. @cindex Commands to insert special characters
  7486. @samp{@@} and curly braces are the basic special characters in
  7487. Texinfo. To insert these characters so they appear in text, you must
  7488. put an @samp{@@} in front of these characters to prevent Texinfo from
  7489. misinterpreting them. Alphabetic commands are also provided.
  7490. The other characters (comma, backslash, hash) are special only in
  7491. restricted contexts, as explained in the respective sections.
  7492. @menu
  7493. * Inserting an Atsign:: @code{@@@@}, @code{@@atchar@{@}}.
  7494. * Inserting Braces:: @code{@@@{ @@@}}, @code{@@l rbracechar@{@}}.
  7495. * Inserting a Comma:: , and @code{@@comma@{@}}.
  7496. * Inserting a Backslash:: \ and @code{@@backslashchar@{@}}.
  7497. * Inserting a Hashsign:: # and @code{@@hashchar@{@}}.
  7498. @end menu
  7499. @node Inserting an Atsign
  7500. @subsection Inserting `@@' with @code{@@@@} and @code{@@atchar@{@}}
  7501. @cindex At sign, inserting
  7502. @cindex Inserting @@ @r{(literal @samp{@@})}
  7503. @findex @sortas{@@} @@ @r{(literal @samp{@@})}
  7504. @findex atchar@{@} @r{(literal @samp{@@})}
  7505. @code{@@@@} produces a single @samp{@@} character in the output. Do
  7506. not put braces after an @code{@@@@} command.
  7507. @code{@@atchar@{@}} also produces a single @samp{@@} character in the
  7508. output. It does need following braces, as usual for alphabetic
  7509. commands. In inline conditionals (@pxref{Inline Conditionals}), it
  7510. can be necessary to avoid using the literal @samp{@@} character in the
  7511. source (and may be clearer in other contexts).
  7512. @node Inserting Braces
  7513. @subsection Inserting `@{ `@}' with @code{@@@{ @@@}} and @code{@@l rbracechar@{@}}
  7514. @findex @{ @r{(literal @samp{@{})}
  7515. @findex @} @r{(literal @samp{@}})}
  7516. @findex lbracechar@{@} @r{(literal @samp{@{})}
  7517. @findex rbracechar@{@} @r{(literal @samp{@}})}
  7518. @cindex Braces, inserting
  7519. @code{@@@{} produces a single @samp{@{} in the output, and @code{@@@}}
  7520. produces a single @samp{@}}. Do not put braces after either an
  7521. @code{@@@{} or an @code{@@@}} command.
  7522. @code{@@lbracechar@{@}} and @code{@@rbracechar@{@}} also produce
  7523. single @samp{@{} and @samp{@}} characters in the output. They do need
  7524. following braces, as usual for alphabetic commands. In inline
  7525. conditionals (@pxref{Inline Conditionals}), it can be
  7526. necessary to avoid using literal brace characters in the source (and
  7527. may be clearer in other contexts).
  7528. @node Inserting a Comma
  7529. @subsection Inserting `,' with @code{@@comma@{@}}
  7530. @findex comma
  7531. @cindex Comma, inserting
  7532. Ordinarily, a comma `,' is a normal character that can be simply typed
  7533. in your input where you need it.
  7534. However, Texinfo uses the comma as a special character only in one
  7535. context: to separate arguments to those Texinfo commands, such as
  7536. @code{@@acronym} (@pxref{@code{@@acronym}}) and @code{@@xref}
  7537. (@pxref{Cross References}), as well as user-defined macros
  7538. (@pxref{Defining Macros}), which take more than one argument.
  7539. Since a comma character would confuse Texinfo's parsing for these
  7540. commands, you must use the command @samp{@@comma@{@}} instead if you want
  7541. to pass an actual comma. Here are some examples:
  7542. @example
  7543. @@acronym@{ABC, A Bizarre @@comma@{@}@}
  7544. @@xref@{Comma,, The @@comma@{@} symbol@}
  7545. @@mymac@{One argument@@comma@{@} containing a comma@}
  7546. @end example
  7547. Although @samp{@@comma@{@}} can be used nearly anywhere, there is no
  7548. need for it anywhere except in this unusual case.
  7549. (Incidentally, the name @samp{@@comma} lacks the @samp{char} suffix used
  7550. in its companion commands only for historical reasons. It didn't seem
  7551. important enough to define a synonym.)
  7552. @node Inserting a Backslash
  7553. @subsection Inserting `\' with @code{@@backslashchar@{@}}
  7554. @findex backslashchar
  7555. @cindex Backslash, inserting
  7556. Ordinarily, a backslash `\' is a normal character in Texinfo that can
  7557. be simply typed in your input where you need it. The result is to
  7558. typeset the backslash from the typewriter font.
  7559. However, Texinfo uses the backslash as a special character in one
  7560. restricted context: to delimit formal arguments in the bodies of
  7561. user-defined macros (@pxref{Defining Macros}).
  7562. Due to the vagaries of macro argument parsing, it is more reliable to
  7563. pass an alphabetic command that produces a backslash instead of using
  7564. a literal \. Hence @code{@@backslashchar@{@}}. Here is an example
  7565. macro call:
  7566. @example
  7567. @@mymac@{One argument@@backslashchar@{@} with a backslash@}
  7568. @end example
  7569. @findex \backslash
  7570. Texinfo documents may also use \ as a command character inside
  7571. @code{@@math} (@pxref{Inserting Math}). In this case, @code{@@\} or
  7572. @code{\backslash} produces a ``math'' backslash (from the math symbol
  7573. font), while @code{@@backslashchar@{@}} produces a typewriter
  7574. backslash as usual.
  7575. Although @samp{@@backslashchar@{@}} can be used nearly anywhere, there
  7576. is no need for it except in these unusual cases.
  7577. @node Inserting a Hashsign
  7578. @subsection Inserting `#' with @code{@@hashchar@{@}}
  7579. @findex hashchar@{@} @r{(literal @samp{#})}
  7580. @cindex Inserting #
  7581. @cindex Hash sign, inserting
  7582. Ordinarily, a hash `#' is a normal character in Texinfo that can be
  7583. simply typed in your input where you need it. The result is to
  7584. typeset the hash character from the current font.
  7585. @cindex Number sign, inserting
  7586. @cindex Octotherp, inserting
  7587. @cindex Sharp sign (not), inserting
  7588. This character has many other names, varying by locale, such as
  7589. ``number sign'', ``pound'', and ``octothorp''. It is also sometimes
  7590. called ``sharp'' or ``sharp sign'' since it vaguely resembles the
  7591. musical symbol by that name. In situations where Texinfo is used,
  7592. ``hash'' is the most common in our experience.
  7593. However, Texinfo uses the hash character as a special character in one
  7594. restricted context: to introduce the so-called @code{#line} directive
  7595. and variants (@pxref{External Macro Processors}).
  7596. So, in order to typeset an actual hash character in such a place (for
  7597. example, in a program that needs documentation about @code{#line}),
  7598. it's necessary to use @code{@@hashchar@{@}} or some other construct.
  7599. Here's an example:
  7600. @example
  7601. @@hashchar@{@} 10 "example.c"
  7602. @end example
  7603. Although @samp{@@hashchar@{@}} can be used nearly anywhere, there
  7604. is no need for it anywhere except this unusual case.
  7605. @node Inserting Quote Characters
  7606. @section Inserting Quote Characters
  7607. @cindex Inserting quote characters
  7608. @cindex Quote characters, inserting
  7609. As explained in the early section on general Texinfo input conventions
  7610. (@pxref{Conventions}), Texinfo source files use the ASCII character
  7611. @code{`} (96 decimal) to produce a left quote (`), and ASCII @code{'}
  7612. (39 decimal) to produce a right quote ('). Doubling these input
  7613. characters (@code{``} and @code{''}) produces double quotes (`` and
  7614. ''). These are the conventions used by @TeX{}.
  7615. This works all right for text. However, in examples of computer code,
  7616. readers are especially likely to cut and paste the text
  7617. verbatim---and, unfortunately, some document viewers will mangle these
  7618. characters. (The free PDF reader @command{xpdf} works fine, but other
  7619. PDF readers, both free and nonfree, have problems.)
  7620. If this is a concern for you, Texinfo provides these two commands:
  7621. @table @code
  7622. @item @@codequoteundirected @var{on-off}
  7623. @findex codequoteundirected
  7624. @cindex undirected single quote
  7625. causes the output for the @code{'} character in code environments to
  7626. be the undirected single quote, like this:
  7627. @set txicodequoteundirected on
  7628. @code{'}.
  7629. @set txicodequoteundirected off
  7630. @item @@codequotebacktick @var{on-off}
  7631. @findex codequotebacktick
  7632. @cindex backtick
  7633. @cindex grave accent, standalone
  7634. causes the output for the @code{`} character in code environments to
  7635. be the backtick character (standalone grave accent), like this:
  7636. @set txicodequotebacktick on
  7637. @code{`}.
  7638. @set txicodequotebacktick off
  7639. @end table
  7640. If you want these settings for only part of the document,
  7641. @code{@@codequote... off} will restore the normal behavior, as in
  7642. @code{@@codequoteundirected off}.
  7643. These settings affect @code{@@code}, @code{@@example}, @code{@@kbd},
  7644. @code{@@samp}, @code{@@verb}, and @code{@@verbatim}. @xref{Useful
  7645. Highlighting}.
  7646. @vindex txicodequoteundirected@r{, obsolete variable}
  7647. @vindex txicodequotebacktick@r{, obsolete variable}
  7648. This feature used to be controlled by using @code{@@set} to change the
  7649. values of the corresponding variables @code{txicodequoteundirected}
  7650. and @code{txicodequotebacktick}; they are still supported, but the
  7651. command interface is preferred.
  7652. @node Inserting Space
  7653. @section Inserting Space
  7654. @cindex Inserting space
  7655. @cindex Spacing, inserting
  7656. The following sections describe commands that control spacing of various
  7657. kinds within and after sentences.
  7658. @menu
  7659. * Multiple Spaces:: Inserting multiple spaces.
  7660. * Not Ending a Sentence:: Sometimes a . doesn't end a sentence.
  7661. * Ending a Sentence:: Sometimes it does.
  7662. * @code{@@frenchspacing}:: Specifying end-of-sentence spacing.
  7663. * @code{@@dmn}:: Formatting a dimension.
  7664. @end menu
  7665. @node Multiple Spaces
  7666. @subsection Multiple Spaces
  7667. @cindex Multiple spaces
  7668. @cindex Whitespace, inserting
  7669. @cindex Space, inserting horizontal
  7670. @findex <space>
  7671. @findex <tab>
  7672. @findex <newline>
  7673. Ordinarily, multiple whitespace characters (space, tab, and newline)
  7674. are collapsed into a single space.
  7675. Occasionally, you may want to produce several consecutive spaces,
  7676. either for purposes of example (e.g., what your program does with
  7677. multiple spaces as input), or merely for purposes of appearance in
  7678. headings or lists. Texinfo supports three commands:
  7679. @code{@@@kbd{SPACE}}, @code{@@@kbd{TAB}}, and @code{@@@kbd{NL}}, all
  7680. of which insert a single space into the output. (Here,
  7681. @code{@@@kbd{SPACE}} represents an @samp{@@} character followed by a
  7682. space, i.e., @samp{@@ }, @kbd{TAB} represents an actual tab character,
  7683. and @code{@@@kbd{NL}} represents an @samp{@@} character and end-of-line,
  7684. i.e., when @samp{@@} is the last character on a line.)
  7685. For example,
  7686. @example
  7687. Spacey@@ @@ @@ @@
  7688. example.
  7689. @end example
  7690. @noindent produces
  7691. @example
  7692. Spacey@ @ @ @
  7693. example.
  7694. @end example
  7695. Other possible uses of @code{@@@kbd{SPACE}} have been subsumed by
  7696. @code{@@multitable} (@pxref{Multi-column Tables}).
  7697. Do not follow any of these commands with braces.
  7698. To produce a non-breakable space, see @ref{@code{@@tie}}.
  7699. @node Not Ending a Sentence
  7700. @subsection Not Ending a Sentence
  7701. @cindex Not ending a sentence
  7702. @cindex Sentence non-ending punctuation
  7703. @cindex Periods, inserting
  7704. @cindex Spacing, in the middle of sentences
  7705. When a period, exclamation point or question mark is
  7706. at the end of a sentence, slightly more space is
  7707. inserted after it in a typeset manual.
  7708. @findex <colon> @r{(suppress end-of-sentence space)}
  7709. @findex :
  7710. Usually, Texinfo can determine automatically when a period ends a
  7711. sentence. However, special commands are needed in some circumstances.
  7712. Use the @code{@@:} command after a period, question mark, exclamation
  7713. mark or colon that should not be followed by extra space. This is
  7714. necessary in the following situations:
  7715. @enumerate
  7716. @item After a period that ends a lowercase abbreviation which is not at
  7717. the end of a sentences.
  7718. @item When a parenthetical remark in the middle of a sentence (like
  7719. this one!)@: ends with a period, exclamation point or question mark,
  7720. @code{@@:} should be used after the right parenthesis. Similarly for
  7721. right brackets and right quotes (both single and double).
  7722. @end enumerate
  7723. For example:
  7724. @example
  7725. @samp{foo vs.@@: bar (or?)@@: baz},
  7726. @end example
  7727. @noindent
  7728. The first line below shows the output, and for comparison, the second
  7729. line shows the spacing when the @samp{@@:} commands were not used.
  7730. @quotation
  7731. foo vs.@: bar (or?)@: baz@*
  7732. foo vs. bar (or?) baz
  7733. @end quotation
  7734. @iftex
  7735. If you look carefully, you will see a bit of extraneous space after the
  7736. @samp{vs.}@: and @samp{(or?)}@:.
  7737. @end iftex
  7738. It may help you to remember what @code{@@:} does by imagining that it
  7739. stands for an invisible lower-case character that stops a word ending in
  7740. a period.
  7741. A few Texinfo commands force normal interword spacing, so that you
  7742. don't have to insert @code{@@:} where you otherwise would. These are
  7743. the code-like highlighting commands, @code{@@var}, @code{@@abbr}, and
  7744. @code{@@acronym} (@pxref{Useful Highlighting}). For example, in
  7745. @samp{@@code@{foo. bar@}} the period is not considered to be the end of a
  7746. sentence, and no extra space is inserted.
  7747. @code{@@:} has no effect on the HTML or Docbook output.
  7748. @node Ending a Sentence
  7749. @subsection Ending a Sentence
  7750. @cindex Ending a Sentence
  7751. @cindex Sentence ending punctuation
  7752. @findex . @r{(end of sentence)}
  7753. @findex ! @r{(end of sentence)}
  7754. @findex ? @r{(end of sentence)}
  7755. @cindex Spacing, at ends of sentences
  7756. As mentioned above, Texinfo normally inserts additional space after
  7757. the end of a sentence. It uses the same heuristic for this as @TeX{}:
  7758. a sentence ends with a period, exclamation point, or question mark,
  7759. either preceded or followed by optional closing punctuation, and then
  7760. whitespace, and @emph{not} preceded by a capital letter.
  7761. Use @code{@@.}@: instead of a period, @code{@@!}@: instead of an
  7762. exclamation point, and @code{@@?}@: instead of a question mark at the
  7763. end of a sentence that does end with a capital letter. Do not put
  7764. braces after any of these commands. For example:
  7765. @example
  7766. Give it to M.I.B. and to M.E.W@@. Also, give it to R.J.C@@.
  7767. Give it to M.I.B. and to M.E.W. Also, give it to R.J.C.
  7768. @end example
  7769. @noindent
  7770. The output follows. In printed output and Info, you can see the
  7771. desired extra whitespace after the @samp{W} in the first line.
  7772. @quotation
  7773. Give it to M.I.B. and to M.E.W@. Also, give it to R.J.C@.@*
  7774. Give it to M.I.B. and to M.E.W. Also, give it to R.J.C.
  7775. @end quotation
  7776. In the HTML output, @code{@@.}@: is equivalent to a simple @samp{.};
  7777. likewise for @code{@@!}@: and @code{@@?}@:.
  7778. @cindex Closing punctuation, and sentence ending
  7779. The ``closing punctuation'' mentioned above is defined as a right
  7780. parenthesis (@samp{)}, right bracket (@samp{]}), or right quote,
  7781. either single or double (@samp{'} and @samp{''}; the many possible
  7782. additional Unicode right quotes are not included). These characters
  7783. can be thought of as invisible with respect to whether a given period
  7784. ends a sentence. (This is the same rule as @TeX{}.) For instance,
  7785. the periods in @samp{foo.) Bar} and @samp{foo.'' Bar} do end
  7786. sentences.
  7787. The meanings of @code{@@:} and @code{@@.}, etc.@: in Texinfo are
  7788. designed to work well with the Emacs sentence motion commands
  7789. (@pxref{Sentences,,, emacs, The GNU Emacs Manual}). It may help to
  7790. imagine that the @samp{@@} in @samp{@@.}, etc., is an invisible
  7791. lower-case letter `a' which makes an upper-case letter before it
  7792. immaterial for the purposes of deciding whether the period ends the
  7793. sentence.
  7794. A few Texinfo commands are not considered as being an abbreviation,
  7795. even though they may end with a capital letter when expanded, so that
  7796. you don't have to insert @code{@@.} and companions. Notably, this is
  7797. the case for code-like highlighting commands, @code{@@var} arguments
  7798. ending with a capital letter, @code{@@LaTeX}, and @code{@@TeX}. For
  7799. example, that sentence ended with @samp{... @@code@{@@@@TeX@}.};
  7800. @code{@@.} was not needed. Similarly, in
  7801. @code{... @@var@{VARNAME@}. Text} the period after @var{VARNAME} ends
  7802. the sentence; there is no need to use @code{@@.}.
  7803. @node @code{@@frenchspacing}
  7804. @subsection @code{@@frenchspacing} @var{val}: Control Sentence Spacing
  7805. @anchor{frenchspacing}@c old name
  7806. @findex frenchspacing
  7807. @cindex French spacing
  7808. @cindex Sentences, spacing after
  7809. @cindex Space, after sentences
  7810. In American typography, it is traditional and correct to put extra
  7811. space at the end of a sentence. This is the default in Texinfo
  7812. (implemented in Info and printed output; for HTML, we don't try to
  7813. override the browser). In French typography (and others), this extra
  7814. space is wrong; all spaces are uniform.
  7815. Therefore Texinfo provides the @code{@@frenchspacing} command to
  7816. control the spacing after punctuation. It reads the rest of the line
  7817. as its argument, which must be the single word @samp{on} or @samp{off}
  7818. (always these words, regardless of the language of the document).
  7819. Here is an example:
  7820. @example
  7821. @@frenchspacing on
  7822. This is text. Two sentences. Three sentences. French spacing.
  7823. @@frenchspacing off
  7824. This is text. Two sentences. Three sentences. Non-French spacing.
  7825. @end example
  7826. @noindent produces:
  7827. @frenchspacing on
  7828. This is text. Two sentences. Three sentences. French spacing.
  7829. @frenchspacing off
  7830. This is text. Two sentences. Three sentences. Non-French spacing.
  7831. @code{@@frenchspacing} also affects the output after @code{@@.},
  7832. @code{@@!}, and @code{@@?} (@pxref{Ending a Sentence}).
  7833. @code{@@frenchspacing} has no effect on the HTML or Docbook output;
  7834. for XML, it outputs a transliteration of itself (@pxref{Output
  7835. Formats}).
  7836. @node @code{@@dmn}
  7837. @subsection @code{@@dmn}@{@var{dimension}@}: Format a Dimension
  7838. @anchor{dmn}@c old name
  7839. @cindex Thin space between number, dimension
  7840. @cindex Dimension formatting
  7841. @cindex Format a dimension
  7842. @findex dmn
  7843. You can use the @code{@@dmn} command to format a dimension with a
  7844. little extra space in the printed output. That is, on seeing
  7845. @code{@@dmn}, @TeX{} inserts just enough space for proper typesetting;
  7846. in other output formats, the formatting commands insert no space at
  7847. all.
  7848. To use the @code{@@dmn} command, write the number and then follow it
  7849. immediately, with no intervening space, by @code{@@dmn}, and then by
  7850. the dimension within braces. For example,
  7851. @example
  7852. A4 paper is 8.27@@dmn@{in@} wide.
  7853. @end example
  7854. @noindent
  7855. produces
  7856. @quotation
  7857. A4 paper is 8.27@dmn{in} wide.
  7858. @end quotation
  7859. Not everyone uses this style. Some people prefer `8.27@tie{}in.'@: or
  7860. `8.27@tie{}inches'. In these cases, however, you need to use
  7861. @code{@@tie} (@pxref{@code{@@tie}}) or @code{@@w} (@pxref{@code{@@w}})
  7862. so that no line break can occur between the number and the dimension.
  7863. Also, if you write a period after an abbreviation within a sentence
  7864. (as with the `in.'@: above), you should write @samp{@@:} after the
  7865. period to prevent @TeX{} from inserting extra whitespace, as shown
  7866. here. @xref{Not Ending a Sentence}.
  7867. @node Inserting Accents
  7868. @section Inserting Accents
  7869. @cindex Inserting accents
  7870. @cindex Accents, inserting
  7871. @cindex Floating accents, inserting
  7872. Here is a table with the commands Texinfo provides for inserting
  7873. floating accents. They all need an argument, the character to accent,
  7874. which can either be given in braces as usual (@code{@@'@{e@}}), or, as
  7875. a special case, the braces can be omitted, in which case the argument
  7876. is the next character (@code{@@'e}). This is to make the source as
  7877. convenient as possible to type and read, since accented characters are
  7878. very common in some languages.
  7879. If the command is alphabetic, such as @code{@@dotaccent}, then there
  7880. must be a space between the command name and argument if braces are
  7881. not used. If the command is non-alphabetic, such as @code{@@'}, then
  7882. there must @emph{not} be a space; the argument is the very next
  7883. character.
  7884. Exception: the argument to @code{@@tieaccent} must be enclosed in
  7885. braces (since it is two characters instead of one).
  7886. To get the true accented characters output in Info, not just the ASCII
  7887. transliterations, it is necessary to specify @code{@@documentencoding}
  7888. with an encoding which supports the required characters
  7889. (@pxref{@code{@@documentencoding}}). In this case, you can also use
  7890. non-ASCII (e.g., pre-accented) characters in the source file.
  7891. @findex " @r{(umlaut accent)}
  7892. @cindex Umlaut accent
  7893. @findex ' @r{(acute accent)}
  7894. @cindex Acute accent
  7895. @findex = @r{(macron accent)}
  7896. @cindex Macron accent
  7897. @findex ^ @r{(circumflex accent)}
  7898. @cindex Circumflex accent
  7899. @findex ` @r{(grave accent)}
  7900. @cindex Grave accent
  7901. @findex ~ @r{(tilde accent)}
  7902. @cindex Tilde accent
  7903. @findex , @r{(cedilla accent)}
  7904. @cindex Cedilla accent
  7905. @findex dotaccent
  7906. @cindex Dot accent
  7907. @findex H @r{(Hungarian umlaut accent)}
  7908. @cindex Hungarian umlaut accent
  7909. @findex ogonek
  7910. @cindex Ogonek diacritic
  7911. @findex ringaccent
  7912. @cindex Ring accent
  7913. @findex tieaccent
  7914. @cindex Tie-after accent
  7915. @findex u @r{(breve accent)}
  7916. @cindex Breve accent
  7917. @findex ubaraccent
  7918. @cindex Underbar accent
  7919. @findex udotaccent
  7920. @cindex Underdot accent
  7921. @findex v @r{(caron)}
  7922. @cindex Hacek accent
  7923. @cindex Check accent
  7924. @cindex Caron
  7925. @multitable {@t{@@questiondown@{@}}} {Output} {caron/hacek/check accent}
  7926. @headitem Command @tab Output @tab What
  7927. @item @t{@@"o} @tab @"o @tab umlaut accent
  7928. @item @t{@@'o} @tab @'o @tab acute accent
  7929. @item @t{@@,@{c@}} @tab @,{c} @tab cedilla accent
  7930. @item @t{@@=o} @tab @=o @tab macron/overbar accent
  7931. @item @t{@@^o} @tab @^o @tab circumflex accent
  7932. @item @t{@@`o} @tab @`o @tab grave accent
  7933. @item @t{@@~o} @tab @~o @tab tilde accent
  7934. @item @t{@@dotaccent@{o@}} @tab @dotaccent{o} @tab overdot accent
  7935. @item @t{@@H@{o@}} @tab @H{o} @tab long Hungarian umlaut
  7936. @item @t{@@ogonek@{a@}} @tab @ogonek{a} @tab ogonek
  7937. @item @t{@@ringaccent@{o@}} @tab @ringaccent{o} @tab ring accent
  7938. @item @t{@@tieaccent@{oo@}} @tab @tieaccent{oo} @tab tie-after accent
  7939. @item @t{@@u@{o@}} @tab @u{o} @tab breve accent
  7940. @item @t{@@ubaraccent@{o@}} @tab @ubaraccent{o} @tab underbar accent
  7941. @item @t{@@udotaccent@{o@}} @tab @udotaccent{o} @tab underdot accent
  7942. @item @t{@@v@{o@}} @tab @v{o} @tab caron/hacek/check accent
  7943. @end multitable
  7944. This table lists the Texinfo commands for inserting other characters
  7945. commonly used in languages other than English.
  7946. @findex questiondown
  7947. @cindex @questiondown{}
  7948. @findex exclamdown
  7949. @cindex @exclamdown{}
  7950. @findex aa
  7951. @cindex @aa{}
  7952. @findex AA
  7953. @cindex @AA{}
  7954. @findex ae
  7955. @cindex @ae{}
  7956. @findex AE
  7957. @cindex @AE{}
  7958. @cindex Icelandic
  7959. @cindex Eth
  7960. @findex dh
  7961. @cindex @dh{}
  7962. @findex DH
  7963. @cindex @DH{}
  7964. @findex dotless
  7965. @cindex @dotless{i} (dotless i)
  7966. @cindex @dotless{j} (dotless j)
  7967. @cindex Dotless i, j
  7968. @findex l
  7969. @cindex @l{}
  7970. @findex L
  7971. @cindex @L{}
  7972. @findex o
  7973. @cindex @o{}
  7974. @findex O
  7975. @cindex @O{}
  7976. @findex oe
  7977. @cindex @oe{}
  7978. @findex OE
  7979. @cindex @OE{}
  7980. @cindex Romance ordinals
  7981. @cindex Ordinals, Romance
  7982. @cindex Feminine ordinal
  7983. @findex ordf
  7984. @cindex @ordf{}
  7985. @cindex Masculine ordinal
  7986. @findex ordm
  7987. @cindex @ordm{}
  7988. @findex ss
  7989. @cindex @ss{}
  7990. @cindex Es-zet
  7991. @cindex Sharp S
  7992. @cindex German S
  7993. @cindex Thorn
  7994. @findex th
  7995. @cindex @th{}
  7996. @findex TH
  7997. @cindex @TH{}
  7998. @multitable {@t{@@questiondown@{@}}} {oe OE} {es-zet or sharp S}
  7999. @item @t{@@exclamdown@{@}} @tab @exclamdown{} @tab upside-down !
  8000. @item @t{@@questiondown@{@}} @tab @questiondown{} @tab upside-down ?
  8001. @item @t{@@aa@{@} @@AA@{@}} @tab @aa{} @AA{} @tab a,A with circle
  8002. @item @t{@@ae@{@} @@AE@{@}} @tab @ae{} @AE{} @tab ae,AE ligatures
  8003. @item @t{@@dh@{@} @@DH@{@}} @tab @dh{} @DH{} @tab Icelandic eth
  8004. @item @t{@@dotless@{i@}} @tab @dotless{i} @tab dotless i
  8005. @item @t{@@dotless@{j@}} @tab @dotless{j} @tab dotless j
  8006. @item @t{@@l@{@} @@L@{@}} @tab @l{} @L{} @tab suppressed-L,l
  8007. @item @t{@@o@{@} @@O@{@}} @tab @o{} @O{} @tab O,o with slash
  8008. @item @t{@@oe@{@} @@OE@{@}} @tab @oe{} @OE{} @tab oe,OE ligatures
  8009. @item @t{@@ordf@{@} @@ordm@{@}} @tab @ordf{} @ordm{} @tab Spanish ordinals
  8010. @item @t{@@ss@{@}} @tab @ss{} @tab es-zet or sharp S
  8011. @item @t{@@th@{@} @@TH@{@}} @tab @th{} @TH{} @tab Icelandic thorn
  8012. @end multitable
  8013. @node Inserting Quotation Marks
  8014. @section Inserting Quotation Marks
  8015. @cindex Inserting quotation marks
  8016. @cindex Quotation marks, inserting
  8017. @cindex Quotation characters (`'), in source
  8018. Use doubled single-quote characters to begin and end quotations:
  8019. @w{@t{`@w{}`@dots{}'@w{}'}}. @TeX{} converts two single quotes to
  8020. left- and right-hand doubled quotation marks,
  8021. @c this comes out as "like this" in Info, which is just confusing.
  8022. @iftex
  8023. ``like this'',
  8024. @end iftex
  8025. and Info converts doubled single-quote characters to ASCII
  8026. double-quotes: @w{@t{`@w{}`@dots{}'@w{}'}} becomes @w{@t{"@dots{}"}}.
  8027. You may occasionally need to produce two consecutive single quotes;
  8028. for example, in documenting a computer language such as Maxima where
  8029. @t{'@w{}'} is a valid command. You can do this with the input
  8030. @t{'@@w@{@}'}; the empty @code{@@w} command stops the combination into
  8031. the double-quote characters.
  8032. @cindex Unicode quotation characters
  8033. @cindex Grave accent, vs. left quote
  8034. The left quote character (@t{`}, ASCII code 96) used in Texinfo is a
  8035. grave accent in ANSI and ISO character set standards. We use it as a
  8036. quote character because that is how @TeX{} is set up, by default.
  8037. Texinfo supports several other quotation marks used in languages other
  8038. than English. Below is a table with the commands Texinfo provides for
  8039. inserting quotation marks.
  8040. @cindex UTF-8
  8041. @cindex ISO 8859-15
  8042. @cindex Latin 9
  8043. @cindex ISO 8859-1
  8044. @cindex Latin 1
  8045. In order to get the symbols for the quotation marks in encoded Info
  8046. output, it is necessary to specify @code{@@documentencoding UTF-8}.
  8047. (@xref{@code{@@documentencoding}}.) Double guillemets are also
  8048. present in ISO 8859-1 (aka Latin@tie{}1) and ISO 8859-15 (aka
  8049. Latin@tie{}9).
  8050. @cindex European Computer Modern fonts
  8051. @cindex EC fonts
  8052. The standard @TeX{} fonts support the usual quotation marks used in
  8053. English (the ones produced with single and doubled ASCII
  8054. single-quotes). For the other quotation marks, @TeX{} uses European
  8055. Computer Modern (EC) fonts (@file{ecrm1000} and other variants).
  8056. These fonts are freely available, of course; you can download them
  8057. from @url{http://ctan.org/pkg/ec}, among other places.
  8058. @cindex CM-Super fonts
  8059. The free EC fonts are bitmap fonts created with Metafont. Especially
  8060. for on-line viewing, Type@tie{}1 (vector) versions of the fonts are
  8061. preferable; these are available in the CM-Super font package
  8062. (@url{http://ctan.org/pkg/cm-super}).
  8063. Both distributions include installation instructions.
  8064. @cindex Single quotation marks
  8065. @cindex Double quotation marks
  8066. @cindex Left quotation marks
  8067. @cindex Right quotation marks
  8068. @findex quotedblleft
  8069. @cindex `@w{}`
  8070. @findex quoteleft
  8071. @cindex `
  8072. @cindex " (undirected double quote character)
  8073. @findex quotedblright
  8074. @cindex '@w{}'
  8075. @findex quoteright
  8076. @cindex '
  8077. @cindex Double low-9 quotation mark
  8078. @cindex Single low-9 quotation mark
  8079. @findex quotedblbase
  8080. @cindex @quotedblbase{} (double low-9 quotation mark)
  8081. @findex quotesinglbase
  8082. @cindex @quotesinglbase{} (single low-9 quotation mark)
  8083. @cindex Angle quotation marks
  8084. @cindex Guillemets
  8085. @cindex Guillemots
  8086. @cindex French quotation marks
  8087. @cindex Quotation marks, French
  8088. @cindex German quotation marks
  8089. @cindex Quotation marks, German
  8090. @cindex Double guillemets
  8091. @cindex Single guillemets
  8092. @cindex Double angle quotation marks
  8093. @cindex Single angle quotation marks
  8094. @cindex Left-pointing angle quotation marks
  8095. @cindex Right-pointing angle quotation marks
  8096. @cindex Double left-pointing angle quotation mark
  8097. @cindex Double right-pointing angle quotation mark
  8098. @cindex Single left-pointing angle quotation mark
  8099. @cindex Single right-pointing angle quotation mark
  8100. @findex guillemetleft
  8101. @findex guillemotleft
  8102. @cindex @sortas{<<} @guillemetleft{}
  8103. @findex guillemetright
  8104. @findex guillemotright
  8105. @cindex @guillemetright{}
  8106. @findex guilsinglleft
  8107. @cindex @sortas{<} @guilsinglleft{}
  8108. @findex guilsinglright
  8109. @cindex @guilsinglright{}
  8110. @c The third column doesn't have the full text in the prototype so that
  8111. @c the Info output fits within 72 columns.
  8112. @multitable {@t{@@quotedblright@{@} '@w{}'}} {Glyph} {Right-pointing double angle quotation}
  8113. @headitem Command @tab Glyph @tab Unicode name (point)
  8114. @item @verb{.@quotedblleft{} ``.} @tab @quotedblleft{} @tab Left double quotation mark (U+201C)
  8115. @item @verb{.@quotedblright{} ''.} @tab @quotedblright{} @tab Right double quotation mark (U+201D)
  8116. @item @verb{.@quoteleft{} `.} @tab @quoteleft{} @tab Left single quotation mark (U+2018)
  8117. @item @verb{.@quoteright{} '.} @tab @quoteright{} @tab Right single quotation mark (U+2019)
  8118. @item @t{@@quotedblbase@{@}} @tab @quotedblbase{} @tab Double low-9 quotation mark (U+201E)
  8119. @item @t{@@quotesinglbase@{@}} @tab @quotesinglbase{} @tab Single low-9 quotation mark (U+201A)
  8120. @item @t{@@guillemetleft@{@}} @tab @guillemetleft{} @tab Left-pointing double angle quotation mark (U+00AB)
  8121. @item @t{@@guillemetright@{@}} @tab @guillemetright{} @tab Right-pointing double angle quotation mark (U+00BB)
  8122. @item @t{@@guilsinglleft@{@}} @tab @guilsinglleft{} @tab Single left-pointing angle quotation mark (U+2039)
  8123. @item @t{@@guilsinglright@{@}} @tab @guilsinglright{} @tab Single right-pointing angle quotation mark (U+203A)
  8124. @end multitable
  8125. @cindex Auk, bird species
  8126. For the double angle quotation marks, Adobe and @LaTeX{} glyph names
  8127. are also supported: @code{@@guillemotleft} and
  8128. @code{@@guillemotright}. These names are incorrect; a
  8129. ``guillemot'' is a bird species (a type of auk).
  8130. Traditions for quotation mark usage vary to a great extent between
  8131. languages (@url{http://en.wikipedia.org/wiki/Quotation_mark}).
  8132. Texinfo does not provide commands or configurations for typesetting
  8133. quotation marks according to the numerous traditions. Therefore, you
  8134. have to choose the commands appropriate for the language of your
  8135. manual. Sometimes aliases (@pxref{@code{@@alias}}) can simplify the
  8136. usage and make the source code more readable. For example, in German,
  8137. @code{@@quotedblbase} is used for the left double quote, and the right
  8138. double quote is the glyph produced by @code{@@quotedblleft}, which is
  8139. counter-intuitive. Thus, in this case the following aliases would be
  8140. convenient:
  8141. @example
  8142. @@alias lgqq = quotedblbase
  8143. @@alias rgqq = quotedblleft
  8144. @end example
  8145. @node Inserting Subscripts and Superscripts
  8146. @section @code{@@sub} and @code{@@sup}: Inserting Subscripts and Superscripts
  8147. @findex sub
  8148. @findex sup
  8149. @cindex Subscripts and superscripts, text
  8150. You can insert subscripts and superscripts, in either text or math,
  8151. with the @code{@@sub} and @code{@@sup} commands. (For other
  8152. mathematical expressions, see the next section.) For example, here is
  8153. a purely textual subscript and superscript:
  8154. @example
  8155. here@@sub@{below@}@@sup@{above@}
  8156. @end example
  8157. @noindent produces:
  8158. @display
  8159. here@sub{below}@sup{above}
  8160. @end display
  8161. @cindex Math italic font
  8162. Inside @code{@@math}, @code{@@sub} and @code{@@sup} produce
  8163. mathematical subscripts and superscripts. This uses a different font
  8164. in the @TeX{} output (math italic instead of text italic); it makes no
  8165. difference in the other output formats. Here's an example:
  8166. @example
  8167. @@math@{e@@sup@{x@}@}
  8168. @end example
  8169. @noindent produces:
  8170. @display
  8171. @math{e@sup{x}}
  8172. @end display
  8173. In Info and plain text, regardless of being used inside @code{@@math},
  8174. @code{@@sub@{@var{text}@}} is output as @samp{_@{@var{text}@}} and
  8175. @code{@@sup@{@var{text}@}} as @samp{^@{@var{text}@}}, including the
  8176. literal braces (to mark the beginning and end of the ``script'' text
  8177. to the reader).
  8178. When the output format (and display program) permit (@TeX{} math,
  8179. HTML), the superscript is set above the subscript when both commands
  8180. are given consecutively.
  8181. @node Inserting Math
  8182. @section @code{@@math}: Inserting Mathematical Expressions
  8183. @anchor{math}@c old name
  8184. @findex math
  8185. @cindex Mathematical expressions, inserting
  8186. @cindex Formulas, mathematical
  8187. You can write a short mathematical expression with the @code{@@math}
  8188. command. Write the mathematical expression between braces, like this:
  8189. @example
  8190. @@math@{(a + b) = (b + a)@}
  8191. @end example
  8192. @iftex
  8193. @noindent This produces the following in @TeX{}:
  8194. @display
  8195. @math{(a + b) = (b + a)}
  8196. @end display
  8197. @noindent and the following in other formats:
  8198. @end iftex
  8199. @ifnottex
  8200. @noindent This produces the following in Info and HTML:
  8201. @end ifnottex
  8202. @example
  8203. (a + b) = (b + a)
  8204. @end example
  8205. @cindex MathML, not used
  8206. The @code{@@math} command has no special effect on the Info and HTML
  8207. output. @command{makeinfo} expands any @@-commands as usual, but it
  8208. does not try to use produce good mathematical formatting in any way
  8209. (no use of MathML, etc.). The HTML output is enclosed by
  8210. @code{<em>...</em>}, but nothing more.
  8211. @findex \mathopsup
  8212. However, as far as the @TeX{} output is concerned, plain @TeX{}
  8213. mathematical commands are allowed in @code{@@math}, starting with
  8214. @samp{\}. In essence, @code{@@math} switches into plain @TeX{} math
  8215. mode. (Exception: the plain @TeX{} command @code{\sup}, which
  8216. typesets the mathematical operator name `sup', must be accessed as
  8217. @code{\mathopsup}, due to the conflict with Texinfo's @code{@@sup}
  8218. command.)
  8219. This allows you to use all the plain @TeX{} math control sequences for
  8220. symbols, functions, and so on, and thus get proper formatting in the
  8221. @TeX{} output, at least.
  8222. The @code{@@sub} and @code{@@sup} commands described in the previous
  8223. section produce subscripts and superscripts in HTML output as well as
  8224. @TeX{}; the plain @TeX{} characters @code{_} and @code{^} for
  8225. subscripts and superscripts are recognized by @TeX{} inside
  8226. @code{@@math}, but do nothing special in HTML or other output formats.
  8227. It's best to use @samp{\} instead of @samp{@@} for any such
  8228. mathematical commands; otherwise, @command{makeinfo} will complain.
  8229. On the other hand, @command{makeinfo} does allow input with matching
  8230. (but unescaped) braces, such as @samp{k_@{75@}}; it complains about
  8231. such bare braces in regular input.
  8232. Here's an example:
  8233. @example
  8234. @@math@{\sin 2\pi \equiv \cos 3\pi@}
  8235. @end example
  8236. @iftex
  8237. @noindent which looks like this in @TeX{}:
  8238. @display
  8239. @math{\sin 2\pi \equiv \cos 3\pi}
  8240. @end display
  8241. @noindent but
  8242. @end iftex
  8243. @noindent which looks like the input in Info and HTML:
  8244. @example
  8245. \sin 2\pi \equiv \cos 3\pi
  8246. @end example
  8247. @findex @sortas{\} \ @r{(literal \ in @code{@@math})}
  8248. Since @samp{\} is an escape character inside @code{@@math}, you can
  8249. use @code{@@\} to get a literal backslash (@code{\\} will work in
  8250. @TeX{}, but you'd get the literal two characters @samp{\\} in Info).
  8251. @code{@@\} is not defined outside of @code{@@math}, since a @samp{\}
  8252. ordinarily produces a literal (typewriter) @samp{\}. You can also use
  8253. @code{@@backslashchar@{@}} in any mode to get a typewriter backslash.
  8254. @xref{Inserting a Backslash}.
  8255. @cindex Displayed equations
  8256. @cindex Equations, displayed
  8257. For displayed equations, you must at present use @TeX{} directly
  8258. (@pxref{Raw Formatter Commands}).
  8259. @node Glyphs for Text
  8260. @section Glyphs for Text
  8261. @anchor{Glyphs}@c old name
  8262. @anchor{TeX and copyright}@c another old node, now split into two
  8263. @cindex Glyphs for text
  8264. @cindex Textual glyphs
  8265. Texinfo has support for a few additional glyphs that are commonly used
  8266. in printed text but not available in ASCII@. Of course, there are
  8267. many thousands more. It is possible to use Unicode characters as-is
  8268. as far as @code{makeinfo} is concerned, but @TeX{} is not so lucky.
  8269. @menu
  8270. * @code{@@TeX @@LaTeX}:: The @TeX{} logos.
  8271. * @code{@@copyright}:: The copyright symbol (c in a circle).
  8272. * @code{@@registeredsymbol}:: The registered symbol (R in a circle).
  8273. * @code{@@dots}:: How to insert ellipses: @dots{} and @enddots{}
  8274. * @code{@@bullet}:: How to insert a bullet: @bullet{}
  8275. * @code{@@euro}:: How to insert the euro currency symbol.
  8276. * @code{@@pounds}:: How to insert the pounds currency symbol.
  8277. * @code{@@textdegree}:: How to insert the degrees symbol.
  8278. * @code{@@minus}:: How to insert a minus sign.
  8279. * @code{@@geq @@leq}:: How to insert greater/less-than-or-equal signs.
  8280. @end menu
  8281. @node @code{@@TeX @@LaTeX}
  8282. @subsection @code{@@TeX}@{@} (@TeX{}) and @code{@@LaTeX}@{@} (@LaTeX{})
  8283. @anchor{tex}@c old name
  8284. @findex TeX
  8285. @findex LaTeX
  8286. @cindex Logos, @TeX{}
  8287. @cindex @TeX{} logo
  8288. @cindex @LaTeX{} logo
  8289. Use the @code{@@TeX@{@}} command to generate `@TeX{}'. In a printed
  8290. manual, this is a special logo that is different from three ordinary
  8291. letters. In Info, it just looks like @samp{TeX}.
  8292. Similarly, use the @code{@@LaTeX@{@}} command to generate `@LaTeX{}',
  8293. which is even more special in printed manuals (and different from the
  8294. incorrect @code{La@@TeX@{@}}. In Info, the result is just
  8295. @samp{LaTeX}. (@LaTeX{} is another macro package built on top of
  8296. @TeX{}, very loosely analogous to Texinfo in that it emphasizes
  8297. logical structure, but much (much) larger.)
  8298. The spelling of these commands are unusual for Texinfo, in that they
  8299. use both uppercase and lowercase letters.
  8300. @node @code{@@copyright}
  8301. @subsection @code{@@copyright@{@}} (@copyright{})
  8302. @anchor{copyright symbol}@c old name
  8303. @findex copyright
  8304. @cindex Copyright symbol
  8305. Use the @code{@@copyright@{@}} command to generate the copyright
  8306. symbol, `@copyright{}'. Where possible, this is a @samp{c} inside a
  8307. circle; in Info, this is @samp{(C)}.
  8308. Legally, it's not necessary to use the copyright symbol; the English
  8309. word `Copyright' suffices, according to international treaty.
  8310. @node @code{@@registeredsymbol}
  8311. @subsection @code{@@registeredsymbol@{@}} (@registeredsymbol{})
  8312. @anchor{registered symbol}@c old name
  8313. @findex registeredsymbol
  8314. @cindex Registered symbol
  8315. Use the @code{@@registeredsymbol@{@}} command to generate the
  8316. registered symbol, `@registeredsymbol{}'. Where possible, this is an
  8317. @samp{R} inside a circle; in Info, this is @samp{(R)}.
  8318. @node @code{@@dots}
  8319. @subsection @code{@@dots} (@dots{}) and @code{@@enddots} (@enddots{})
  8320. @anchor{dots}@c old name
  8321. @findex dots
  8322. @findex enddots
  8323. @cindex Inserting dots
  8324. @cindex Inserting ellipsis
  8325. @cindex Dots, inserting
  8326. @cindex Ellipsis, inserting
  8327. @anchor{Dots Bullets}@c old name
  8328. An @dfn{ellipsis} (a sequence of dots) would be spaced wrong when
  8329. typeset as a string of periods, so a special command is used in
  8330. Texinfo: use the @code{@@dots@{@}} command to generate a normal
  8331. ellipsis, which is three dots in a row, appropriately spaced @dots{}
  8332. like so. To emphasize: do not simply write three periods in the input
  8333. file; that would work for the Info file output, but would produce the
  8334. wrong amount of space between the periods in the printed manual.
  8335. The @code{@@enddots@{@}} command generates an end-of-sentence
  8336. ellipsis, which also has three dots, but with different spacing
  8337. afterwards, @enddots{} Look closely to see the difference.
  8338. Here is an ellipsis: @dots{}
  8339. Here are three periods in a row: ...
  8340. In printed (and usually HTML) output, the three periods in a row are
  8341. much closer together than the dots in the ellipsis.
  8342. @node @code{@@bullet}
  8343. @subsection @code{@@bullet} (@bullet{})
  8344. @anchor{bullet}@c old name
  8345. @findex bullet
  8346. Use the @code{@@bullet@{@}} command to generate a large round dot, or
  8347. the closest possible thing to one. In Info, an asterisk is used.
  8348. Here is a bullet: @bullet{}
  8349. When you use @code{@@bullet} in @code{@@itemize}, you do not need to
  8350. type the braces, because @code{@@itemize} supplies them.
  8351. (@pxref{@code{@@itemize}}).
  8352. @node @code{@@euro}
  8353. @subsection @code{@@euro} (@euro{}): Euro Currency Symbol
  8354. @anchor{euro}@c old name
  8355. @findex euro
  8356. @cindex Euro symbol, producing
  8357. Use the @code{@@euro@{@}} command to generate `@euro{}'. Where
  8358. possible, this is the symbol for the Euro currency. Otherwise, the
  8359. word @samp{Euro} is used.
  8360. Texinfo cannot magically synthesize support for the Euro symbol where
  8361. the underlying system (fonts, software, whatever) does not support it.
  8362. Therefore, you may find it preferable to use the word ``Euro''. (In
  8363. banking contexts, the abbreviation for the Euro is EUR@.)
  8364. @cindex ISO 8859-15, and Euro
  8365. @cindex Latin 9, and Euro
  8366. In order to get the Euro symbol in encoded Info output, for example,
  8367. it is necessary to specify @code{@@documentencoding ISO-8859-15} or
  8368. @code{@@documentencoding UTF-8} (@xref{@code{@@documentencoding}}.)
  8369. The Euro symbol is in ISO 8859-15 (aka Latin@tie{}9), and is
  8370. @emph{not} in the more widely-used ISO 8859-1 (Latin@tie{}1).
  8371. @pindex feymr10
  8372. @cindex Euro font
  8373. The Euro symbol does not exist in the standard @TeX{} fonts (which
  8374. were designed before the Euro was legislated into existence).
  8375. Therefore, @TeX{} uses an additional font, named @code{feymr10} (along
  8376. with other variables). It is freely available, of course; you can
  8377. download it from @url{http://ctan.org/pkg/eurosym}, among other
  8378. places. The distribution includes installation instructions.
  8379. @node @code{@@pounds}
  8380. @subsection @code{@@pounds} (@pounds{}): Pounds Sterling
  8381. @anchor{pounds}@c old name
  8382. @findex pounds
  8383. @cindex Pounds symbol
  8384. Use the @code{@@pounds@{@}} command to generate `@pounds{}'. Where
  8385. possible, this is the symbol for the pounds sterling British currency.
  8386. Otherwise, it is @samp{#}.
  8387. @node @code{@@textdegree}
  8388. @subsection @code{@@textdegree} (@textdegree{}): Degrees Symbol
  8389. @anchor{textdegree}@c old name
  8390. @findex textdegree
  8391. @cindex Degree symbol
  8392. Use the @code{@@textdegree@{@}} command to generate `@textdegree{}'.
  8393. Where possible, this is the normal symbol for degrees. Otherwise,
  8394. it is an @samp{o}.
  8395. @node @code{@@minus}
  8396. @subsection @code{@@minus} (@minus{}): Inserting a Minus Sign
  8397. @anchor{minus}@c old name
  8398. @findex minus
  8399. @cindex Minus sign
  8400. @cindex Em dash, compared to minus sign
  8401. @cindex Hyphen, compared to minus
  8402. Use the @code{@@minus@{@}} command to generate a minus sign. In a
  8403. fixed-width font, this is a single hyphen, but in a proportional font,
  8404. the symbol is the customary length for a minus sign---a little longer
  8405. than a hyphen, shorter than an em-dash:
  8406. @display
  8407. @samp{@minus{}} is a minus sign generated with @samp{@@minus@{@}},
  8408. `-' is a hyphen generated with the character @samp{-},
  8409. `---' is an em-dash for text.
  8410. @end display
  8411. @noindent
  8412. In the fixed-width font used by Info, @code{@@minus@{@}} is the same
  8413. as a hyphen.
  8414. You should not use @code{@@minus@{@}} inside @code{@@code} or
  8415. @code{@@example} because the width distinction is not made in the
  8416. fixed-width font they use.
  8417. When you use @code{@@minus} to specify the mark beginning each entry
  8418. in an itemized list, you do not need to type the braces
  8419. (@pxref{@code{@@itemize}}).
  8420. If you actually want to typeset some math that does a subtraction, it
  8421. is better to use @code{@@math}. Then the regular @samp{-} character
  8422. produces a minus sign, as in @code{@@math@{a-b@}} (@pxref{Inserting
  8423. Math}).
  8424. @node @code{@@geq @@leq}
  8425. @subsection @code{@@geq} (@geq{}) and @code{@@leq} (@leq{}): Inserting Relations
  8426. @anchor{geq leq}@c old name
  8427. @findex geq
  8428. @findex leq
  8429. Use the @code{@@geq@{@}} and @code{@@leq@{@}} commands to generate
  8430. greater-than-or-equal and less-than-equal-signs, `@geq{}' and
  8431. `@leq{}'. When those symbols are not available, the ASCII sequences
  8432. @samp{>=} and @samp{<=} are output.
  8433. @node Glyphs for Programming
  8434. @section Glyphs for Programming
  8435. @cindex Glyphs for programming
  8436. @cindex Examples, glyphs for
  8437. @cindex Programming, glyphs for
  8438. In Texinfo, code is often illustrated in examples that are delimited
  8439. by @code{@@example} and @code{@@end example}, or by @code{@@lisp} and
  8440. @code{@@end lisp}. In such examples, you can indicate the results of
  8441. evaluation or an expansion using @samp{@result{}} or
  8442. @samp{@expansion{}}. Likewise, there are commands to insert glyphs to
  8443. indicate printed output, error messages, equivalence of expressions,
  8444. the location of point in an editor, and GUI operation sequences.
  8445. The glyph-insertion commands do not need to be used within an example,
  8446. but most often they are. All glyph-insertion commands are followed by
  8447. empty braces.
  8448. @menu
  8449. * Glyphs Summary::
  8450. * @code{@@result}:: How to show the result of expression.
  8451. * @code{@@expansion}:: How to indicate an expansion.
  8452. * @code{@@print}:: How to indicate generated output.
  8453. * @code{@@error}:: How to indicate an error message.
  8454. * @code{@@equiv}:: How to indicate equivalence.
  8455. * @code{@@point}:: How to indicate the location of point.
  8456. * Click Sequences:: Inserting GUI usage sequences.
  8457. @end menu
  8458. @node Glyphs Summary
  8459. @subsection Glyphs Summary
  8460. Here is a summary of the glyph commands:
  8461. @table @asis
  8462. @item @result{}
  8463. @code{@@result@{@}} indicates the result of an expression.
  8464. @item @expansion{}
  8465. @code{@@expansion@{@}} indicates the results of a macro expansion.
  8466. @item @print{}
  8467. @code{@@print@{@}} indicates printed output.
  8468. @item @error{}
  8469. @code{@@error@{@}} indicates the following text is an error message.
  8470. @item @equiv{}
  8471. @code{@@equiv@{@}} indicates the exact equivalence of two forms.
  8472. @item @point{}
  8473. @code{@@point@{@}} shows the location of point.
  8474. @item @clicksequence{A @click{} B}
  8475. @code{@@clicksequence@{A @@click@{@} B} indicates a GUI operation
  8476. sequence: first A, then clicking B, or choosing B from a menu, or
  8477. otherwise selecting it.
  8478. @end table
  8479. @node @code{@@result}
  8480. @subsection @code{@@result@{@}} (@result{}): Result of an Expression
  8481. @anchor{result}@c old name
  8482. @findex result
  8483. @cindex Result of an expression
  8484. @cindex Indicating evaluation
  8485. @cindex Evaluation glyph
  8486. @cindex Value of an expression, indicating
  8487. Use the @code{@@result@{@}} command to indicate the result of
  8488. evaluating an expression.
  8489. The @code{@@result@{@}} command is displayed as @samp{@result{}},
  8490. either a double stemmed arrow or (when that is not available) the
  8491. ASCII sequence @samp{=>}.
  8492. Thus, the following,
  8493. @lisp
  8494. (cdr '(1 2 3))
  8495. @result{} (2 3)
  8496. @end lisp
  8497. @noindent
  8498. may be read as ``@code{(cdr '(1 2 3))} evaluates to @code{(2 3)}''.
  8499. @node @code{@@expansion}
  8500. @subsection @code{@@expansion@{@}} (@expansion{}): Indicating an Expansion
  8501. @anchor{expansion}@c old name
  8502. @cindex Expansion, indicating
  8503. @cindex Macro expansion, indicating
  8504. @findex expansion
  8505. When an expression is a macro call, it expands into a new expression.
  8506. You can indicate the result of the expansion with the
  8507. @code{@@expansion@{@}} command.
  8508. The @code{@@expansion@{@}} command is displayed as
  8509. @samp{@expansion{}}, either a long arrow with a flat base or (when
  8510. that is not available) the ASCII sequence @samp{==>}.
  8511. @need 700
  8512. For example, the following
  8513. @example
  8514. @group
  8515. @@lisp
  8516. (third '(a b c))
  8517. @@expansion@{@} (car (cdr (cdr '(a b c))))
  8518. @@result@{@} c
  8519. @@end lisp
  8520. @end group
  8521. @end example
  8522. @noindent
  8523. produces
  8524. @lisp
  8525. @group
  8526. (third '(a b c))
  8527. @expansion{} (car (cdr (cdr '(a b c))))
  8528. @result{} c
  8529. @end group
  8530. @end lisp
  8531. @noindent
  8532. which may be read as:
  8533. @quotation
  8534. @code{(third '(a b c))} expands to @code{(car (cdr (cdr '(a b c))))};
  8535. the result of evaluating the expression is @code{c}.
  8536. @end quotation
  8537. @noindent
  8538. Often, as in this case, an example looks better if the
  8539. @code{@@expansion@{@}} and @code{@@result@{@}} commands are indented.
  8540. @node @code{@@print}
  8541. @subsection @code{@@print@{@}} (@print{}): Indicating Generated Output
  8542. @anchor{Print Glyph}@c old name
  8543. @findex print
  8544. @cindex Printed output, indicating
  8545. Sometimes an expression will generate output during its execution.
  8546. You can indicate such displayed output with the @code{@@print@{@}}
  8547. command.
  8548. The @code{@@print@{@}} command is displayed as @samp{@print{}}, either
  8549. a horizontal dash butting against a vertical bar or (when that is not
  8550. available) the ASCII sequence @samp{-|}.
  8551. In the following example, the printed text is indicated with
  8552. @samp{@print{}}, and the value of the expression follows on the
  8553. last line.
  8554. @lisp
  8555. @group
  8556. (progn (print 'foo) (print 'bar))
  8557. @print{} foo
  8558. @print{} bar
  8559. @result{} bar
  8560. @end group
  8561. @end lisp
  8562. @noindent
  8563. In a Texinfo source file, this example is written as follows:
  8564. @lisp
  8565. @group
  8566. @@lisp
  8567. (progn (print 'foo) (print 'bar))
  8568. @@print@{@} foo
  8569. @@print@{@} bar
  8570. @@result@{@} bar
  8571. @@end lisp
  8572. @end group
  8573. @end lisp
  8574. @node @code{@@error}
  8575. @subsection @code{@@error@{@}} (@error{}): Indicating an Error Message
  8576. @anchor{Error Glyph}@c old name
  8577. @cindex Error message, indicating
  8578. @findex error
  8579. A piece of code may cause an error when you evaluate it. You can
  8580. designate the error message with the @code{@@error@{@}} command.
  8581. The @code{@@error@{@}} command is displayed as @samp{@error{}}, either
  8582. the word `error' in a box in the printed output, the word error
  8583. followed by an arrow in other formats or (when no arrow is available)
  8584. @samp{error-->}.
  8585. @need 700
  8586. Thus,
  8587. @example
  8588. @@lisp
  8589. (+ 23 'x)
  8590. @@error@{@} Wrong type argument: integer-or-marker-p, x
  8591. @@end lisp
  8592. @end example
  8593. @noindent
  8594. produces
  8595. @lisp
  8596. (+ 23 'x)
  8597. @error{} Wrong type argument: integer-or-marker-p, x
  8598. @end lisp
  8599. @noindent
  8600. This indicates that the following error message is printed
  8601. when you evaluate the expression:
  8602. @lisp
  8603. Wrong type argument: integer-or-marker-p, x
  8604. @end lisp
  8605. The word @samp{@error{}} itself is not part of the error message.
  8606. @node @code{@@equiv}
  8607. @subsection @code{@@equiv@{@}} (@equiv{}): Indicating Equivalence
  8608. @anchor{Equivalence}@c oldname
  8609. @cindex Equivalence, indicating
  8610. @findex equiv
  8611. Sometimes two expressions produce identical results. You can indicate
  8612. the exact equivalence of two forms with the @code{@@equiv@{@}}
  8613. command. The @code{@@equiv@{@}} command is displayed as
  8614. @samp{@equiv{}}, either a standard mathematical equivalence sign
  8615. (three parallel horizontal lines) or (when that is not available) as
  8616. the ASCII sequence @samp{==}.
  8617. Thus,
  8618. @example
  8619. @@lisp
  8620. (make-sparse-keymap) @@equiv@{@} (list 'keymap)
  8621. @@end lisp
  8622. @end example
  8623. @noindent
  8624. produces
  8625. @lisp
  8626. (make-sparse-keymap) @equiv{} (list 'keymap)
  8627. @end lisp
  8628. @noindent
  8629. This indicates that evaluating @code{(make-sparse-keymap)} produces
  8630. identical results to evaluating @code{(list 'keymap)}.
  8631. @node @code{@@point}
  8632. @subsection @code{@@point@{@}} (@point{}): Indicating Point in a Buffer
  8633. @anchor{Point Glyph}@c old name
  8634. @cindex Point, indicating in a buffer
  8635. @findex point
  8636. Sometimes you need to show an example of text in an Emacs buffer. In
  8637. such examples, the convention is to include the entire contents of the
  8638. buffer in question between two lines of dashes containing the buffer
  8639. name.
  8640. You can use the @samp{@@point@{@}} command to show the location of
  8641. point in the text in the buffer. (The symbol for point, of course, is
  8642. not part of the text in the buffer; it indicates the place
  8643. @emph{between} two characters where point is located.)
  8644. The @code{@@point@{@}} command is displayed as @samp{@point{}}, either
  8645. a pointed star or (when that is not available) the ASCII sequence
  8646. @samp{-!-}.
  8647. The following example shows the contents of buffer @file{foo} before
  8648. and after evaluating a Lisp command to insert the word @code{changed}.
  8649. @example
  8650. @group
  8651. ---------- Buffer: foo ----------
  8652. This is the @point{}contents of foo.
  8653. ---------- Buffer: foo ----------
  8654. @end group
  8655. @end example
  8656. @example
  8657. @group
  8658. (insert "changed ")
  8659. @result{} nil
  8660. ---------- Buffer: foo ----------
  8661. This is the changed @point{}contents of foo.
  8662. ---------- Buffer: foo ----------
  8663. @end group
  8664. @end example
  8665. In a Texinfo source file, the example is written like this:
  8666. @example
  8667. @@example
  8668. ---------- Buffer: foo ----------
  8669. This is the @@point@{@}contents of foo.
  8670. ---------- Buffer: foo ----------
  8671. (insert "changed ")
  8672. @@result@{@} nil
  8673. ---------- Buffer: foo ----------
  8674. This is the changed @@point@{@}contents of foo.
  8675. ---------- Buffer: foo ----------
  8676. @@end example
  8677. @end example
  8678. @node Click Sequences
  8679. @subsection Click Sequences
  8680. @cindex Click sequences
  8681. @cindex Sequence of clicks
  8682. @cindex GUI click sequence
  8683. @findex clicksequence
  8684. When documenting graphical interfaces, it is necessary to describe
  8685. sequences such as `Click on @samp{File}, then choose @samp{Open}, then
  8686. @dots{}'. Texinfo offers commands @code{@@clicksequence} and
  8687. @code{click} to represent this, typically used like this:
  8688. @example
  8689. @dots{} @@clicksequence@{File @@click@{@} Open@} @dots{}
  8690. @end example
  8691. @noindent
  8692. which produces:
  8693. @display
  8694. @dots{} @clicksequence{File @click{} Open} @dots{}
  8695. @end display
  8696. @findex click
  8697. @findex arrow
  8698. The @code{@@click} command produces a right arrow by default; this
  8699. glyph is also available independently via the command
  8700. @code{@@arrow@{@}}.
  8701. @findex clickstyle
  8702. You can change the glyph produced by @code{@@click} with the command
  8703. @code{@@clickstyle}, which takes a command name as its single argument
  8704. on the rest of the line, much like @code{@@itemize} and friends
  8705. (@pxref{@code{@@itemize}}). The command should produce a glyph, and
  8706. the usual empty braces @samp{@{@}} are omitted. Here's an example:
  8707. @example
  8708. @@clickstyle @@result
  8709. @dots{} @@clicksequence@{File @@click@{@} Open@} @dots{}
  8710. @end example
  8711. @noindent
  8712. now produces:
  8713. @display
  8714. @clickstyle @result
  8715. @dots{} @clicksequence{File @click{} Open} @dots{}
  8716. @end display
  8717. @node Inserting Unicode
  8718. @section Inserting Unicode: @code{@@U}
  8719. @cindex Unicode character, inserting
  8720. @cindex Code point of Unicode character, inserting by
  8721. @findex U
  8722. The command @code{@@U@{@var{hex}@}} inserts a representation of the
  8723. Unicode character U+@var{hex}. For example, @code{@@U@{0132@}}
  8724. inserts the Dutch `IJ' ligature (poorly shown here as simply the two
  8725. letters `I' and `J').
  8726. The @var{hex} value should be at least four hex digits; leading zeros
  8727. are @emph{not} added. In general, @var{hex} must specify a valid
  8728. normal Unicode character; e.g., U+10FFFF (the very last code point) is
  8729. invalid by definition, and thus cannot be inserted this way.
  8730. @cindex ASCII, source document portability using
  8731. @code{@@U} is useful for inserting occasional glyphs for which Texinfo
  8732. has no dedicated command, while allowing the Texinfo source to remain
  8733. purely 7-bit ASCII for maximum portability.
  8734. @cindex Unicode and @TeX{}
  8735. This command has many limitations---the same limitations as inserting
  8736. Unicode characters in UTF-8 or another binary form. First and most
  8737. importantly, @TeX{} knows nothing about most of Unicode. Supporting
  8738. specific additional glyphs upon request is possible, but it's not
  8739. viable for @file{texinfo.tex} to support whole additional scripts
  8740. (Japanese, Urdu, @dots{}). The @code{@@U} command does nothing to
  8741. change this. If the specified character is not supported in @TeX{},
  8742. an error is given. (@xref{@code{@@documentencoding}}.)
  8743. @cindex Entity reference in HTML et al.
  8744. @cindex @samp{&#x@var{hex};}, output from @code{@@U}
  8745. In HTML, XML, and Docbook, the output from @code{@@U} is always an
  8746. entity reference of the form @samp{&#x@var{hex};}, as in
  8747. @samp{&#x0132;} for the example above. This should work even when an
  8748. HTML document uses some other encoding (say, Latin@tie{}1) and the
  8749. given character is not supported in that encoding.
  8750. @cindex UTF-8, output from @code{@@U}
  8751. In Info and plain text, if the document encoding is specified
  8752. explicitly to be UTF-8, the output will be the UTF-8 representation of
  8753. the character U+@var{hex} (presuming it's a valid character). In all
  8754. other cases, the output is the ASCII sequence @samp{U+@var{hex}}, as
  8755. in the six ASCII characters @samp{U+0132} for the example above.
  8756. That's all. No magic!
  8757. @node Breaks
  8758. @chapter Forcing and Preventing Breaks
  8759. @cindex Forcing line and page breaks
  8760. @cindex Making line and page breaks
  8761. @cindex Preventing line and page breaks
  8762. @cindex Line breaks, awkward
  8763. @cindex Page breaks, awkward
  8764. Line and page breaks can sometimes occur in the `wrong' place in one
  8765. or another form of output. It's up to you to ensure that text looks
  8766. right in all the output formats.
  8767. For example, in a printed manual, page breaks may occur awkwardly in
  8768. the middle of an example; to prevent this, you can hold text together
  8769. using a grouping command that keeps the text from being split across
  8770. two pages. Conversely, you may want to force a page break where none
  8771. would occur normally.
  8772. You can use the break, break prevention, or pagination commands to fix
  8773. problematic line and page breaks.
  8774. @menu
  8775. * Break Commands:: Summary of break-related commands.
  8776. * Line Breaks:: Forcing line breaks.
  8777. * @code{@@- @@hyphenation}:: Helping @TeX{} with hyphenation points.
  8778. * @code{@@allowcodebreaks}:: Controlling line breaks within @@code text.
  8779. * @code{@@w}:: Preventing unwanted line breaks in text.
  8780. * @code{@@tie}:: Inserting an unbreakable but varying space.
  8781. * @code{@@sp}:: Inserting blank lines.
  8782. * @code{@@page}:: Forcing the start of a new page.
  8783. * @code{@@group}:: Preventing unwanted page breaks.
  8784. * @code{@@need}:: Another way to prevent unwanted page breaks.
  8785. @end menu
  8786. @node Break Commands
  8787. @section Break Commands
  8788. The break commands create or allow line and paragraph breaks:
  8789. @table @code
  8790. @item @@*
  8791. Force a line break.
  8792. @item @@sp @var{n}
  8793. Skip @var{n} blank lines.
  8794. @item @@-
  8795. Insert a discretionary hyphen.
  8796. @item @@hyphenation@{@var{hy-phen-a-ted words}@}
  8797. Define hyphen points in @var{hy-phen-a-ted words}.
  8798. @end table
  8799. These commands hold text together on a single line:
  8800. @table @code
  8801. @item @@w@{@var{text}@}
  8802. Prevent @var{text} from being split and hyphenated across two lines.
  8803. @item @@tie@{@}
  8804. Insert a normal interword space at which a line break may not occur.
  8805. @end table
  8806. The pagination commands apply only to printed output, since other
  8807. output formats do not have pages.
  8808. @table @code
  8809. @item @@page
  8810. Start a new page.
  8811. @item @@group
  8812. Hold text together that must appear on one page.
  8813. @item @@need @var{mils}
  8814. Start a new page if not enough space on this one.
  8815. @end table
  8816. @node Line Breaks
  8817. @section @code{@@*} and @code{@@/}: Generate and Allow Line Breaks
  8818. @findex * @r{(force line break)}
  8819. @findex / @r{(allow line break)}
  8820. @cindex Line breaks, controlling
  8821. @cindex Controlling line breaks
  8822. @cindex Breaks in a line
  8823. @cindex Force line break
  8824. @cindex Allow line break
  8825. The @code{@@*} command forces a line break in all output formats.
  8826. The @code{@@/} command allows a line break (printed manual only).
  8827. Here is an example with @code{@@*}:
  8828. @example
  8829. This sentence is broken @@*into two lines.
  8830. @end example
  8831. @noindent produces
  8832. @example
  8833. @group
  8834. This sentence is broken
  8835. into two lines.
  8836. @end group
  8837. @end example
  8838. The @code{@@/} command can be useful within long urls or other
  8839. identifiers where @TeX{} can't find a good place to break. @TeX{}
  8840. will automatically break urls at the natural places (@pxref{URL Line
  8841. Breaking}), so only use @code{@@/} if you need it. @code{@@/} has no
  8842. effect in the other output format.
  8843. @node @code{@@- @@hyphenation}
  8844. @section @code{@@-} and @code{@@hyphenation}: Helping @TeX{} Hyphenate
  8845. @anchor{- and hyphenation}@c old name
  8846. @findex @sortas{-} - @r{(discretionary hyphen)}
  8847. @findex hyphenation
  8848. @cindex Hyphenation, helping @TeX{} do
  8849. @cindex Fine-tuning, and hyphenation
  8850. Although @TeX{}'s hyphenation algorithm is generally pretty good, it
  8851. does miss useful hyphenation points from time to time. (Or, far more
  8852. rarely, insert an incorrect hyphenation.) So, for documents with an
  8853. unusual vocabulary or when fine-tuning for a printed edition, you may
  8854. wish to help @TeX{} out. Texinfo supports two commands for this:
  8855. @table @code
  8856. @item @@-
  8857. Insert a discretionary hyphen, i.e., a place where @TeX{} can (but does
  8858. not have to) hyphenate. This is especially useful when you notice an
  8859. overfull hbox is due to @TeX{} missing a hyphenation (@pxref{Overfull
  8860. hboxes}). @TeX{} will not insert any hyphenation points itself into a
  8861. word containing @code{@@-}.
  8862. @item @@hyphenation@{@var{hy-phen-a-ted words}@}
  8863. Tell @TeX{} how to hyphenate @var{hy-phen-a-ted words}. As shown, you
  8864. put a @samp{-} at each hyphenation point. For example:
  8865. @example
  8866. @@hyphenation@{man-u-script man-u-scripts@}
  8867. @end example
  8868. @noindent @TeX{} only uses the specified hyphenation points when the
  8869. words match exactly, so give all necessary variants, such as plurals.
  8870. @end table
  8871. Info, HTML, and other non-@TeX{} output is not hyphenated, so none of
  8872. these commands have any effect there.
  8873. @node @code{@@allowcodebreaks}
  8874. @section @code{@@allowcodebreaks}: Control Line Breaks in @code{@@code}
  8875. @anchor{allowcodebreaks}@c old name
  8876. @findex allowcodebreaks
  8877. @cindex Breaks, within @code{@@code}
  8878. @cindex @sortas{-} -, breakpoint within @code{@@code}
  8879. @cindex Hyphen, breakpoint within @code{@@code}
  8880. @cindex Dash, breakpoint within @code{@@code}
  8881. @cindex _, breakpoint within @code{@@code}
  8882. @cindex Underscore, breakpoint within @code{@@code}
  8883. Ordinarily, @TeX{} considers breaking lines at @samp{-} and @samp{_}
  8884. characters within @code{@@code} and related commands
  8885. (@pxref{@code{@@code}}), more or less as if they were ``empty''
  8886. hyphenation points.
  8887. This is necessary since many manuals, especially for Lisp-family
  8888. languages, must document very long identifiers. On the other hand,
  8889. some manuals don't have this problems, and you may not wish to allow a
  8890. line break at the underscore in, for example, @code{SIZE_MAX}, or even
  8891. worse, after any of the four underscores in @code{__typeof__}.
  8892. So Texinfo provides this command:
  8893. @example
  8894. @@allowcodebreaks false
  8895. @end example
  8896. @noindent to prevent from breaking at @samp{-} or @samp{_} within
  8897. @code{@@code}. You can go back to allowing such breaks with
  8898. @code{@@allowcodebreaks true}. Write these commands on lines by
  8899. themselves.
  8900. These commands can be given anywhere in the document. For example,
  8901. you may have just one problematic paragraph where you need to turn off
  8902. the breaks, but want them in general, or vice versa.
  8903. This command has no effect except in HTML and @TeX{} output.
  8904. @node @code{@@w}
  8905. @section @code{@@w}@{@var{text}@}: Prevent Line Breaks
  8906. @anchor{w}@c old name
  8907. @findex w
  8908. @cindex Line breaks, preventing
  8909. @code{@@w@{@var{text}@}} outputs @var{text}, while prohibiting line
  8910. breaks within @var{text}.
  8911. @cindex Non-breakable space, fixed
  8912. @cindex Unbreakable space, fixed
  8913. Thus, you can use @code{@@w} to produce a non-breakable space, fixed at
  8914. the width of a normal interword space:
  8915. @example
  8916. @@w@{ @} @@w@{ @} @@w@{ @} indentation.
  8917. @end example
  8918. @noindent produces:
  8919. @display
  8920. @w{ } @w{ } @w{ } indentation.
  8921. @end display
  8922. The space from @code{@@w@{@w{ }@}}, as well as being non-breakable,
  8923. also will not stretch or shrink. Sometimes that is what you want, for
  8924. instance if you're doing manual indenting. However, usually you want
  8925. a normal interword space that does stretch and shrink (in the printed
  8926. output); for that, see the @code{@@tie} command in the next section.
  8927. @cindex Hyphenation, preventing
  8928. You can also use the @code{@@w} command to prevent @TeX{} from
  8929. automatically hyphenating a long name or phrase that happens to fall
  8930. near the end of a line. @command{makeinfo} does not ever hyphenate
  8931. words.
  8932. @cindex Keyword expansion, preventing
  8933. @cindex Version control keywords, preventing expansion of
  8934. @cindex $Id expansion, preventing
  8935. You can also use @code{@@w} to avoid unwanted keyword expansion in
  8936. source control systems. For example, to literally write @t{@w{$}Id$}
  8937. in your document, use @code{@@w@{$@}Id$}. This trick isn't effective
  8938. in Info or plain text output, though.
  8939. @node @code{@@tie}
  8940. @section @code{@@tie@{@}}: Inserting an Unbreakable Space
  8941. @anchor{tie}@c old name
  8942. @findex tie @r{(unbreakable interword space)}
  8943. @cindex Tied space
  8944. @cindex Non-breakable space, variable
  8945. @cindex Unbreakable space, variable
  8946. The @code{@@tie@{@}} command produces a normal interword space at which
  8947. a line break may not occur. Always write it with following (empty)
  8948. braces, as usual for commands used within a paragraph. Here's an
  8949. example:
  8950. @example
  8951. @@TeX@{@} was written by Donald E.@@tie@{@}Knuth.
  8952. @end example
  8953. @noindent produces:
  8954. @display
  8955. @TeX{} was written by Donald E.@tie{}Knuth.
  8956. @end display
  8957. There are two important differences between @code{@@tie@{@}} and
  8958. @code{@@w@{@w{ }@}}:
  8959. @itemize
  8960. @item
  8961. The space produced by @code{@@tie@{@}} will stretch and shrink slightly
  8962. along with the normal interword spaces in the paragraph; the space
  8963. produced by @code{@@w@{@w{ }@}} will not vary.
  8964. @item
  8965. @code{@@tie@{@}} allows hyphenation of the surrounding words, while
  8966. @code{@@w@{@w{ }@}} inhibits hyphenation of those words (for @TeX{}nical
  8967. reasons, namely that it produces an @samp{\hbox}).
  8968. @end itemize
  8969. @node @code{@@sp}
  8970. @section @code{@@sp} @var{n}: Insert Blank Lines
  8971. @anchor{sp}@c old name
  8972. @findex sp @r{(line spacing)}
  8973. @cindex Space, inserting vertical
  8974. @cindex Blank lines
  8975. @cindex Line spacing
  8976. A line beginning with and containing only @code{@@sp @var{n}}
  8977. generates @var{n} blank lines of space in both the printed manual and
  8978. the Info file. @code{@@sp} also forces a paragraph break. For
  8979. example,
  8980. @example
  8981. @@sp 2
  8982. @end example
  8983. @noindent
  8984. generates two blank lines.
  8985. The @code{@@sp} command is most often used in the title page.
  8986. @node @code{@@page}
  8987. @section @code{@@page}: Start a New Page
  8988. @anchor{page}@c old name
  8989. @findex page
  8990. @cindex Page breaks, forcing
  8991. A line containing only @code{@@page} starts a new page in a printed
  8992. manual. In other formats, without the concept of pages, it starts a
  8993. new paragraph. A @code{@@page} command is often used in the
  8994. @code{@@titlepage} section of a Texinfo file to start the copyright
  8995. page.
  8996. @node @code{@@group}
  8997. @section @code{@@group}: Prevent Page Breaks
  8998. @anchor{group}@c old name
  8999. @findex group
  9000. @cindex Group (hold text together vertically)
  9001. @cindex Holding text together vertically
  9002. @cindex Vertically holding text together
  9003. The @code{@@group} command (on a line by itself) is used inside an
  9004. @code{@@example} or similar construct to begin an unsplittable vertical
  9005. group, which will appear entirely on one page in the printed output.
  9006. The group is terminated by a line containing only @code{@@end group}.
  9007. These two lines produce no output of their own, and in the Info file
  9008. output they have no effect at all.
  9009. @c Once said that these environments
  9010. @c turn off vertical spacing between ``paragraphs''.
  9011. @c Also, quotation used to work, but doesn't in texinfo-2.72
  9012. Although @code{@@group} would make sense conceptually in a wide
  9013. variety of contexts, its current implementation works reliably only
  9014. within @code{@@example} and variants, and within @code{@@display},
  9015. @code{@@format}, @code{@@flushleft} and @code{@@flushright}.
  9016. @xref{Quotations and Examples}. (What all these commands have in
  9017. common is that each line of input produces a line of output.) In
  9018. other contexts, @code{@@group} can cause anomalous vertical
  9019. spacing.
  9020. @need 750
  9021. This formatting requirement means that you should write:
  9022. @example
  9023. @group
  9024. @@example
  9025. @@group
  9026. @dots{}
  9027. @@end group
  9028. @@end example
  9029. @end group
  9030. @end example
  9031. @noindent
  9032. with the @code{@@group} and @code{@@end group} commands inside the
  9033. @code{@@example} and @code{@@end example} commands.
  9034. The @code{@@group} command is most often used to hold an example
  9035. together on one page. In this Texinfo manual, more than 100 examples
  9036. contain text that is enclosed between @code{@@group} and @code{@@end
  9037. group}.
  9038. If you forget to end a group, you may get strange and unfathomable
  9039. error messages when you run @TeX{}. This is because @TeX{} keeps
  9040. trying to put the rest of the Texinfo file onto the one page and does
  9041. not start to generate error messages until it has processed
  9042. considerable text. It is a good rule of thumb to look for a missing
  9043. @code{@@end group} if you get incomprehensible error messages in
  9044. @TeX{}.
  9045. @node @code{@@need}
  9046. @section @code{@@need @var{mils}}: Prevent Page Breaks
  9047. @anchor{need}@c old name
  9048. @findex need
  9049. @cindex Need space at page bottom
  9050. @cindex Mils, argument to @code{@@need}
  9051. A line containing only @code{@@need @var{n}} starts a new page in a
  9052. printed manual if fewer than @var{n} mils (thousandths of an inch)
  9053. remain on the current page. Do not use braces around the argument
  9054. @var{n}. The @code{@@need} command has no effect on other output
  9055. formats since they are not paginated.
  9056. @need 800
  9057. This paragraph is preceded by a @code{@@need} command that tells
  9058. @TeX{} to start a new page if fewer than 800 mils (eight-tenths
  9059. inch) remain on the page. It looks like this:
  9060. @example
  9061. @group
  9062. @@need 800
  9063. This paragraph is preceded by @dots{}
  9064. @end group
  9065. @end example
  9066. @cindex Orphans, preventing
  9067. The @code{@@need} command is useful for preventing orphans: single
  9068. lines at the bottoms of printed pages.
  9069. @node Definition Commands
  9070. @chapter Definition Commands
  9071. @cindex Definition commands
  9072. The @code{@@deffn} command and the other @dfn{definition commands}
  9073. enable you to describe functions, variables, macros, commands, user
  9074. options, special forms and other such artifacts in a uniform
  9075. format.
  9076. In the Info file, a definition causes the entity
  9077. category---`Function', `Variable', or whatever---to appear at the
  9078. beginning of the first line of the definition, followed by the
  9079. entity's name and arguments. In the printed manual, the command
  9080. causes @TeX{} to print the entity's name and its arguments on the left
  9081. margin and print the category next to the right margin. In both
  9082. output formats, the body of the definition is indented. Also, the
  9083. name of the entity is entered into the appropriate index:
  9084. @code{@@deffn} enters the name into the index of functions,
  9085. @code{@@defvr} enters it into the index of variables, and so
  9086. on (@pxref{Predefined Indices}).
  9087. A manual need not and should not contain more than one definition for
  9088. a given name. An appendix containing a summary should use
  9089. @code{@@table} rather than the definition commands.
  9090. @menu
  9091. * Def Cmd Template:: Writing descriptions using definition commands.
  9092. * Def Cmd Continuation Lines:: Continuing the heading over source lines.
  9093. * Optional Arguments:: Handling optional and repeated arguments.
  9094. * @code{@@deffnx}:: Group two or more `first' lines.
  9095. * Def Cmds in Detail:: Reference for all the definition commands.
  9096. * Def Cmd Conventions:: Conventions for writing definitions.
  9097. * Sample Function Definition:: An example.
  9098. @end menu
  9099. @node Def Cmd Template
  9100. @section The Template for a Definition
  9101. @cindex Definition template
  9102. @cindex Template for a definition
  9103. The @code{@@deffn} command is used for definitions of entities that
  9104. resemble functions. To write a definition using the @code{@@deffn}
  9105. command, write the @code{@@deffn} command at the beginning of a line
  9106. and follow it on the same line by the category of the entity, the name
  9107. of the entity itself, and its arguments (if any). Then write the body
  9108. of the definition on succeeding lines. (You may embed examples in the
  9109. body.) Finally, end the definition with an @code{@@end deffn} command
  9110. written on a line of its own.
  9111. The other definition commands follow the same format: a line with the
  9112. @code{@@def@dots{}} command and whatever arguments are appropriate for
  9113. that command; the body of the definition; and a corresponding
  9114. @code{@@end} line.
  9115. The template for a definition looks like this:
  9116. @example
  9117. @group
  9118. @@deffn @var{category} @var{name} @var{arguments}@dots{}
  9119. @var{body-of-definition}
  9120. @@end deffn
  9121. @end group
  9122. @end example
  9123. @need 700
  9124. @noindent
  9125. For example,
  9126. @example
  9127. @group
  9128. @@deffn Command forward-word count
  9129. This command moves point forward @@var@{count@} words
  9130. (or backward if @@var@{count@} is negative). @dots{}
  9131. @@end deffn
  9132. @end group
  9133. @end example
  9134. @noindent
  9135. produces
  9136. @quotation
  9137. @deffn Command forward-word count
  9138. This command moves point forward @var{count} words
  9139. (or backward if @var{count} is negative). @dots{}
  9140. @end deffn
  9141. @end quotation
  9142. Capitalize the category name like a title. If the name of the
  9143. category contains spaces, as in the phrase `Interactive Command',
  9144. enclose it in braces. For example:
  9145. @example
  9146. @group
  9147. @@deffn @{Interactive Command@} isearch-forward
  9148. @dots{}
  9149. @@end deffn
  9150. @end group
  9151. @end example
  9152. @noindent
  9153. Otherwise, the second word will be mistaken for the name of the
  9154. entity. As a general rule, when any of the arguments in the heading
  9155. line @emph{except} the last one are more than one word, you need to
  9156. enclose them in braces. This may also be necessary if the text
  9157. contains commands, for example, @samp{@{declaraci@@'on@}} if you are
  9158. writing in Spanish.
  9159. Some of the definition commands are more general than others. The
  9160. @code{@@deffn} command, for example, is the general definition command
  9161. for functions and the like---for entities that may take arguments.
  9162. When you use this command, you specify the category to which the
  9163. entity belongs. Three predefined, specialized variations
  9164. (@code{@@defun}, @code{@@defmac}, and @code{@@defspec}) specify the
  9165. category for you: ``Function'', ``Macro'', and ``Special Form''
  9166. respectively. (In Lisp, a special form is an entity much like a
  9167. function.) Similarly, the general @code{@@defvr} command is
  9168. accompanied by several specialized variations for describing
  9169. particular kinds of variables.
  9170. @xref{Sample Function Definition}, for a detailed example of a
  9171. function definition, including the use of @code{@@example} inside the
  9172. definition.
  9173. @node Def Cmd Continuation Lines
  9174. @section Definition Command Continuation Lines
  9175. @cindex Continuation lines in definition commands
  9176. @cindex Definition command headings, continuing
  9177. @cindex @sortas{@@} @samp{@@} as continuation in definition commands
  9178. The heading line of a definition command can get very long.
  9179. Therefore, Texinfo has a special syntax allowing them to be continued
  9180. over multiple lines of the source file: a lone @samp{@@} at the end of
  9181. each line to be continued. Here's an example:
  9182. @example
  9183. @@defun fn-name @@
  9184. arg1 arg2 arg3
  9185. This is the basic continued defun.
  9186. @@end defun
  9187. @end example
  9188. @noindent produces:
  9189. @defun fn-name arg1 arg2 arg3
  9190. This is the basic continued defun.
  9191. @end defun
  9192. @noindent
  9193. As you can see, the continued lines are combined, as if they had been
  9194. typed on one source line.
  9195. Although this example only shows a one-line continuation,
  9196. continuations may extend over any number of lines, in the same way;
  9197. put an @code{@@} at the end of each line to be continued.
  9198. @cindex Whitespace, collapsed around continuations
  9199. @cindex Collapsing whitespace around continuations
  9200. In general, any number of spaces or tabs before the @code{@@}
  9201. continuation character are collapsed into a single space. There is one
  9202. exception: the Texinfo processors will not fully collapse whitespace
  9203. around a continuation inside braces. For example:
  9204. @example
  9205. @@deffn @{Category @@
  9206. Name@} @dots{}
  9207. @end example
  9208. @noindent The output (not shown) has excess space between `Category'
  9209. and `Name'. To avoid this, elide the unwanted whitespace in your
  9210. input, or put the continuation @code{@@} outside braces.
  9211. @code{@@} does not function as a continuation character in @emph{any}
  9212. other context. Ordinarily, @samp{@@} followed by a whitespace
  9213. character (space, tab, newline) produces a normal interword space
  9214. (@pxref{Multiple Spaces}).
  9215. @node Optional Arguments
  9216. @section Optional and Repeated Arguments
  9217. @cindex Optional and repeated arguments
  9218. @cindex Repeated and optional arguments
  9219. @cindex Arguments, repeated and optional
  9220. @cindex Syntax, optional & repeated arguments
  9221. @cindex Meta-syntactic chars for arguments
  9222. @c This is consistent with the Emacs Lisp Reference Manual.
  9223. Some entities take optional or repeated arguments, conventionally
  9224. specified by using square brackets and ellipses: an argument enclosed
  9225. within square brackets is optional, and an argument followed by an
  9226. ellipsis is optional and may be repeated more than once.
  9227. Thus, [@var{optional-arg}] means that @var{optional-arg} is optional
  9228. and @var{repeated-args}@code{@dots{}} stands for zero or more
  9229. arguments. Parentheses are used when several arguments are grouped
  9230. into additional levels of list structure in Lisp.
  9231. Here is the @code{@@defspec} line of an example of an imaginary
  9232. (complicated) special form:
  9233. @quotation
  9234. @defspec foobar (var [from to [inc]]) body@dots{}
  9235. @end defspec
  9236. @end quotation
  9237. @noindent
  9238. In this example, the arguments @var{from} and @var{to} are optional,
  9239. but must both be present or both absent. If they are present,
  9240. @var{inc} may optionally be specified as well. These arguments are
  9241. grouped with the argument @var{var} into a list, to distinguish them
  9242. from @var{body}, which includes all remaining elements of the
  9243. form.
  9244. In a Texinfo source file, this @code{@@defspec} line is written like
  9245. this:
  9246. @example
  9247. @@defspec foobar (var [from to [inc]]) body@@dots@{@}
  9248. @end example
  9249. @noindent
  9250. The function is listed in the Command and Variable Index under
  9251. @samp{foobar}.
  9252. @node @code{@@deffnx}
  9253. @section @code{@@deffnx}, et al.: Two or More `First' Lines
  9254. @anchor{deffnx}@c old node
  9255. @findex deffnx
  9256. @cindex Two `First' Lines for @code{@@deffn}
  9257. @cindex Grouping two definitions together
  9258. @cindex Definitions grouped together
  9259. To create two or more `first' or header lines for a definition, follow
  9260. the first @code{@@deffn} line by a line beginning with
  9261. @code{@@deffnx}. The @code{@@deffnx} command works exactly like
  9262. @code{@@deffn} except that it does not generate extra vertical white
  9263. space between it and the preceding line.
  9264. @need 1000
  9265. For example,
  9266. @example
  9267. @group
  9268. @@deffn @{Interactive Command@} isearch-forward
  9269. @@deffnx @{Interactive Command@} isearch-backward
  9270. These two search commands are similar except @dots{}
  9271. @@end deffn
  9272. @end group
  9273. @end example
  9274. @noindent
  9275. produces
  9276. @deffn {Interactive Command} isearch-forward
  9277. @deffnx {Interactive Command} isearch-backward
  9278. These two search commands are similar except @dots{}
  9279. @end deffn
  9280. @findex defcvx
  9281. @findex defivarx
  9282. @findex defmacx
  9283. @findex defmethodx
  9284. @findex defoptx
  9285. @findex defopx
  9286. @findex defspecx
  9287. @findex deftpx
  9288. @findex deftypecvx
  9289. @findex deftypefnx
  9290. @findex deftypefunx
  9291. @findex deftypeivarx
  9292. @findex deftypemethodx
  9293. @findex deftypeopx
  9294. @findex deftypevarx
  9295. @findex deftypevrx
  9296. @findex defunx
  9297. @findex defvarx
  9298. @findex defvrx
  9299. Each definition command has an `x' form: @code{@@defunx},
  9300. @code{@@defvrx}, @code{@@deftypefunx}, etc.
  9301. The `x' forms work similarly to @code{@@itemx}
  9302. (@pxref{@code{@@itemx}}).
  9303. @node Def Cmds in Detail
  9304. @section The Definition Commands
  9305. Texinfo provides more than a dozen definition commands, all of which
  9306. are described in this section.
  9307. The definition commands automatically enter the name of the entity in
  9308. the appropriate index: for example, @code{@@deffn}, @code{@@defun},
  9309. and @code{@@defmac} enter function names in the index of functions;
  9310. @code{@@defvr} and @code{@@defvar} enter variable names in the index
  9311. of variables.
  9312. Although the examples that follow mostly illustrate Lisp, the commands
  9313. can be used for other programming languages.
  9314. @menu
  9315. * Functions Commands:: Commands for functions and similar entities.
  9316. * Variables Commands:: Commands for variables and similar entities.
  9317. * Typed Functions:: Commands for functions in typed languages.
  9318. * Typed Variables:: Commands for variables in typed languages.
  9319. * Data Types:: The definition command for data types.
  9320. * Abstract Objects:: Commands for object-oriented programming.
  9321. @end menu
  9322. @node Functions Commands
  9323. @subsection Functions and Similar Entities
  9324. This section describes the commands for describing functions and similar
  9325. entities:
  9326. @table @code
  9327. @findex deffn
  9328. @item @@deffn @var{category} @var{name} @var{arguments}@dots{}
  9329. The @code{@@deffn} command is the general definition command for
  9330. functions, interactive commands, and similar entities that may take
  9331. arguments. You must choose a term to describe the category of entity
  9332. being defined; for example, ``Function'' could be used if the entity is
  9333. a function. The @code{@@deffn} command is written at the beginning of a
  9334. line and is followed on the same line by the category of entity being
  9335. described, the name of this particular entity, and its arguments, if
  9336. any. Terminate the definition with @code{@@end deffn} on a line of its
  9337. own.
  9338. @need 750
  9339. For example, here is a definition:
  9340. @example
  9341. @group
  9342. @@deffn Command forward-char nchars
  9343. Move point forward @@var@{nchars@} characters.
  9344. @@end deffn
  9345. @end group
  9346. @end example
  9347. @noindent
  9348. This shows a rather terse definition for a ``command'' named
  9349. @code{forward-char} with one argument, @var{nchars}.
  9350. @code{@@deffn} prints argument names such as @var{nchars} in slanted
  9351. type in the printed output, because we think of these names as
  9352. metasyntactic variables---they stand for the actual argument values.
  9353. Within the text of the description, however, write an argument name
  9354. explicitly with @code{@@var} to refer to the value of the argument.
  9355. In the example above, we used @samp{@@var@{nchars@}} in this way.
  9356. In the extremely unusual case when an argument name contains
  9357. @samp{--}, or another character sequence which is treated specially
  9358. (@pxref{Conventions}), use @code{@@code} around the special
  9359. characters. This avoids the conversion to typographic en-dashes and
  9360. em-dashes.
  9361. @c @var also works; that's what we used to recommend.
  9362. The template for @code{@@deffn} is:
  9363. @example
  9364. @group
  9365. @@deffn @var{category} @var{name} @var{arguments}@dots{}
  9366. @var{body-of-definition}
  9367. @@end deffn
  9368. @end group
  9369. @end example
  9370. @findex defun
  9371. @item @@defun @var{name} @var{arguments}@dots{}
  9372. The @code{@@defun} command is the definition command for functions.
  9373. @code{@@defun} is equivalent to @samp{@@deffn Function @dots{}}.
  9374. Terminate the definition with @code{@@end defun} on a line of its own.
  9375. Thus, the template is:
  9376. @example
  9377. @group
  9378. @@defun @var{function-name} @var{arguments}@dots{}
  9379. @var{body-of-definition}
  9380. @@end defun
  9381. @end group
  9382. @end example
  9383. @findex defmac
  9384. @item @@defmac @var{name} @var{arguments}@dots{}
  9385. The @code{@@defmac} command is the definition command for macros.
  9386. @code{@@defmac} is equivalent to @samp{@@deffn Macro @dots{}} and
  9387. works like @code{@@defun}.
  9388. @findex defspec
  9389. @item @@defspec @var{name} @var{arguments}@dots{}
  9390. The @code{@@defspec} command is the definition command for special
  9391. forms. (In Lisp, a special form is an entity much like a function;
  9392. @pxref{Special Forms,,, elisp, GNU Emacs Lisp Reference Manual}.)
  9393. @code{@@defspec} is equivalent to @samp{@@deffn @{Special Form@}
  9394. @dots{}} and works like @code{@@defun}.
  9395. @end table
  9396. All these commands create entries in the index of functions.
  9397. @node Variables Commands
  9398. @subsection Variables and Similar Entities
  9399. Here are the commands for defining variables and similar
  9400. entities:
  9401. @table @code
  9402. @findex defvr
  9403. @item @@defvr @var{category} @var{name}
  9404. The @code{@@defvr} command is a general definition command for
  9405. something like a variable---an entity that records a value. You must
  9406. choose a term to describe the category of entity being defined; for
  9407. example, ``Variable'' could be used if the entity is a variable.
  9408. Write the @code{@@defvr} command at the beginning of a line and
  9409. follow it on the same line by the category of the entity and the
  9410. name of the entity.
  9411. We recommend capitalizing the category name like a title. If the name
  9412. of the category contains spaces, as in the name ``User Option'',
  9413. enclose it in braces. Otherwise, the second word will be mistaken for
  9414. the name of the entity. For example,
  9415. @example
  9416. @group
  9417. @@defvr @{User Option@} fill-column
  9418. This buffer-local variable specifies
  9419. the maximum width of filled lines.
  9420. @dots{}
  9421. @@end defvr
  9422. @end group
  9423. @end example
  9424. Terminate the definition with @code{@@end defvr} on a line of its
  9425. own.
  9426. The template is:
  9427. @example
  9428. @group
  9429. @@defvr @var{category} @var{name}
  9430. @var{body-of-definition}
  9431. @@end defvr
  9432. @end group
  9433. @end example
  9434. @code{@@defvr} creates an entry in the index of variables for @var{name}.
  9435. @findex defvar
  9436. @item @@defvar @var{name}
  9437. The @code{@@defvar} command is the definition command for variables.
  9438. @code{@@defvar} is equivalent to @samp{@@defvr Variable
  9439. @dots{}}.
  9440. @need 750
  9441. For example:
  9442. @example
  9443. @group
  9444. @@defvar kill-ring
  9445. @dots{}
  9446. @@end defvar
  9447. @end group
  9448. @end example
  9449. The template is:
  9450. @example
  9451. @group
  9452. @@defvar @var{name}
  9453. @var{body-of-definition}
  9454. @@end defvar
  9455. @end group
  9456. @end example
  9457. @code{@@defvar} creates an entry in the index of variables for
  9458. @var{name}.
  9459. @findex defopt
  9460. @item @@defopt @var{name}
  9461. @cindex User options, marking
  9462. The @code{@@defopt} command is the definition command for @dfn{user
  9463. options}, i.e., variables intended for users to change according to
  9464. taste; Emacs has many such (@pxref{Variables,,, emacs, The GNU Emacs
  9465. Manual}). @code{@@defopt} is equivalent to @samp{@@defvr @{User
  9466. Option@} @dots{}} and works like @code{@@defvar}. It creates an entry
  9467. in the index of variables.
  9468. @end table
  9469. @node Typed Functions
  9470. @subsection Functions in Typed Languages
  9471. @cindex Typed functions
  9472. @cindex Functions, in typed languages
  9473. The @code{@@deftypefn} command and its variations are for describing
  9474. functions in languages in which you must declare types of variables
  9475. and functions, such as C and C++.
  9476. @table @code
  9477. @findex deftypefn
  9478. @item @@deftypefn @var{category} @var{data-type} @var{name} @var{arguments}@dots{}
  9479. The @code{@@deftypefn} command is the general definition command for
  9480. functions and similar entities that may take arguments and that are
  9481. typed. The @code{@@deftypefn} command is written at the beginning of
  9482. a line and is followed on the same line by the category of entity
  9483. being described, the type of the returned value, the name of this
  9484. particular entity, and its arguments, if any.
  9485. @need 800
  9486. @noindent
  9487. For example,
  9488. @example
  9489. @group
  9490. @@deftypefn @{Library Function@} int foobar @@
  9491. (int @@var@{foo@}, float @@var@{bar@})
  9492. @dots{}
  9493. @@end deftypefn
  9494. @end group
  9495. @end example
  9496. produces:
  9497. @quotation
  9498. @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
  9499. @dots{}
  9500. @end deftypefn
  9501. @end quotation
  9502. This means that @code{foobar} is a ``library function'' that returns an
  9503. @code{int}, and its arguments are @var{foo} (an @code{int}) and
  9504. @var{bar} (a @code{float}).
  9505. Since in typed languages, the actual names of the arguments are
  9506. typically scattered among data type names and keywords, Texinfo cannot
  9507. find them without help. You can either (a)@tie{}write everything as
  9508. straight text, and it will be printed in slanted type; (b)@tie{}use
  9509. @code{@@var} for the variable names, which will uppercase the variable
  9510. names in Info and use the slanted typewriter font in printed output;
  9511. (c)@tie{}use @code{@@var} for the variable names and @code{@@code} for
  9512. the type names and keywords, which will be dutifully obeyed.
  9513. The template for @code{@@deftypefn} is:
  9514. @example
  9515. @group
  9516. @@deftypefn @var{category} @var{data-type} @var{name} @var{arguments} @dots{}
  9517. @var{body-of-description}
  9518. @@end deftypefn
  9519. @end group
  9520. @end example
  9521. @noindent
  9522. Note that if the @var{category} or @var{data type} is more than one
  9523. word then it must be enclosed in braces to make it a single argument.
  9524. If you are describing a procedure in a language that has packages,
  9525. such as Ada, you might consider using @code{@@deftypefn} in a manner
  9526. somewhat contrary to the convention described in the preceding
  9527. paragraphs. For example:
  9528. @example
  9529. @group
  9530. @@deftypefn stacks private push @@
  9531. (@@var@{s@}:in out stack; @@
  9532. @@var@{n@}:in integer)
  9533. @dots{}
  9534. @@end deftypefn
  9535. @end group
  9536. @end example
  9537. @noindent
  9538. (In these examples the @code{@@deftypefn} arguments are shown using
  9539. continuations (@pxref{Def Cmd Continuation Lines}), but could be on a
  9540. single line.)
  9541. In this instance, the procedure is classified as belonging to the
  9542. package @code{stacks} rather than classified as a `procedure' and its
  9543. data type is described as @code{private}. (The name of the procedure
  9544. is @code{push}, and its arguments are @var{s} and @var{n}.)
  9545. @code{@@deftypefn} creates an entry in the index of functions for
  9546. @var{name}.
  9547. @item @@deftypefun @var{data-type} @var{name} @var{arguments}@dots{}
  9548. @findex deftypefun
  9549. The @code{@@deftypefun} command is the specialized definition command
  9550. for functions in typed languages. The command is equivalent to
  9551. @samp{@@deftypefn Function @dots{}}. The template is:
  9552. @example
  9553. @group
  9554. @@deftypefun @var{type} @var{name} @var{arguments}@dots{}
  9555. @var{body-of-description}
  9556. @@end deftypefun
  9557. @end group
  9558. @end example
  9559. @code{@@deftypefun} creates an entry in the index of functions for
  9560. @var{name}.
  9561. @end table
  9562. @cindex Return type, own line for
  9563. @findex deftypefnnewline
  9564. Ordinarily, the return type is printed on the same line as the
  9565. function name and arguments, as shown above. In source code, GNU
  9566. style is to put the return type on a line by itself. So Texinfo
  9567. provides an option to do that: @code{@@deftypefnnewline on}.
  9568. This affects typed functions only---not untyped functions, not typed
  9569. variables, etc.. Specifically, it affects the commands in this
  9570. section, and the analogous commands for object-oriented languages,
  9571. namely @code{@@deftypeop} and @code{@@deftypemethod}
  9572. (@pxref{Object-Oriented Methods}).
  9573. Specifying @code{@@deftypefnnewline off} reverts to the default.
  9574. @node Typed Variables
  9575. @subsection Variables in Typed Languages
  9576. @cindex Typed variables
  9577. @cindex Variables, in typed languages
  9578. Variables in typed languages are handled in a manner similar to
  9579. functions in typed languages. @xref{Typed Functions}. The general
  9580. definition command @code{@@deftypevr} corresponds to
  9581. @code{@@deftypefn} and the specialized definition command
  9582. @code{@@deftypevar} corresponds to @code{@@deftypefun}.
  9583. @table @code
  9584. @findex deftypevr
  9585. @item @@deftypevr @var{category} @var{data-type} @var{name}
  9586. The @code{@@deftypevr} command is the general definition command for
  9587. something like a variable in a typed language---an entity that records
  9588. a value. You must choose a term to describe the category of the
  9589. entity being defined; for example, ``Variable'' could be used if the
  9590. entity is a variable.
  9591. The @code{@@deftypevr} command is written at the beginning of a line
  9592. and is followed on the same line by the category of the entity
  9593. being described, the data type, and the name of this particular
  9594. entity.
  9595. @need 800
  9596. @noindent
  9597. For example:
  9598. @example
  9599. @group
  9600. @@deftypevr @{Global Flag@} int enable
  9601. @dots{}
  9602. @@end deftypevr
  9603. @end group
  9604. @end example
  9605. @noindent
  9606. produces the following:
  9607. @quotation
  9608. @deftypevr {Global Flag} int enable
  9609. @dots{}
  9610. @end deftypevr
  9611. @end quotation
  9612. @need 800
  9613. The template is:
  9614. @example
  9615. @@deftypevr @var{category} @var{data-type} @var{name}
  9616. @var{body-of-description}
  9617. @@end deftypevr
  9618. @end example
  9619. @findex deftypevar
  9620. @item @@deftypevar @var{data-type} @var{name}
  9621. The @code{@@deftypevar} command is the specialized definition command
  9622. for variables in typed languages. @code{@@deftypevar} is equivalent
  9623. to @samp{@@deftypevr Variable @dots{}}. The template is:
  9624. @example
  9625. @group
  9626. @@deftypevar @var{data-type} @var{name}
  9627. @var{body-of-description}
  9628. @@end deftypevar
  9629. @end group
  9630. @end example
  9631. @end table
  9632. These commands create entries in the index of variables.
  9633. @node Data Types
  9634. @subsection Data Types
  9635. Here is the command for data types:
  9636. @table @code
  9637. @findex deftp
  9638. @item @@deftp @var{category} @var{name} @var{attributes}@dots{}
  9639. The @code{@@deftp} command is the generic definition command for data
  9640. types. The command is written at the beginning of a line and is
  9641. followed on the same line by the category, by the name of the type
  9642. (which is a word like @code{int} or @code{float}), and then by names of
  9643. attributes of objects of that type. Thus, you could use this command
  9644. for describing @code{int} or @code{float}, in which case you could use
  9645. @code{data type} as the category. (A data type is a category of
  9646. certain objects for purposes of deciding which operations can be
  9647. performed on them.)
  9648. In Lisp, for example, @dfn{pair} names a particular data
  9649. type, and an object of that type has two slots called the
  9650. @sc{car} and the @sc{cdr}. Here is how you would write the first line
  9651. of a definition of @code{pair}.
  9652. @example
  9653. @group
  9654. @@deftp @{Data type@} pair car cdr
  9655. @dots{}
  9656. @@end deftp
  9657. @end group
  9658. @end example
  9659. @need 950
  9660. The template is:
  9661. @example
  9662. @group
  9663. @@deftp @var{category} @var{name-of-type} @var{attributes}@dots{}
  9664. @var{body-of-definition}
  9665. @@end deftp
  9666. @end group
  9667. @end example
  9668. @code{@@deftp} creates an entry in the index of data types.
  9669. @end table
  9670. @node Abstract Objects
  9671. @subsection Object-Oriented Programming
  9672. @cindex Object-oriented programming
  9673. Here are the commands for formatting descriptions about abstract
  9674. objects, such as are used in object-oriented programming. A class is
  9675. a defined type of abstract object. An instance of a class is a
  9676. particular object that has the type of the class. An instance
  9677. variable is a variable that belongs to the class but for which each
  9678. instance has its own value.
  9679. @menu
  9680. * Variables: Object-Oriented Variables.
  9681. * Methods: Object-Oriented Methods.
  9682. @end menu
  9683. @node Object-Oriented Variables
  9684. @subsubsection Object-Oriented Variables
  9685. @cindex Variables, object-oriented
  9686. These commands allow you to define different sorts of variables in
  9687. object-oriented programming languages.
  9688. @table @code
  9689. @item @@defcv @var{category} @var{class} @var{name}
  9690. @findex defcv
  9691. The @code{@@defcv} command is the general definition command for
  9692. variables associated with classes in object-oriented programming. The
  9693. @code{@@defcv} command is followed by three arguments: the category of
  9694. thing being defined, the class to which it belongs, and its
  9695. name. For instance:
  9696. @example
  9697. @group
  9698. @@defcv @{Class Option@} Window border-pattern
  9699. @dots{}
  9700. @@end defcv
  9701. @end group
  9702. @end example
  9703. @noindent produces:
  9704. @defcv {Class Option} Window border-pattern
  9705. @dots{}
  9706. @end defcv
  9707. @code{@@defcv} creates an entry in the index of variables.
  9708. @item @@deftypecv @var{category} @var{class} @var{data-type} @var{name}
  9709. @findex deftypecv
  9710. The @code{@@deftypecv} command is the definition command for typed
  9711. class variables in object-oriented programming. It is analogous to
  9712. @code{@@defcv} with the addition of the @var{data-type} parameter to
  9713. specify the type of the instance variable. Ordinarily, the data type
  9714. is a programming language construct that should be marked with
  9715. @code{@@code}. For instance:
  9716. @example
  9717. @group
  9718. @@deftypecv @{Class Option@} Window @@code@{int@} border-pattern
  9719. @dots{}
  9720. @@end deftypecv
  9721. @end group
  9722. @end example
  9723. @noindent produces:
  9724. @deftypecv {Class Option} Window @code{int} border-pattern
  9725. @dots{}
  9726. @end deftypecv
  9727. @code{@@deftypecv} creates an entry in the index of variables.
  9728. @item @@defivar @var{class} @var{name}
  9729. @findex defivar
  9730. The @code{@@defivar} command is the definition command for instance
  9731. variables in object-oriented programming. @code{@@defivar} is
  9732. equivalent to @samp{@@defcv @{Instance Variable@} @dots{}}. For
  9733. instance:
  9734. @example
  9735. @group
  9736. @@defivar Window border-pattern
  9737. @dots{}
  9738. @@end defivar
  9739. @end group
  9740. @end example
  9741. @noindent produces:
  9742. @defivar Window border-pattern
  9743. @dots{}
  9744. @end defivar
  9745. @code{@@defivar} creates an entry in the index of variables.
  9746. @item @@deftypeivar @var{class} @var{data-type} @var{name}
  9747. @findex deftypeivar
  9748. The @code{@@deftypeivar} command is the definition command for typed
  9749. instance variables in object-oriented programming. It is analogous to
  9750. @code{@@defivar} with the addition of the @var{data-type} parameter to
  9751. specify the type of the instance variable. Ordinarily, the data type
  9752. is a programming language construct that should be marked with
  9753. @code{@@code}. For instance:
  9754. @example
  9755. @group
  9756. @@deftypeivar Window @@code@{int@} border-pattern
  9757. @dots{}
  9758. @@end deftypeivar
  9759. @end group
  9760. @end example
  9761. @noindent produces:
  9762. @deftypeivar Window @code{int} border-pattern
  9763. @dots{}
  9764. @end deftypeivar
  9765. @code{@@deftypeivar} creates an entry in the index of variables.
  9766. @end table
  9767. @node Object-Oriented Methods
  9768. @subsubsection Object-Oriented Methods
  9769. @cindex Methods, object-oriented
  9770. These commands allow you to define different sorts of function-like
  9771. entities resembling methods in object-oriented programming languages.
  9772. These entities take arguments, as functions do, but are associated with
  9773. particular classes of objects.
  9774. @table @code
  9775. @findex defop
  9776. @item @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
  9777. The @code{@@defop} command is the general definition command for these
  9778. method-like entities.
  9779. For example, some systems have constructs called @dfn{wrappers} that
  9780. are associated with classes as methods are, but that act more like
  9781. macros than like functions. You could use @code{@@defop Wrapper} to
  9782. describe one of these.
  9783. Sometimes it is useful to distinguish methods and @dfn{operations}.
  9784. You can think of an operation as the specification for a method.
  9785. Thus, a window system might specify that all window classes have a
  9786. method named @code{expose}; we would say that this window system
  9787. defines an @code{expose} operation on windows in general. Typically,
  9788. the operation has a name and also specifies the pattern of arguments;
  9789. all methods that implement the operation must accept the same
  9790. arguments, since applications that use the operation do so without
  9791. knowing which method will implement it.
  9792. Often it makes more sense to document operations than methods. For
  9793. example, window application developers need to know about the
  9794. @code{expose} operation, but need not be concerned with whether a
  9795. given class of windows has its own method to implement this operation.
  9796. To describe this operation, you would write:
  9797. @example
  9798. @@defop Operation windows expose
  9799. @end example
  9800. The @code{@@defop} command is written at the beginning of a line and
  9801. is followed on the same line by the overall name of the category of
  9802. operation, the name of the class of the operation, the name of the
  9803. operation, and its arguments, if any.
  9804. The template is:
  9805. @example
  9806. @group
  9807. @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
  9808. @var{body-of-definition}
  9809. @@end defop
  9810. @end group
  9811. @end example
  9812. @code{@@defop} creates an entry, such as `@code{expose} on
  9813. @code{windows}', in the index of functions.
  9814. @findex deftypeop
  9815. @item @@deftypeop @var{category} @var{class} @var{data-type} @var{name} @var{arguments}@dots{}
  9816. The @code{@@deftypeop} command is the definition command for typed
  9817. operations in object-oriented programming. It is similar to
  9818. @code{@@defop} with the addition of the @var{data-type} parameter to
  9819. specify the return type of the method. @code{@@deftypeop} creates an
  9820. entry in the index of functions.
  9821. @item @@defmethod @var{class} @var{name} @var{arguments}@dots{}
  9822. @findex defmethod
  9823. The @code{@@defmethod} command is the definition command for methods
  9824. in object-oriented programming. A method is a kind of function that
  9825. implements an operation for a particular class of objects and its
  9826. subclasses.
  9827. @ignore
  9828. @c ADR: Who cares?!?
  9829. @c KB: Oh, I don't know, I think this info is crucial!
  9830. In the Lisp Machine, methods actually were functions, but
  9831. they were usually defined with @code{defmethod}.
  9832. @end ignore
  9833. @code{@@defmethod} is equivalent to @samp{@@defop Method @dots{}}.
  9834. The command is written at the beginning of a line and is followed by
  9835. the name of the class of the method, the name of the method, and its
  9836. arguments, if any.
  9837. @noindent
  9838. For example:
  9839. @example
  9840. @group
  9841. @@defmethod @code{bar-class} bar-method argument
  9842. @dots{}
  9843. @@end defmethod
  9844. @end group
  9845. @end example
  9846. @noindent
  9847. illustrates the definition for a method called @code{bar-method} of
  9848. the class @code{bar-class}. The method takes an argument.
  9849. @code{@@defmethod} creates an entry in the index of functions.
  9850. @item @@deftypemethod @var{class} @var{data-type} @var{name} @var{arguments}@dots{}
  9851. @findex deftypemethod
  9852. The @code{@@deftypemethod} command is the definition command for methods
  9853. in object-oriented typed languages, such as C++ and Java. It is similar
  9854. to the @code{@@defmethod} command with the addition of the
  9855. @var{data-type} parameter to specify the return type of the method.
  9856. @code{@@deftypemethod} creates an entry in the index of functions.
  9857. @end table
  9858. The typed commands are affected by the @code{@@deftypefnnewline}
  9859. option (@pxref{Typed Functions,, Functions in Typed Languages}).
  9860. @node Def Cmd Conventions
  9861. @section Conventions for Writing Definitions
  9862. @cindex Definition conventions
  9863. @cindex Conventions for writing definitions
  9864. When you write a definition using @code{@@deffn}, @code{@@defun}, or
  9865. one of the other definition commands, please take care to use
  9866. arguments that indicate the meaning, as with the @var{count} argument
  9867. to the @code{forward-word} function. Also, if the name of an argument
  9868. contains the name of a type, such as @var{integer}, take care that the
  9869. argument actually is of that type.
  9870. @node Sample Function Definition
  9871. @section A Sample Function Definition
  9872. @cindex Function definitions
  9873. @cindex Command definitions
  9874. @cindex Macro definitions, programming-language
  9875. @cindex Sample function definition
  9876. A function definition uses the @code{@@defun} and @code{@@end defun}
  9877. commands. The name of the function follows immediately after the
  9878. @code{@@defun} command and it is followed, on the same line, by the
  9879. parameter list.
  9880. Here is a definition from @ref{Calling Functions,,, elisp, The GNU Emacs
  9881. Lisp Reference Manual}.
  9882. @quotation
  9883. @defun apply function &rest arguments
  9884. @code{apply} calls @var{function} with @var{arguments}, just
  9885. like @code{funcall} but with one difference: the last of
  9886. @var{arguments} is a list of arguments to give to
  9887. @var{function}, rather than a single argument. We also say
  9888. that this list is @dfn{appended} to the other arguments.
  9889. @code{apply} returns the result of calling @var{function}.
  9890. As with @code{funcall}, @var{function} must either be a Lisp
  9891. function or a primitive function; special forms and macros
  9892. do not make sense in @code{apply}.
  9893. @example
  9894. (setq f 'list)
  9895. @result{} list
  9896. (apply f 'x 'y 'z)
  9897. @error{} Wrong type argument: listp, z
  9898. (apply '+ 1 2 '(3 4))
  9899. @result{} 10
  9900. (apply '+ '(1 2 3 4))
  9901. @result{} 10
  9902. (apply 'append '((a b c) nil (x y z) nil))
  9903. @result{} (a b c x y z)
  9904. @end example
  9905. An interesting example of using @code{apply} is found in the description
  9906. of @code{mapcar}.
  9907. @end defun
  9908. @end quotation
  9909. In the Texinfo source file, this example looks like this:
  9910. @example
  9911. @group
  9912. @@defun apply function &rest arguments
  9913. @@code@{apply@} calls @@var@{function@} with
  9914. @@var@{arguments@}, just like @@code@{funcall@} but with one
  9915. difference: the last of @@var@{arguments@} is a list of
  9916. arguments to give to @@var@{function@}, rather than a single
  9917. argument. We also say that this list is @@dfn@{appended@}
  9918. to the other arguments.
  9919. @end group
  9920. @group
  9921. @@code@{apply@} returns the result of calling
  9922. @@var@{function@}. As with @@code@{funcall@},
  9923. @@var@{function@} must either be a Lisp function or a
  9924. primitive function; special forms and macros do not make
  9925. sense in @@code@{apply@}.
  9926. @end group
  9927. @group
  9928. @@example
  9929. (setq f 'list)
  9930. @@result@{@} list
  9931. (apply f 'x 'y 'z)
  9932. @@error@{@} Wrong type argument: listp, z
  9933. (apply '+ 1 2 '(3 4))
  9934. @@result@{@} 10
  9935. (apply '+ '(1 2 3 4))
  9936. @@result@{@} 10
  9937. (apply 'append '((a b c) nil (x y z) nil))
  9938. @@result@{@} (a b c x y z)
  9939. @@end example
  9940. @end group
  9941. @group
  9942. An interesting example of using @@code@{apply@} is found
  9943. in the description of @@code@{mapcar@}.
  9944. @@end defun
  9945. @end group
  9946. @end example
  9947. @noindent
  9948. In this manual, this function is listed in the Command and Variable
  9949. Index under @code{apply}.
  9950. Ordinary variables and user options are described using a format like
  9951. that for functions except that variables do not take arguments.
  9952. @node Internationalization
  9953. @chapter Internationalization
  9954. @cindex Internationalization
  9955. Texinfo has some support for writing in languages other than English,
  9956. although this area still needs considerable work. (If you are
  9957. the one helping to translate the fixed strings written to documents,
  9958. @pxref{Internationalization of Document Strings}.)
  9959. For a list of the various accented and special characters Texinfo
  9960. supports, see @ref{Inserting Accents}.
  9961. @menu
  9962. * @code{@@documentlanguage}:: Declaring the current language.
  9963. * @code{@@documentencoding}:: Declaring the input encoding.
  9964. @end menu
  9965. @node @code{@@documentlanguage}
  9966. @section @code{@@documentlanguage @var{ll}[_@var{cc}]}: Set the Document Language
  9967. @anchor{documentlanguage}
  9968. @findex documentlanguage
  9969. @cindex Language, declaring
  9970. @cindex Locale, declaring
  9971. @cindex Document language, declaring
  9972. The @code{@@documentlanguage} command declares the current document
  9973. locale. Write it on a line by itself, near the beginning of the file.
  9974. @example
  9975. @@documentlanguage @var{ll}[_@var{cc}]
  9976. @end example
  9977. Include a two-letter ISO@tie{}639-2 language code (@var{ll}) following
  9978. the command name, optionally followed by an underscore and two-letter
  9979. ISO@tie{}3166 two-letter country code (@var{cc}). If you have a
  9980. multilingual document, the intent is to be able to use this command
  9981. multiple times, to declare each language change. If the command is
  9982. not used at all, the default is @code{en_US} for US English.
  9983. As with GNU Gettext (@pxref{Top,,, gettext, Gettext}), if the country
  9984. code is omitted, the main dialect is assumed where possible. For
  9985. example, @code{de} is equivalent to @code{de_DE} (German as spoken in
  9986. Germany).
  9987. @cindex Document strings, translation of
  9988. For Info and other online output, this command changes the translation
  9989. of various @dfn{document strings} such as ``see'' in cross-references
  9990. (@pxref{Cross References}), ``Function'' in defuns (@pxref{Definition
  9991. Commands}), and so on. Some strings, such as ``Node:'', ``Next:'',
  9992. ``Menu:'', etc., are keywords in Info output, so are not translated
  9993. there; they are translated in other output formats.
  9994. @cindex @file{txi-@var{cc}.tex}
  9995. For @TeX{}, this command causes a file @file{txi-@var{locale}.tex} to
  9996. be read (if it exists). If @code{@@documentlanguage} argument
  9997. contains the optional @samp{_@var{cc}} suffix, this is tried first.
  9998. For example, with @code{@@documentlanguage de_DE}, @TeX{} first looks
  9999. for @file{txi-de_DE.tex}, then @file{txi-de.tex}.
  10000. Such a @file{txi-*} file is intended to redefine the various English
  10001. words used in @TeX{} output, such as `Chapter', `See', and so on. We
  10002. are aware that individual words like these cannot always be translated
  10003. in isolation, and that a very different strategy would be required for
  10004. ideographic (among other) scripts. Help in improving Texinfo's
  10005. language support is welcome.
  10006. @cindex Hyphenation patterns, language-dependent
  10007. @code{@@documentlanguage} also changes @TeX{}'s current hyphenation
  10008. patterns, if the @TeX{} program being run has the necessary support
  10009. included. This will generally not be the case for @command{tex}
  10010. itself, but will usually be the case for up-to-date distributions of
  10011. the extended @TeX{} programs @command{etex} (DVI output) and
  10012. @command{pdftex} (PDF output). @command{texi2dvi} will use the
  10013. extended @TeX{}s if they are available (@pxref{Format with
  10014. @command{texi2dvi}}).
  10015. In September 2006, the W3C Internationalization Activity released a
  10016. new recommendation for specifying languages:
  10017. @url{http://www.rfc-editor.org/rfc/bcp/bcp47.txt}. When Gettext
  10018. supports this new scheme, Texinfo will too.
  10019. @cindex ISO 639-2 language codes
  10020. @cindex ISO 3166 country codes
  10021. @cindex Language codes
  10022. @cindex Country codes
  10023. Since the lists of language codes and country codes are updated
  10024. relatively frequently, we don't attempt to list them here. The valid
  10025. language codes are on the official home page for ISO@tie{}639,
  10026. @url{http://www.loc.gov/standards/iso639-2/}. The country codes and
  10027. the official web site for ISO@tie{}3166 can be found via
  10028. @url{http://en.wikipedia.org/wiki/ISO_3166}.
  10029. @node @code{@@documentencoding}
  10030. @section @code{@@documentencoding @var{enc}}: Set Input Encoding
  10031. @anchor{documentencoding}@c old name
  10032. @findex documentencoding
  10033. @cindex Encoding, declaring
  10034. @cindex Input encoding, declaring
  10035. @cindex Character set, declaring
  10036. @cindex Document input encoding
  10037. The @code{@@documentencoding} command declares the input document
  10038. encoding, and can also affect the encoding of the output. Write it on
  10039. a line by itself, with a valid encoding specification following, near
  10040. the beginning of the file.
  10041. @example
  10042. @@documentencoding @var{enc}
  10043. @end example
  10044. Texinfo supports these encodings:
  10045. @table @code
  10046. @item US-ASCII
  10047. This has no particular effect, but it's included for completeness.
  10048. @item UTF-8
  10049. The vast global character encoding, expressed in 8-bit bytes.
  10050. @item ISO-8859-1
  10051. @itemx ISO-8859-15
  10052. @itemx ISO-8859-2
  10053. @cindex Euro symbol, and encodings
  10054. These specify the standard encodings for Western European (the first
  10055. two) and Eastern European languages (the third), respectively. ISO
  10056. 8859-15 replaces some little-used characters from 8859-1 (e.g.,
  10057. precomposed fractions) with more commonly needed ones, such as the
  10058. Euro symbol (@euro{}).
  10059. A full description of the encodings is beyond our scope here;
  10060. one useful reference is @uref{http://czyborra.com/charsets/iso8859.html}.
  10061. @item koi8-r
  10062. This is the commonly used encoding for the Russian language.
  10063. @item koi8-u
  10064. This is the commonly used encoding for the Ukrainian language.
  10065. @end table
  10066. Specifying an encoding @var{enc} has the following effects:
  10067. @cindex Local Variables section, for encoding
  10068. @cindex Info output, and encoding
  10069. In Info output, a so-called `Local Variables' section (@pxref{File
  10070. Variables,,, emacs, The GNU Emacs Manual}) is output including
  10071. @var{enc}. This allows Info readers to set the encoding
  10072. appropriately. It looks like this:
  10073. @example
  10074. Local Variables:
  10075. coding: @var{enc}
  10076. End:
  10077. @end example
  10078. Also, in Info and plain text output, unless the option
  10079. @option{--disable-encoding} is given to @command{makeinfo}, accent
  10080. constructs and special characters, such as @code{@@'e}, are output as
  10081. the actual 8-bit or UTF-8 character in the given encoding where
  10082. possible.
  10083. @cindex HTML output, and encodings
  10084. @cindex @code{http-equiv}, and charset specification
  10085. @cindex @code{<meta>} HTML tag, and charset specification
  10086. In HTML output, a @samp{<meta>} tag is output, in the @samp{<head>}
  10087. section of the HTML, that specifies @var{enc}. Web servers and
  10088. browsers cooperate to use this information so the correct encoding is
  10089. used to display the page, if supported by the system. That looks like
  10090. this:
  10091. @example
  10092. <meta http-equiv="Content-Type" content="text/html;
  10093. charset=@var{enc}">
  10094. @end example
  10095. In XML and Docbook output, UTF-8 is always used for the output,
  10096. according to the conventions of those formats.
  10097. @cindex Computer Modern fonts
  10098. In @TeX{} output, the characters which are supported in the standard
  10099. Computer Modern fonts are output accordingly. For example, this
  10100. means using constructed accents rather than precomposed glyphs.
  10101. Using a missing character generates a warning message, as does
  10102. specifying an unimplemented encoding.
  10103. Although modern @TeX{} systems support nearly every script in use in
  10104. the world, this wide-ranging support is not available in
  10105. @file{texinfo.tex}, and it's not feasible to duplicate or incorporate
  10106. all that effort. (Our plan to support other scripts is to create a
  10107. @LaTeX{} back-end to @command{texi2any}, where the support is already
  10108. present.)
  10109. For maximum portability of Texinfo documents across the many different
  10110. user environments in the world, we recommend sticking to 7-bit ASCII
  10111. in the input unless your particular manual needs a substantial amount
  10112. of non-ASCII, e.g., it's written in German. You can use the
  10113. @code{@@U} command to insert an occasional needed character
  10114. (@pxref{Inserting Unicode}).
  10115. @node Conditionals
  10116. @chapter Conditionally Visible Text
  10117. @cindex Conditionally visible text
  10118. @cindex Text, conditionally visible
  10119. @cindex Visibility of conditional text
  10120. @cindex If text conditionally visible
  10121. The @dfn{conditional commands} allow you to use different text for
  10122. different output formats, or for general conditions that you define.
  10123. For example, you can use them to specify different text for the
  10124. printed manual and the Info output.
  10125. The conditional commands comprise the following categories.
  10126. @itemize @bullet
  10127. @item
  10128. Commands specific to an output format (Info, @TeX{}, HTML, @dots{}).
  10129. @item
  10130. Commands specific to any output format @emph{excluding} a given
  10131. one (e.g., not Info, not @TeX{}, @dots{}).
  10132. @item
  10133. `Raw' formatter text for any output format, passed straight
  10134. through with minimal (but not zero) interpretation of @@-commands.
  10135. @item
  10136. Format-independent variable substitutions, and testing if a variable
  10137. is set or clear.
  10138. @end itemize
  10139. @menu
  10140. * Conditional Commands:: Text for a given format.
  10141. * Conditional Not Commands:: Text for any format other than a given one.
  10142. * Raw Formatter Commands:: Using raw formatter commands.
  10143. * Inline Conditionals:: Brace-delimited conditional text.
  10144. * @code{@@set @@clear @@value}:: Variable tests and substitutions.
  10145. * Testing for Texinfo Commands:: Testing if a Texinfo command is available.
  10146. * Conditional Nesting:: Using conditionals inside conditionals.
  10147. @end menu
  10148. @node Conditional Commands
  10149. @section Conditional Commands
  10150. Texinfo has an @code{@@if@var{format}} environment for each output
  10151. format, to allow conditional inclusion of text for a particular output
  10152. format.
  10153. @findex ifinfo
  10154. @code{@@ifinfo} begins segments of text that should be ignored by
  10155. @TeX{} when it typesets the printed manual, and by @command{makeinfo}
  10156. when not producing Info output. The segment of text appears only in
  10157. the Info file and, for historical compatibility, the plain text
  10158. output.
  10159. @findex ifdocbook
  10160. @findex ifhtml
  10161. @findex ifplaintext
  10162. @findex iftex
  10163. @findex ifxml
  10164. The environments for the other formats are analogous:
  10165. @table @code
  10166. @item @@ifdocbook @dots{} @@end ifdocbook
  10167. Text to appear only in the Docbook output.
  10168. @item @@ifhtml @dots{} @@end ifhtml
  10169. Text to appear only in the HTML output.
  10170. @item @@ifplaintext @dots{} @@end ifplaintext
  10171. Text to appear only in the plain text output.
  10172. @item @@iftex @dots{} @@end iftex
  10173. Text to appear only in the printed manual.
  10174. @item @@ifxml @dots{} @@end ifxml
  10175. Text to appear only in the XML output.
  10176. @end table
  10177. The @code{@@if@dots{}} and @code{@@end if@dots{}} commands must appear
  10178. on lines by themselves in your source file. The newlines following
  10179. the commands are (more or less) treated as whitespace, so that the
  10180. conditional text is flowed normally into a surrounding paragraph.
  10181. The @code{@@if@dots{}} constructs are intended to conditionalize
  10182. normal Texinfo source; @pxref{Raw Formatter Commands}, for using
  10183. underlying format commands directly.
  10184. Here is an example showing all these conditionals:
  10185. @example
  10186. @@iftex
  10187. This text will appear only in the printed manual.
  10188. @@end iftex
  10189. @@ifinfo
  10190. However, this text will appear only in Info and plain text.
  10191. @@end ifinfo
  10192. @@ifhtml
  10193. And this text will only appear in HTML.
  10194. @@end ifhtml
  10195. @@ifplaintext
  10196. Whereas this text will only appear in plain text.
  10197. @@end ifplaintext
  10198. @@ifxml
  10199. Notwithstanding that this will only appear in XML@.
  10200. @@end ifxml
  10201. @@ifdocbook
  10202. Nevertheless, this will only appear in Docbook.
  10203. @@end ifdocbook
  10204. @end example
  10205. @noindent
  10206. The preceding example produces the following line:
  10207. @iftex
  10208. This text will appear only in the printed manual.
  10209. @end iftex
  10210. @ifinfo
  10211. However, this text will appear only in Info and plain text.
  10212. @end ifinfo
  10213. @ifhtml
  10214. And this text will only appear in HTML.
  10215. @end ifhtml
  10216. @ifplaintext
  10217. Whereas this text will only appear in plain text.
  10218. @end ifplaintext
  10219. @ifxml
  10220. Notwithstanding that this will only appear in XML@.
  10221. @end ifxml
  10222. @ifdocbook
  10223. Nevertheless, this will only appear in Docbook.
  10224. @end ifdocbook
  10225. @noindent
  10226. Notice that you only see one of the input lines, depending on which
  10227. version of the manual you are reading.
  10228. @findex errormsg
  10229. In complex documents, you may want Texinfo to issue an error message
  10230. in some conditionals that should not ever be processed. The
  10231. @code{@@errormsg@{@var{text}@}} command will do this; it takes one
  10232. argument, the text of the error message.
  10233. We mention @code{@@errormsg@{@}} here even though it is not strictly
  10234. related to conditionals, since in practice it is most likely to be
  10235. useful in that context. Technically, it can be used anywhere.
  10236. @xref{External Macro Processors}, for a caveat regarding the line
  10237. numbers which @code{@@errormsg} emits in @TeX{}.
  10238. @node Conditional Not Commands
  10239. @section Conditional Not Commands
  10240. @findex ifnotdocbook
  10241. @findex ifnothtml
  10242. @findex ifnotinfo
  10243. @findex ifnotplaintext
  10244. @findex ifnottex
  10245. @findex ifnotxml
  10246. You can specify text to be included in any output format @emph{other}
  10247. than a given one with the @code{@@ifnot@dots{}} environments:
  10248. @example
  10249. @@ifnotdocbook @dots{} @@end ifnotdocbook
  10250. @@ifnothtml @dots{} @@end ifnothtml
  10251. @@ifnotinfo @dots{} @@end ifnotinfo
  10252. @@ifnotplaintext @dots{} @@end ifnotplaintext
  10253. @@ifnottex @dots{} @@end ifnottex
  10254. @@ifnotxml @dots{} @@end ifnotxml
  10255. @end example
  10256. @noindent
  10257. The @code{@@ifnot@dots{}} command and the @code{@@end} command must
  10258. appear on lines by themselves in your actual source file.
  10259. If the output file is being made in the given format, the
  10260. region is @emph{ignored}. Otherwise, it is included.
  10261. There is one exception (for historical compatibility):
  10262. @code{@@ifnotinfo} text is omitted for both Info and plain text
  10263. output, not just Info. To specify text which appears only in Info and
  10264. not in plain text, use @code{@@ifnotplaintext}, like this:
  10265. @example
  10266. @@ifinfo
  10267. @@ifnotplaintext
  10268. This will be in Info, but not plain text.
  10269. @@end ifnotplaintext
  10270. @@end ifinfo
  10271. @end example
  10272. The regions delimited by these commands are ordinary Texinfo source as
  10273. with @code{@@iftex}, not raw formatter source as with @code{@@tex}
  10274. (@pxref{Raw Formatter Commands}).
  10275. @node Raw Formatter Commands
  10276. @section Raw Formatter Commands
  10277. @cindex Raw formatter commands
  10278. @cindex @TeX{} commands, using ordinary
  10279. @cindex Ordinary @TeX{} commands, using
  10280. @cindex Commands using raw @TeX{}
  10281. @cindex Plain @TeX{}
  10282. The @code{@@if@dots{}} conditionals just described must be used only
  10283. with normal Texinfo source. For instance, most features of plain
  10284. @TeX{} will not work within @code{@@iftex}. The purpose of
  10285. @code{@@if@dots{}} is to provide conditional processing for Texinfo
  10286. source, not provide access to underlying formatting features. For
  10287. that, Texinfo provides so-called @dfn{raw formatter commands}. They
  10288. should only be used when truly required (most documents do not need
  10289. them).
  10290. @findex tex
  10291. @cindex Category codes, of plain @TeX{}
  10292. The first raw formatter command is @code{@@tex}. You can enter plain
  10293. @TeX{} completely, and use @samp{\} in the @TeX{} commands, by
  10294. delineating a region with the @code{@@tex} and @code{@@end tex}
  10295. commands. All plain @TeX{} commands and category codes are restored
  10296. within a @code{@@tex} region. The sole exception is that the
  10297. @code{@@} character still introduces a command, so that @code{@@end
  10298. tex} can be recognized. Texinfo processors will not output material
  10299. in such a region, unless @TeX{} output is being produced.
  10300. @findex \gdef @r{within @code{@@tex}}
  10301. @findex \globaldefs @r{within @code{@@tex}}
  10302. In complex cases, you may wish to define new @TeX{} macros within
  10303. @code{@@tex}. You must use @code{\gdef} to do this, not @code{\def},
  10304. because @code{@@tex} regions are processed in a @TeX{} group. If you
  10305. need to make several definitions, you may wish to set
  10306. @code{\globaldefs=1} (its value will be restored to zero as usual when
  10307. the group ends at @code{@@end tex}, so it won't cause problems with
  10308. the rest of the document).
  10309. @cindex Equation, displayed, in plain @TeX{}
  10310. @cindex Displayed equation, in plain @TeX{}
  10311. As an example, here is a displayed equation written in plain @TeX{}:
  10312. @example
  10313. @@tex
  10314. $$ \chi^2 = \sum_@{i=1@}^N
  10315. \left (y_i - (a + b x_i)
  10316. \over \sigma_i\right)^2 $$
  10317. @@end tex
  10318. @end example
  10319. @noindent
  10320. The output of this example will appear only in a printed manual. If
  10321. you are reading this in a format not generated by @TeX{}, you will not
  10322. see the equation that appears in the printed manual.
  10323. @tex
  10324. $$ \chi^2 = \sum_{i=1}^N
  10325. \left(y_i - (a + b x_i)
  10326. \over \sigma_i\right)^2 $$
  10327. @end tex
  10328. @cindex HTML, including raw
  10329. @findex ifhtml
  10330. @findex html
  10331. Analogously, you can use @code{@@ifhtml @dots{} @@end ifhtml} to
  10332. delimit Texinfo source to be included in HTML output only, and
  10333. @code{@@html @dots{} @@end html} for a region of raw HTML.
  10334. @cindex XML, including raw
  10335. @findex ifxml
  10336. @findex xml
  10337. Likewise, you can use @code{@@ifxml @dots{} @@end ifxml} to delimit
  10338. Texinfo source to be included in XML output only, and @code{@@xml
  10339. @dots{} @@end xml} for a region of raw XML@. Regions of raw text in
  10340. other formats will also be present in the XML output, but with
  10341. protection of XML characters and within corresponding elements. For
  10342. example, the raw HTML text:
  10343. @example
  10344. @group
  10345. @@html
  10346. <br />
  10347. @@end html
  10348. @end group
  10349. @end example
  10350. @noindent
  10351. will be included in the XML output as:
  10352. @example
  10353. @group
  10354. <html>
  10355. &lt;br /&gt;
  10356. </html>
  10357. @end group
  10358. @end example
  10359. @cindex Docbook, including raw
  10360. @findex ifdocbook
  10361. @findex docbook
  10362. Again likewise, you can use @code{@@ifdocbook @dots{} @@end ifdocbook}
  10363. to delimit Texinfo source to be included in Docbook output only, and
  10364. @code{@@docbook @dots{} @@end docbook} for a region of raw Docbook.
  10365. The behavior of newlines in raw regions is unspecified.
  10366. In all cases, in raw processing, @code{@@} retains the same meaning as
  10367. in the remainder of the document. Thus, the Texinfo processors must
  10368. recognize and even execute, to some extent, the contents of the raw
  10369. regions, regardless of the final output format. Therefore, specifying
  10370. changes that globally affect the document inside a raw region leads to
  10371. unpredictable and generally undesirable behavior. For example, using
  10372. the @code{@@kbdinputstyle} command inside a raw region is undefined.
  10373. The remedy is simple: don't do that. Use the raw formatter commands
  10374. for their intended purpose, of providing material directly in the
  10375. underlying format. When you simply want to give different Texinfo
  10376. specifications for different output formats, use the
  10377. @code{@@if@dots{}} conditionals and stay in Texinfo syntax.
  10378. @node Inline Conditionals
  10379. @section Inline Conditionals: @code{@@inline}, @code{@@inlineifelse}, @code{@@inlineraw}
  10380. @findex inlinefmt
  10381. @findex inlinefmtifelse
  10382. @findex inlineraw
  10383. @cindex Inline conditionals
  10384. @cindex Conditional commands, inline
  10385. @cindex Brace-delimited conditional text
  10386. @cindex Newlines, avoiding in conditionals
  10387. @cindex Whitespace, controlling in conditionals
  10388. Texinfo provides a set of conditional commands with arguments given
  10389. within braces:
  10390. @table @code
  10391. @item @@inlinefmt@{@var{format}, @var{text}@}
  10392. Process the Texinfo @var{text} if @var{format} output is being
  10393. generated.
  10394. @item @@inlinefmtifelse@{@var{format}, @var{then-text}, @var{else-text}@}
  10395. Process the Texinfo @var{then-text} if @var{format} output is being
  10396. generated; otherwise, process @var{else-text}.
  10397. @item @@inlineraw@{@var{format}, @var{text}@}
  10398. Similar, but for raw @var{text} (@pxref{Raw Formatter Commands}).
  10399. @end table
  10400. The supported @var{format} names are:
  10401. @example
  10402. docbook html info plaintext tex xml
  10403. @end example
  10404. For example,
  10405. @example
  10406. @@inlinefmt@{html, @@emph@{HTML-only text@}@}
  10407. @end example
  10408. @noindent is nearly equivalent to
  10409. @example
  10410. @@ifhtml
  10411. @@emph@{HTML-only text@}
  10412. @@end ifhtml
  10413. @end example
  10414. @noindent except that no whitespace is added, as happens in the latter
  10415. (environment) case.
  10416. In these commands, whitespace is ignored after the comma separating
  10417. the arguments, as usual, but is @emph{not} ignored at the end of
  10418. @var{text}.
  10419. To insert a literal at sign, left brace, or right brace in one of the
  10420. arguments, you must use the alphabetic commands @code{@@atchar@{@}}
  10421. (@pxref{Inserting an Atsign}), and @code{@@lbracechar@{@}} or
  10422. @code{@@rbracechar@{@}} (@pxref{Inserting Braces}), or the parsing
  10423. will become confused.
  10424. With @code{@@inlinefmtifelse}, it is also necessary to use
  10425. @code{@@comma@{@}} to avoid mistaking a @samp{,} in the text for the
  10426. delimiter. With @code{@@inlinefmt} and @code{@@inlineraw},
  10427. @code{@@comma@{@}} is not required (though it's fine to use it), since
  10428. these commands always have exactly two arguments.
  10429. For @TeX{}, the processed @var{text} cannot contain newline-delimited
  10430. commands. Text to be ignored (i.e., for non-@TeX{}) can, though.
  10431. Two other @code{@@inline...} conditionals complement the
  10432. @code{@@ifset} and @code{@@ifclear} commands; see the next section.
  10433. @node @code{@@set @@clear @@value}
  10434. @section Flags: @code{@@set}, @code{@@clear}, conditionals, and @code{@@value}
  10435. @anchor{set clear value}@c old name
  10436. You can direct the Texinfo formatting commands to format or ignore parts
  10437. of a Texinfo file with the @code{@@set}, @code{@@clear}, @code{@@ifset},
  10438. and @code{@@ifclear} commands.
  10439. Here are brief descriptions of these commands, see the following
  10440. sections for more details:
  10441. @table @code
  10442. @item @@set @var{flag} [@var{value}]
  10443. Set the variable @var{flag}, to the optional @var{value} if specified.
  10444. @item @@clear @var{flag}
  10445. Undefine the variable @var{flag}, whether or not it was previously defined.
  10446. @item @@ifset @var{flag}
  10447. If @var{flag} is set, text through the next @code{@@end ifset} command
  10448. is formatted. If @var{flag} is clear, text through the following
  10449. @code{@@end ifset} command is ignored.
  10450. @item @@inlineifset@{@var{flag}, @var{text}@}
  10451. Brace-delimited version of @code{@@ifset}.
  10452. @item @@ifclear @var{flag}
  10453. If @var{flag} is set, text through the next @code{@@end ifclear} command
  10454. is ignored. If @var{flag} is clear, text through the following
  10455. @code{@@end ifclear} command is formatted.
  10456. @item @@inlineifclear@{@var{flag}, @var{text}@}
  10457. Brace-delimited version of @code{@@ifclear}.
  10458. @end table
  10459. @menu
  10460. * @code{@@set @@value}:: Expand a flag variable to a string.
  10461. * @code{@@ifset @@ifclear}:: Format a region if a flag is set.
  10462. * @code{@@inlineifset @@inlineifclear}:: Brace-delimited flag conditionals.
  10463. * @code{@@value} Example:: An easy way to update edition information.
  10464. @end menu
  10465. @node @code{@@set @@value}
  10466. @subsection @code{@@set} and @code{@@value}
  10467. @anchor{set value}@c old name
  10468. @findex set
  10469. @findex value
  10470. @findex clear
  10471. You use the @code{@@set} command to specify a value for a flag, which
  10472. is later expanded by the @code{@@value} command.
  10473. A @dfn{flag} (aka @dfn{variable}) name is an identifier starting with
  10474. an alphanumeric, @samp{-}, or @samp{_}. Subsequent characters, if
  10475. any, may not be whitespace, @samp{@@}, braces, angle brackets, or any
  10476. of @samp{~`^+|}; other characters, such as @samp{%}, may work.
  10477. However, it is best to use only letters and numerals in a flag name,
  10478. not @samp{-} or @samp{_} or others---they will work in some contexts,
  10479. but not all, due to limitations in @TeX{}.
  10480. The value is the remainder of the input line, and can contain anything.
  10481. However, unlike most other commands which take the rest of the line as
  10482. a value, @code{@@set} need not appear at the beginning of a line.
  10483. Write the @code{@@set} command like this:
  10484. @example
  10485. @@set foo This is a string.
  10486. @end example
  10487. @noindent
  10488. This sets the value of the flag @code{foo} to ``This is a string.''.
  10489. The Texinfo formatters then replace a @code{@@value@{@var{flag}@}}
  10490. command with the string to which @var{flag} is set. Thus, when
  10491. @code{foo} is set as shown above, the Texinfo formatters convert this:
  10492. @example
  10493. @group
  10494. @@value@{foo@}
  10495. @exdent @r{to this:}
  10496. This is a string.
  10497. @end group
  10498. @end example
  10499. You can write a @code{@@value} command within a paragraph; but you
  10500. must write a @code{@@set} command on a line of its own.
  10501. If you write the @code{@@set} command like this:
  10502. @example
  10503. @@set foo
  10504. @end example
  10505. @noindent
  10506. without specifying a string, the value of @code{foo} is the empty string.
  10507. If you clear a previously set flag with @code{@@clear @var{flag}}, a
  10508. subsequent @code{@@value@{flag@}} command will report an error.
  10509. For example, if you set @code{foo} as follows:
  10510. @example
  10511. @@set howmuch very, very, very
  10512. @end example
  10513. @noindent
  10514. then the formatters transform
  10515. @example
  10516. @group
  10517. It is a @@value@{howmuch@} wet day.
  10518. @exdent @r{into}
  10519. It is a very, very, very wet day.
  10520. @end group
  10521. @end example
  10522. If you write
  10523. @example
  10524. @@clear howmuch
  10525. @end example
  10526. @noindent
  10527. then the formatters transform
  10528. @example
  10529. @group
  10530. It is a @@value@{howmuch@} wet day.
  10531. @exdent @r{into}
  10532. It is a @{No value for "howmuch"@} wet day.
  10533. @end group
  10534. @end example
  10535. @code{@@value} cannot be reliably used as the argument to an accent
  10536. command (@pxref{Inserting Accents}). For example, this fails:
  10537. @example
  10538. @@set myletter a
  10539. @@'@@value@{myletter@} @c fails!
  10540. @end example
  10541. @node @code{@@ifset @@ifclear}
  10542. @subsection @code{@@ifset} and @code{@@ifclear}
  10543. @anchor{ifset ifclear}@c old name
  10544. @findex ifset
  10545. When a @var{flag} is set, the Texinfo formatting commands format text
  10546. between subsequent pairs of @code{@@ifset @var{flag}} and @code{@@end
  10547. ifset} commands. When the @var{flag} is cleared, the Texinfo formatting
  10548. commands do @emph{not} format the text. @code{@@ifclear} operates
  10549. analogously.
  10550. Write the conditionally formatted text between @code{@@ifset @var{flag}}
  10551. and @code{@@end ifset} commands, like this:
  10552. @example
  10553. @group
  10554. @@ifset @var{flag}
  10555. @var{conditional-text}
  10556. @@end ifset
  10557. @end group
  10558. @end example
  10559. For example, you can create one document that has two variants, such as
  10560. a manual for a `large' and `small' model:
  10561. @cindex Shrubbery
  10562. @example
  10563. You can use this machine to dig up shrubs
  10564. without hurting them.
  10565. @@set large
  10566. @@ifset large
  10567. It can also dig up fully grown trees.
  10568. @@end ifset
  10569. Remember to replant promptly @dots{}
  10570. @end example
  10571. @noindent
  10572. In the example, the formatting commands will format the text between
  10573. @code{@@ifset large} and @code{@@end ifset} because the @code{large}
  10574. flag is set.
  10575. When @var{flag} is cleared, the Texinfo formatting commands do
  10576. @emph{not} format the text between @code{@@ifset @var{flag}} and
  10577. @code{@@end ifset}; that text is ignored and does not appear in either
  10578. printed or Info output.
  10579. For example, if you clear the flag of the preceding example by writing
  10580. an @code{@@clear large} command after the @code{@@set large} command
  10581. (but before the conditional text), then the Texinfo formatting commands
  10582. ignore the text between the @code{@@ifset large} and @code{@@end ifset}
  10583. commands. In the formatted output, that text does not appear; in both
  10584. printed and Info output, you see only the lines that say, ``You can use
  10585. this machine to dig up shrubs without hurting them. Remember to replant
  10586. promptly @dots{}''.
  10587. @findex ifclear
  10588. If a flag is cleared with a @code{@@clear @var{flag}} command, then
  10589. the formatting commands format text between subsequent pairs of
  10590. @code{@@ifclear} and @code{@@end ifclear} commands. But if the flag
  10591. is set with @code{@@set @var{flag}}, then the formatting commands do
  10592. @emph{not} format text between an @code{@@ifclear} and an @code{@@end
  10593. ifclear} command; rather, they ignore that text. An @code{@@ifclear}
  10594. command looks like this:
  10595. @example
  10596. @@ifclear @var{flag}
  10597. @end example
  10598. @node @code{@@inlineifset @@inlineifclear}
  10599. @subsection @code{@@inlineifset} and @code{@@inlineifclear}
  10600. @findex inlineifset
  10601. @findex inlineifclear
  10602. @cindex Flag conditionals, brace-delimited
  10603. @cindex Brace-delimited flag conditionals
  10604. @code{@@inlineifset} and @code{@@inlineifclear} provide
  10605. brace-delimited alternatives to the @code{@@ifset} and
  10606. @code{@@ifclear} forms, similar to the other @code{@@inline...}
  10607. Commands (@pxref{Inline Conditionals}). The same caveats about
  10608. argument parsing given there apply here too.
  10609. @table @code
  10610. @item @@inlineifset@{@var{var}, @var{text}@}
  10611. Process the Texinfo @var{text} if the flag @var{var} is defined.
  10612. @item @@inlineifclear@{@var{var}, @var{text}@}
  10613. Process the Texinfo @var{text} if the flag @var{var} is not defined.
  10614. @end table
  10615. Except for the syntax, their general behavior and purposes is the same
  10616. as with @code{@@ifset} and @code{@@ifclear}, described in the previous
  10617. section.
  10618. @node @code{@@value} Example
  10619. @subsection @code{@@value} Example
  10620. @anchor{value Example}@c old name
  10621. You can use the @code{@@value} command to minimize the number of
  10622. places you need to change when you record an update to a manual.
  10623. @xref{GNU Sample Texts}, for the full text of an example of using this
  10624. to work with Automake distributions.
  10625. This example is adapted from @ref{Top,,, make, The GNU Make Manual}.
  10626. @enumerate
  10627. @item
  10628. Set the flags:
  10629. @example
  10630. @group
  10631. @@set EDITION 0.35 Beta
  10632. @@set VERSION 3.63 Beta
  10633. @@set UPDATED 14 August 1992
  10634. @@set UPDATE-MONTH August 1992
  10635. @end group
  10636. @end example
  10637. @item
  10638. Write text for the @code{@@copying} section (@pxref{@code{@@copying}}):
  10639. @example
  10640. @group
  10641. @@copying
  10642. This is Edition @@value@{EDITION@},
  10643. last updated @@value@{UPDATED@},
  10644. of @@cite@{The GNU Make Manual@},
  10645. for @@code@{make@}, version @@value@{VERSION@}.
  10646. Copyright @dots{}
  10647. Permission is granted @dots{}
  10648. @@end copying
  10649. @end group
  10650. @end example
  10651. @item
  10652. Write text for the title page, for people reading the printed manual:
  10653. @example
  10654. @group
  10655. @@titlepage
  10656. @@title GNU Make
  10657. @@subtitle A Program for Directing Recompilation
  10658. @@subtitle Edition @@value@{EDITION@}, @dots{}
  10659. @@subtitle @@value@{UPDATE-MONTH@}
  10660. @@page
  10661. @@insertcopying
  10662. @dots{}
  10663. @@end titlepage
  10664. @end group
  10665. @end example
  10666. @noindent
  10667. (On a printed cover, a date listing the month and the year looks less
  10668. fussy than a date listing the day as well as the month and year.)
  10669. @item
  10670. Write text for the Top node, for people reading the Info file:
  10671. @example
  10672. @group
  10673. @@ifnottex
  10674. @@node Top
  10675. @@top Make
  10676. This is Edition @@value@{EDITION@},
  10677. last updated @@value@{UPDATED@},
  10678. of @@cite@{The GNU Make Manual@},
  10679. for @@code@{make@}, version @@value@{VERSION@}.
  10680. @@end ifnottex
  10681. @end group
  10682. @end example
  10683. After you format the manual, the @code{@@value} constructs have been
  10684. expanded, so the output contains text like this:
  10685. @example
  10686. @group
  10687. This is Edition 0.35 Beta, last updated 14 August 1992,
  10688. of `The GNU Make Manual', for `make', Version 3.63 Beta.
  10689. @end group
  10690. @end example
  10691. @end enumerate
  10692. When you update the manual, you change only the values of the flags; you
  10693. do not need to edit the three sections.
  10694. @node Testing for Texinfo Commands
  10695. @section Testing for Texinfo Commands: @code{@@ifcommanddefined}, @code{@@ifcommandnotdefined}
  10696. @cindex Testing for Texinfo commands
  10697. @cindex Checking for Texinfo commands
  10698. @cindex Texinfo commands, testing for
  10699. @cindex Commands, testing for Texinfo
  10700. @cindex Versions of Texinfo, adapting to
  10701. @cindex Features of Texinfo, adapting to
  10702. @findex ifcommanddefined
  10703. @findex ifcommandnotdefined
  10704. Occasionally, you may want to arrange for your manual to test if a
  10705. given Texinfo command is available and (presumably) do some sort of
  10706. fallback formatting if not. There are conditionals
  10707. @code{@@ifcommanddefined} and @code{@@ifcommandnotdefined} to do this.
  10708. For example:
  10709. @example
  10710. @@ifcommanddefined node
  10711. Good, @@samp@{@@@@node@} is defined.
  10712. @@end ifcommanddefined
  10713. @end example
  10714. @noindent will output the expected `Good, @samp{@@node} is defined.'.
  10715. This conditional will also consider any new commands defined by
  10716. the document via @code{@@macro}, @code{@@alias},
  10717. @code{@@definfoenclose}, and @code{@@def@r{(}code@r{)}index}
  10718. (@pxref{Defining New Texinfo Commands}) to be true. Caveat: the @TeX{}
  10719. implementation reports internal @TeX{} commands, in addition to all
  10720. the Texinfo commands, as being ``defined''; the @code{makeinfo}
  10721. implementation is reliable in this regard, however.
  10722. @pindex @file{NEWS} file for Texinfo
  10723. You can check the @file{NEWS} file in the Texinfo source distribution
  10724. and linked from the Texinfo home page
  10725. (@url{http://www.gnu.org/software/texinfo}) to see when a particular
  10726. command was added.
  10727. @vindex txicommandconditionals
  10728. These command-checking conditionals themselves were added in
  10729. Texinfo@tie{}5.0, released in 2013---decades after Texinfo's
  10730. inception. In order to test if they themselves are available,
  10731. the predefined flag @code{txicommandconditionals} can be tested, like
  10732. this:
  10733. @example
  10734. @@ifset txicommandconditionals
  10735. @@ifcommandnotdefined foobarnode
  10736. (Good, @@samp@{@@@@foobarnode@} is not defined.)
  10737. @@end ifcommandnotdefined
  10738. @@end ifset
  10739. @end example
  10740. Since flags (see the previous section) were added early in the
  10741. existence of Texinfo, there is no problem with assuming they are
  10742. available.
  10743. We recommend avoiding these tests whenever possible---which is usually
  10744. the case. For many software packages, it is reasonable for all
  10745. developers to have a given version of Texinfo (or newer) installed,
  10746. and thus no reason to worry about older versions. (It is
  10747. straightforward for anyone to download and install the Texinfo source;
  10748. it does not have any problematic dependencies.)
  10749. The issue of Texinfo versions does not generally arise for end-users.
  10750. With properly distributed packages, users need not process the Texinfo
  10751. manual simply to build and install the package; they can use
  10752. preformatted Info (or other) output files. This is desirable in
  10753. general, to avoid unnecessary dependencies between packages
  10754. (@pxref{Releases,,, standards, GNU Coding Standards}).
  10755. @node Conditional Nesting
  10756. @section Conditional Nesting
  10757. @cindex Conditionals, nested
  10758. @cindex Nesting conditionals
  10759. Conditionals can be nested; however, the details are a little tricky.
  10760. The difficulty comes with failing conditionals, such as
  10761. @code{@@ifhtml} when HTML is not being produced, where the included
  10762. text is to be ignored. However, it is not to be @emph{completely}
  10763. ignored, since it is useful to have one @code{@@ifset} inside another,
  10764. for example---that is a way to include text only if two conditions are
  10765. met. Here's an example:
  10766. @example
  10767. @@ifset somevar
  10768. @@ifset anothervar
  10769. Both somevar and anothervar are set.
  10770. @@end ifset
  10771. @@ifclear anothervar
  10772. Somevar is set, anothervar is not.
  10773. @@end ifclear
  10774. @@end ifset
  10775. @end example
  10776. Technically, Texinfo requires that for a failing conditional, the
  10777. ignored text must be properly nested with respect to that failing
  10778. conditional. Unfortunately, it's not always feasible to check that
  10779. @emph{all} conditionals are properly nested, because then the
  10780. processors could have to fully interpret the ignored text, which
  10781. defeats the purpose of the command. Here's an example illustrating
  10782. these rules:
  10783. @example
  10784. @@ifset a
  10785. @@ifset b
  10786. @@ifclear ok - ok, ignored
  10787. @@end junky - ok, ignored
  10788. @@end ifset
  10789. @@c WRONG - missing @@end ifset.
  10790. @end example
  10791. Finally, as mentioned above, all conditional commands must be on lines
  10792. by themselves, with no text (even spaces) before or after. Otherwise,
  10793. the processors cannot reliably determine which commands to consider
  10794. for nesting purposes.
  10795. @node Defining New Texinfo Commands
  10796. @chapter Defining New Texinfo Commands
  10797. @cindex Macros
  10798. @cindex Defining new Texinfo commands
  10799. @cindex New Texinfo commands, defining
  10800. @cindex Texinfo commands, defining new
  10801. @cindex User-defined Texinfo commands
  10802. Texinfo provides several ways to define new commands (in all cases,
  10803. it's not recommended to try redefining existing commands):
  10804. @itemize @bullet
  10805. @item
  10806. A Texinfo @dfn{macro} allows you to define a new Texinfo command as any
  10807. sequence of text and/or existing commands (including other macros). The
  10808. macro can have any number of @dfn{parameters}---text you supply each
  10809. time you use the macro.
  10810. Incidentally, these macros have nothing to do with the @code{@@defmac}
  10811. command, which is for documenting macros in the subject area of the
  10812. manual (@pxref{Def Cmd Template}).
  10813. @item
  10814. @samp{@@alias} is a convenient way to define a new name for an existing
  10815. command.
  10816. @item
  10817. @samp{@@definfoenclose} allows you to define new commands with
  10818. customized output for all non-@TeX{} output formats.
  10819. @end itemize
  10820. Most generally of all (not just for defining new commands), it is
  10821. possible to invoke any external macro processor and have Texinfo
  10822. recognize so-called @code{#line} directives for error reporting.
  10823. If you want to do simple text substitution, @code{@@set} and
  10824. @code{@@value} is the simplest approach (@pxref{@code{@@set @@clear
  10825. @@value}}).
  10826. @menu
  10827. * Defining Macros:: Defining and undefining new commands.
  10828. * Invoking Macros:: Using a macro, once you've defined it.
  10829. * Macro Details:: Limitations of Texinfo macros.
  10830. * @code{@@alias}:: Command aliases.
  10831. * @code{@@definfoenclose}:: Customized highlighting.
  10832. * External Macro Processors:: @code{#line} directives.
  10833. @end menu
  10834. @node Defining Macros
  10835. @section Defining Macros
  10836. @cindex Defining macros
  10837. @cindex Macro definitions, Texinfo
  10838. @findex macro
  10839. You use the Texinfo @code{@@macro} command to define a macro, like this:
  10840. @example
  10841. @@macro @var{macroname}@{@var{param1}, @var{param2}, @dots{}@}
  10842. @var{text} @dots{} \@var{param1}\ @dots{}
  10843. @@end macro
  10844. @end example
  10845. The @dfn{parameters} @var{param1}, @var{param2}, @dots{} correspond to
  10846. arguments supplied when the macro is subsequently used in the document
  10847. (described in the next section).
  10848. @cindex Macro names, valid characters in
  10849. @cindex Names of macros, valid characters of
  10850. For a macro to work consistently with @TeX{}, @var{macroname} must
  10851. consist entirely of letters: no digits, hyphens, underscores, or other
  10852. special characters. So, we recommend using only letters. However,
  10853. @command{makeinfo} will accept anything consisting of alphanumerics,
  10854. and (except as the first character) @samp{-}. The @samp{_} character
  10855. is excluded so that macros can be called inside @code{@@math} without
  10856. a following space (@pxref{Inserting Math}).
  10857. If a macro needs no parameters, you can define it either with an empty
  10858. list (@samp{@@macro foo @{@}}) or with no braces at all (@samp{@@macro
  10859. foo}).
  10860. @cindex Body of a macro
  10861. The definition or @dfn{body} of the macro can contain most Texinfo
  10862. commands, including macro invocations. However, a macro definition
  10863. that defines another macro does not work in @TeX{} due to limitations
  10864. in the design of @code{@@macro}.
  10865. @cindex Parameters to macros
  10866. In the macro body, instances of a parameter name surrounded by
  10867. backslashes, as in @samp{\@var{param1}\} in the example above, are
  10868. replaced by the corresponding argument from the macro invocation. You
  10869. can use parameter names any number of times in the body, including zero.
  10870. @cindex Backslash in macros
  10871. To get a single @samp{\} in the macro expansion, use @samp{\\}. Any
  10872. other use of @samp{\} in the body yields a warning.
  10873. @cindex Spaces in macros
  10874. @cindex Whitespace in macros
  10875. The newline characters after the @code{@@macro} line and before the
  10876. @code{@@end macro} line are ignored, that is, not included in the
  10877. macro body. All other whitespace is treated according to the usual
  10878. Texinfo rules.
  10879. @cindex Recursive macro invocations
  10880. @findex rmacro
  10881. To allow a macro to be used recursively, that is, in an argument to a
  10882. call to itself, you must define it with @samp{@@rmacro}, like this:
  10883. @example
  10884. @@rmacro rmac @{arg@}
  10885. a\arg\b
  10886. @@end rmacro
  10887. @dots{}
  10888. @@rmac@{1@@rmac@{text@}2@}
  10889. @end example
  10890. This produces the output `a1atextb2b'. With @samp{@@macro} instead of
  10891. @samp{@@rmacro}, an error message is given.
  10892. @findex unmacro
  10893. @cindex Macros, undefining
  10894. @cindex Undefining macros
  10895. You can undefine a macro @var{foo} with @code{@@unmacro @var{foo}}.
  10896. It is not an error to undefine a macro that is already undefined.
  10897. For example:
  10898. @example
  10899. @@unmacro foo
  10900. @end example
  10901. @node Invoking Macros
  10902. @section Invoking Macros
  10903. @cindex Invoking macros
  10904. @cindex Expanding macros
  10905. @cindex Running macros
  10906. @cindex Macro invocation
  10907. After a macro is defined (see the previous section), you can
  10908. @dfn{invoke} (use) it in your document like this:
  10909. @example
  10910. @@@var{macroname} @{@var{arg1}, @var{arg2}, @dots{}@}
  10911. @end example
  10912. @noindent and the result will be more or less as if you typed the body of
  10913. @var{macroname} at that spot. For example:
  10914. @example
  10915. @@macro foo @{p, q@}
  10916. Together: \p\ & \q\.
  10917. @@end macro
  10918. @@foo@{a, b@}
  10919. @end example
  10920. @noindent produces:
  10921. @display
  10922. Together: a & b.
  10923. @end display
  10924. @cindex Backslash, and macros
  10925. Thus, the arguments and parameters are separated by commas and
  10926. delimited by braces; any whitespace after (but not before) a comma is
  10927. ignored. The braces are required in the invocation even when the
  10928. macro takes no arguments, consistent with other Texinfo commands. For
  10929. example:
  10930. @example
  10931. @@macro argless @{@}
  10932. No arguments here.
  10933. @@end macro
  10934. @@argless@{@}
  10935. @end example
  10936. @noindent produces:
  10937. @display
  10938. No arguments here.
  10939. @end display
  10940. @cindex Comma, in macro arguments
  10941. Passing macro arguments containing commas requires care, since
  10942. commas also separate the arguments. To include a comma character in
  10943. an argument, the most reliable method is to use the @code{@@comma@{@}}
  10944. command. For @code{makeinfo}, you can also prepend a backslash
  10945. character, as in @samp{\,}, but this does not work with @TeX{}.
  10946. @cindex Automatic quoting of commas for some macros
  10947. @cindex Quoting, automatic for some macros
  10948. It's not always necessary to worry about commas. To facilitate use of
  10949. macros, @command{makeinfo} implements two rules for @dfn{automatic
  10950. quoting} in some circumstances:
  10951. @enumerate 1
  10952. @item If a macro takes only one argument, all commas in its invocation
  10953. are quoted by default. For example:
  10954. @example
  10955. @group
  10956. @@macro TRYME@{text@}
  10957. @@strong@{TRYME: \text\@}
  10958. @@end macro
  10959. @@TRYME@{A nice feature, though it can be dangerous.@}
  10960. @end group
  10961. @end example
  10962. @noindent
  10963. will produce the following output
  10964. @example
  10965. @strong{TRYME: A nice feature, though it can be dangerous.}
  10966. @end example
  10967. And indeed, it can. Namely, @command{makeinfo} does not control the
  10968. number of arguments passed to one-argument macros, so be careful when
  10969. you invoke them.
  10970. @item If a macro invocation includes another command (including a
  10971. recursive invocation of itself), any commas in the nested command
  10972. invocation(s) are quoted by default. For example, in
  10973. @example
  10974. @@say@{@@strong@{Yes, I do@}, person one@}
  10975. @end example
  10976. the comma after @samp{Yes} is implicitly quoted. Here's another
  10977. example, with a recursive macro:
  10978. @example
  10979. @group
  10980. @@rmacro cat@{a,b@}
  10981. \a\\b\
  10982. @@end rmacro
  10983. @@cat@{@@cat@{foo, bar@}, baz@}
  10984. @end group
  10985. @end example
  10986. @noindent
  10987. will produce the string @samp{foobarbaz}.
  10988. @item Otherwise, a comma should be explicitly quoted, as above, for it
  10989. to be treated as a part of an argument.
  10990. @end enumerate
  10991. @cindex Backslash, in macro arguments
  10992. @cindex Braces, in macro arguments
  10993. The backslash itself can be quoted in macro arguments with another
  10994. backslash. For example:
  10995. @example
  10996. @@@var{macname} @{\\bleh@}
  10997. @end example
  10998. @noindent
  10999. will pass the argument @samp{\bleh} to @var{macname}.
  11000. @command{makeinfo} also recognizes @samp{\@{} and @samp{\@}} sequences
  11001. for curly braces, but these are not recognized by the implementation in
  11002. @TeX{}. There should, however, rarely be a need for these, as they are
  11003. only needed when a macro argument contains unbalanced braces.
  11004. If a macro is defined to take exactly one argument, it can be
  11005. invoked without any braces, taking all of the line after the macro name
  11006. as the argument. For example:
  11007. @example
  11008. @@macro bar @{p@}
  11009. Twice: \p\ & \p\.
  11010. @@end macro
  11011. @@bar aah
  11012. @end example
  11013. @noindent produces:
  11014. @display
  11015. Twice: aah & aah.
  11016. @end display
  11017. @noindent
  11018. In these arguments, there is no escaping of special characters, so each
  11019. @samp{\} stands for itself.
  11020. If a macro is defined to take more than one argument, but is called
  11021. with only one (in braces), the remaining arguments are set to the
  11022. empty string, and no error is given. For example:
  11023. @example
  11024. @@macro addtwo @{p, q@}
  11025. Both: \p\\q\.
  11026. @@end macro
  11027. @@addtwo@{a@}
  11028. @end example
  11029. @noindent produces simply:
  11030. @display
  11031. Both: a.
  11032. @end display
  11033. @node Macro Details
  11034. @section Macro Details and Caveats
  11035. @cindex Macro details
  11036. @cindex Details of macro usage
  11037. @cindex Caveats for macro usage
  11038. @cindex Macro expansion, contexts for
  11039. @cindex Expansion of macros, contexts for
  11040. By design, macro expansion does not happen in the following contexts
  11041. in @command{makeinfo}:
  11042. @itemize @bullet
  11043. @item @code{@@macro} and @code{@@unmacro} lines;
  11044. @item @code{@@if...} lines, including @code{@@ifset} and similar;
  11045. @item @code{@@set}, @code{@@clear}, @code{@@value};
  11046. @item @code{@@clickstyle} lines;
  11047. @item @code{@@end} lines.
  11048. @end itemize
  11049. @noindent Unfortunately, @TeX{} may do some expansion in these situations,
  11050. possibly yielding errors.
  11051. Also, quite a few macro-related constructs cause problems with @TeX{};
  11052. some of the caveats are listed below. Thus, if you get macro-related
  11053. errors when producing the printed version of a manual, you might try
  11054. expanding the macros with @command{makeinfo} by invoking
  11055. @command{texi2dvi} with the @samp{-E} option (@pxref{Format with
  11056. @command{texi2dvi}}). Or, more reliably, eschew Texinfo macros altogether
  11057. and use a language designed for macro processing, such as M4
  11058. (@pxref{External Macro Processors}).
  11059. @itemize @bullet
  11060. @item
  11061. As mentioned earlier, macro names must consist entirely of letters.
  11062. @item
  11063. It is not advisable to redefine any @TeX{} primitive, plain, or
  11064. Texinfo command name as a macro. Unfortunately this is a large and
  11065. open-ended set of names, and the possible resulting errors are
  11066. unpredictable.
  11067. @item
  11068. Arguments to macros taking more than one argument cannot cross lines.
  11069. @item
  11070. Macros containing a command which must be on a line by itself, such as
  11071. a conditional, cannot be invoked in the middle of a line. Similarly,
  11072. macros containing line-oriented commands or text, such as
  11073. @code{@@example} environments, may behave unpredictably in @TeX{}.
  11074. @item
  11075. If you have problems using conditionals within a macro, an alternative
  11076. is to use separate macro definitions inside conditional blocks. For
  11077. example, instead of
  11078. @example
  11079. @@macro Mac
  11080. @@iftex
  11081. text for TeX output
  11082. @@end iftex
  11083. @@ifnottex
  11084. text for not TeX output
  11085. @@end ifnottex
  11086. @@end macro
  11087. @end example
  11088. @noindent you can do the following instead:
  11089. @example
  11090. @@iftex
  11091. @@macro Mac
  11092. text for TeX output
  11093. @@end macro
  11094. @@end iftex
  11095. @@ifnottex
  11096. @@macro Mac
  11097. text for not TeX output
  11098. @@end macro
  11099. @@end ifnottex
  11100. @end example
  11101. @item
  11102. Texinfo commands in the expansion of a macro in the text of an index
  11103. entry may end up being typeset as literal text (including an ``@@''
  11104. sign), instead of being interpreted with their intended meaning.
  11105. @item
  11106. White space is ignored at the beginnings of lines.
  11107. @item
  11108. Macros can't be reliably used in the argument to accent commands
  11109. (@pxref{Inserting Accents}).
  11110. @item
  11111. The backslash escape for commas in macro arguments does not work;
  11112. @code{@@comma@{@}} must be used.
  11113. @item
  11114. Likewise, if you want to pass an argument with the Texinfo command
  11115. @code{@@,} (to produce a cedilla, see @ref{Inserting Accents}), you have
  11116. to use @code{@@value} or another work-around. Otherwise, the comma
  11117. may be taken as separating the arguments. For example,
  11118. @example
  11119. @@macro mactwo@{argfirst, argsecond@}
  11120. \argfirst\+\argsecond\.
  11121. @@end macro
  11122. @@set fc Fran@@,cois
  11123. @@mactwo@{@@value@{fc@},@}
  11124. @end example
  11125. @noindent produces:
  11126. @display
  11127. Fran@,cois+.
  11128. @end display
  11129. @c currently @mactwo{Fran@,cois} works in TeX, but @mactwo{Franc@\,cois}
  11130. @c works in makeinfo. better to avoid commas altogether using this trick.
  11131. @c an alternative to @, could be invented if needed.
  11132. @item
  11133. Ending a macro body with @samp{@@c} may cause text following the macro
  11134. invocation to be ignored as a comment in @command{makeinfo}. This is
  11135. not the case when processing with @TeX{}. This was often done
  11136. to ``comment out'' an unwanted newline at the end of a macro body, but
  11137. this is not necessary any more, as the final newline before @samp{@@end
  11138. macro} is not included in the macro body anyway.
  11139. @item
  11140. In general, you can't arbitrarily substitute a macro (or
  11141. @code{@@value}) call for Texinfo command arguments, even when the text
  11142. is the same. Texinfo is not M4 (or even plain @TeX{}). It might work
  11143. with some commands, it fails with others. Best not to do it at all.
  11144. For instance, this fails:
  11145. @example
  11146. @@macro offmacro
  11147. off
  11148. @@end macro
  11149. @@headings @@offmacro
  11150. @end example
  11151. @noindent
  11152. This looks equivalent to @code{@@headings off}, but for @TeX{}nical
  11153. reasons, it fails with a mysterious error message (namely,
  11154. @samp{Paragraph ended before @@headings was complete}).
  11155. @item
  11156. Macros cannot define macros in the natural way. To do this, you must
  11157. use conditionals and raw @TeX{}. For example:
  11158. @example
  11159. @@ifnottex
  11160. @@macro ctor @{name, arg@}
  11161. @@macro \name\
  11162. something involving \arg\ somehow
  11163. @@end macro
  11164. @@end macro
  11165. @@end ifnottex
  11166. @@tex
  11167. \gdef\ctor#1@{\ctorx#1,@}
  11168. \gdef\ctorx#1,#2,@{\def#1@{something involving #2 somehow@}@}
  11169. @@end tex
  11170. @end example
  11171. @end itemize
  11172. The @command{makeinfo} implementation also has the following
  11173. limitations (by design):
  11174. @itemize
  11175. @item
  11176. @code{@@verbatim} and macros do not mix; for instance, you can't start
  11177. a verbatim block inside a macro and end it outside
  11178. (@pxref{@code{@@verbatim}}). Starting any environment inside a macro
  11179. and ending it outside may or may not work, for that matter.
  11180. @item
  11181. Macros that completely define macros are ok, but it's not possible to
  11182. have incompletely nested macro definitions. That is, @code{@@macro}
  11183. and @code{@@end macro} (likewise for @code{@@rmacro}) must be
  11184. correctly paired. For example, you cannot start a macro definition
  11185. within a macro, and then end that nested definition outside the macro.
  11186. @end itemize
  11187. In the @code{makeinfo} implementation before Texinfo 5.0, ends of
  11188. lines from expansion of a @code{@@macro} definition did not end an
  11189. @@-command line-delimited argument (@code{@@chapter}, @code{@@center},
  11190. etc.). This is no longer the case. For example:
  11191. @example
  11192. @@macro twolines@{@}
  11193. aaa
  11194. bbb
  11195. @@end macro
  11196. @@center @@twolines@{@}
  11197. @end example
  11198. In the current @code{makeinfo}, this is equivalent to:
  11199. @example
  11200. @@center aaa
  11201. bbb
  11202. @end example
  11203. @noindent with just @samp{aaa} as the argument to @code{@@center}. In
  11204. the earlier implementation, it would have been parsed as this:
  11205. @example
  11206. @@center aaa bbb
  11207. @end example
  11208. @node @code{@@alias}
  11209. @section @samp{@@alias @var{new}=@var{existing}}
  11210. @anchor{alias}@c old name
  11211. @cindex Aliases, command
  11212. @cindex Command aliases
  11213. @findex alias
  11214. The @samp{@@alias} command defines a new command to be just like an
  11215. existing one. This is useful for defining additional markup names,
  11216. thus preserving additional semantic information in the input even
  11217. though the output result may be the same.
  11218. Write the @samp{@@alias} command on a line by itself, followed by the
  11219. new command name, an equals sign, and the existing command name.
  11220. Whitespace around the equals sign is optional and ignored if present.
  11221. Thus:
  11222. @example
  11223. @@alias @var{new} = @var{existing}
  11224. @end example
  11225. For example, if your document contains citations for both books and
  11226. some other media (movies, for example), you might like to define a
  11227. macro @code{@@moviecite@{@}} that does the same thing as an ordinary
  11228. @code{@@cite@{@}} but conveys the extra semantic information as well.
  11229. You'd do this as follows:
  11230. @example
  11231. @@alias moviecite = cite
  11232. @end example
  11233. Macros do not always have the same effect as aliases, due to vagaries
  11234. of argument parsing. Also, aliases are much simpler to define than
  11235. macros. So the command is not redundant.
  11236. Unfortunately, it's not possible to alias Texinfo environments; for
  11237. example, @code{@@alias lang=example} is an error.
  11238. Aliases must not be recursive, directly or indirectly.
  11239. It is not advisable to redefine any @TeX{} primitive, plain @TeX{}, or
  11240. Texinfo command name as an alias. Unfortunately this is a very large
  11241. set of names, and the possible resulting errors from @TeX{} are
  11242. unpredictable.
  11243. @command{makeinfo} will accept the same identifiers for aliases as it
  11244. does for macro names, that is, alphanumerics and (except as the first
  11245. character) @samp{-}.
  11246. @node @code{@@definfoenclose}
  11247. @section @code{@@definfoenclose}: Customized Highlighting
  11248. @anchor{definfoenclose}@c old name
  11249. @cindex Highlighting, customized
  11250. @cindex Customized highlighting
  11251. @findex definfoenclose
  11252. An @code{@@definfoenclose} command may be used to define a
  11253. highlighting command for all the non-@TeX{} output formats. A command
  11254. defined using @code{@@definfoenclose} marks text by enclosing it in
  11255. strings that precede and follow the text. You can use this to get
  11256. closer control of your output.
  11257. Presumably, if you define a command with @code{@@definfoenclose}, you
  11258. will create a corresponding command for @TeX{}, either in
  11259. @file{texinfo.tex}, @file{texinfo.cnf}, or within an @samp{@@iftex} or
  11260. @samp{@@tex} in your document.
  11261. Write a @code{@@definfoenclose} command at the beginning of a line
  11262. followed by three comma-separated arguments. The first argument to
  11263. @code{@@definfoenclose} is the @@-command name (without the
  11264. @code{@@}); the second argument is the start delimiter string; and the
  11265. third argument is the end delimiter string. The latter two arguments
  11266. enclose the highlighted text in the output.
  11267. A delimiter string may contain spaces. Neither the start nor end
  11268. delimiter is required. If you do not want a start delimiter but do
  11269. want an end delimiter, you must follow the command name with two
  11270. commas in a row; otherwise, the end delimiter string you intended will
  11271. naturally be (mis)interpreted as the start delimiter string.
  11272. If you do a @code{@@definfoenclose} on the name of a predefined
  11273. command (such as @code{@@emph}, @code{@@strong}, @code{@@t}, or
  11274. @code{@@i}), the enclosure definition will override the built-in
  11275. definition. We don't recommend this.
  11276. An enclosure command defined this way takes one argument in braces,
  11277. since it is intended for new markup commands (@pxref{Marking Text}).
  11278. @findex phoo
  11279. For example, you can write:
  11280. @example
  11281. @@definfoenclose phoo,//,\\
  11282. @end example
  11283. @noindent
  11284. near the beginning of a Texinfo file to define @code{@@phoo} as an Info
  11285. formatting command that inserts `//' before and `\\' after the argument
  11286. to @code{@@phoo}. You can then write @code{@@phoo@{bar@}} wherever you
  11287. want `//bar\\' highlighted in Info.
  11288. For @TeX{} formatting, you could write
  11289. @example
  11290. @@iftex
  11291. @@global@@let@@phoo=@@i
  11292. @@end iftex
  11293. @end example
  11294. @noindent
  11295. to define @code{@@phoo} as a command that causes @TeX{} to typeset the
  11296. argument to @code{@@phoo} in italics.
  11297. Each definition applies to its own formatter: one for @TeX{}, the
  11298. other for everything else. The raw @TeX{} commands need to be in
  11299. @samp{@@iftex}. @code{@@definfoenclose} command need not be within
  11300. @samp{@@ifinfo}, unless you want to use different definitions for
  11301. different output formats.
  11302. @findex headword
  11303. Here is another example: write
  11304. @example
  11305. @@definfoenclose headword, , :
  11306. @end example
  11307. @noindent
  11308. near the beginning of the file, to define @code{@@headword} as an Info
  11309. formatting command that inserts nothing before and a colon after the
  11310. argument to @code{@@headword}.
  11311. @samp{@@definfoenclose} definitions must not be recursive, directly or
  11312. indirectly.
  11313. @node External Macro Processors
  11314. @section External Macro Processors: Line Directives
  11315. @cindex External macro processors
  11316. @cindex Macro processors, external
  11317. Texinfo macros (and its other text substitution facilities) work fine
  11318. in straightforward cases. If your document needs unusually complex
  11319. processing, however, their fragility and limitations can be a problem.
  11320. In this case, you may want to use a different macro processor
  11321. altogether, such as M4 (@pxref{Top,,, m4, M4}) or CPP (@pxref{Top,,,
  11322. cpp, The C Preprocessor}).
  11323. With one exception, Texinfo does not need to know whether its input is
  11324. ``original'' source or preprocessed from some other source file.
  11325. Therefore, you can arrange your build system to invoke whatever
  11326. programs you like to handle macro expansion or other preprocessing
  11327. needs. Texinfo does not offer built-in support for any particular
  11328. preprocessor, since no one program seemed likely to suffice for the
  11329. requirements of all documents.
  11330. @cindex Line numbers, in error messages
  11331. @cindex Error messages, line numbers in
  11332. The one exception is line numbers in error messages. In that case,
  11333. the line number should refer to the original source file, whatever it
  11334. may be. There's a well-known mechanism for this: the so-called
  11335. @samp{#line} directive. Texinfo supports this.
  11336. @menu
  11337. * @samp{#line} Directive::
  11338. * TeX: @samp{#line} and @TeX{}.
  11339. * Syntax: @samp{#line} Syntax Details.
  11340. @end menu
  11341. @node @samp{#line} Directive
  11342. @subsection @samp{#line} Directive
  11343. @cindex @samp{#line} directive
  11344. An input line such as this:
  11345. @example
  11346. @hashchar{}line 100 "foo.ptexi"
  11347. @end example
  11348. @noindent indicates that the next line was line 100 of the file
  11349. @file{foo.ptexi}, and so that's what an error message should refer to.
  11350. Both M4 (@pxref{Preprocessor features,,, m4, GNU M4}) and CPP
  11351. (@pxref{Line Control,,, cpp, The C Preprocessor}, and
  11352. @ref{Preprocessor Output,,, cpp, The C Preprocessor}) can generate
  11353. such lines.
  11354. @vindex CPP_LINE_DIRECTIVES
  11355. The @command{makeinfo} program recognizes these lines by default,
  11356. except within @code{@@verbatim} blocks (@pxref{@code{@@verbatim}}.
  11357. Their recognition can be turned off completely with
  11358. @code{CPP_LINE_DIRECTIVES} (@pxref{Other Customization Variables}),
  11359. though there is normally no reason to do so.
  11360. For those few programs (M4, CPP, Texinfo) which need to document
  11361. @samp{#line} directives and therefore have examples which would
  11362. otherwise match the pattern, the command @code{@@hashchar@{@}} can be
  11363. used (@pxref{Inserting a Hashsign}). The example line above looks
  11364. like this in the source for this manual:
  11365. @example
  11366. @@hashchar@{@}line 100 "foo.ptexi"
  11367. @end example
  11368. The @code{@@hashchar} command was added to Texinfo in 2013. If you
  11369. don't want to rely on it, you can also use @code{@@set} and
  11370. @code{@@value} to insert the literal @samp{#}:
  11371. @example
  11372. @@set hash #
  11373. @@value@{hash@}line 1 "example.c"
  11374. @end example
  11375. Or, if suitable, a @code{@@verbatim} environment can be used instead
  11376. of @code{@@example}. As mentioned above, @code{#line}-recognition is
  11377. disabled inside verbatim blocks.
  11378. @node @samp{#line} and @TeX{}
  11379. @subsection @samp{#line} and @TeX{}
  11380. @cindex @TeX{} and @samp{#line} directives
  11381. @cindex @samp{#line} directives, not processing with @TeX{}
  11382. As mentioned, @command{makeinfo} recognizes the @samp{#line}
  11383. directives described in the previous section. However,
  11384. @file{texinfo.tex} does not and cannot. Therefore, such a line will
  11385. be incorrectly typeset verbatim if @TeX{} sees it. The solution is to
  11386. use @command{makeinfo}'s macro expansion options before running
  11387. @TeX{}. There are three approaches:
  11388. @itemize @bullet
  11389. @item
  11390. If you run @command{texi2dvi} or its variants (@pxref{Format with
  11391. @command{texi2dvi}}), you can pass @option{-E} and @command{texi2dvi}
  11392. will run @command{makeinfo} first to expand macros and eliminate
  11393. @samp{#line}.
  11394. @item
  11395. If you run @command{makeinfo} or its variants (@pxref{Generic
  11396. Translator @command{texi2any}}), you can specify @option{--no-ifinfo
  11397. --iftex -E somefile.out}, and then give @file{somefile.out} to
  11398. @code{texi2dvi} in a separate command.
  11399. @item
  11400. Or you can run @option{makeinfo --dvi --Xopt -E}. (Or @option{--pdf}
  11401. instead of @option{--dvi}.) @command{makeinfo} will then call
  11402. @command{texi2dvi -E}.
  11403. @end itemize
  11404. @findex errormsg@r{, and line numbers in @TeX{}}
  11405. One last caveat regarding use with @TeX{}: since the @code{#line}
  11406. directives are not recognized, the line numbers emitted by the
  11407. @code{@@errormsg@{@}} command (@pxref{Conditional Commands}), or by
  11408. @TeX{} itself, are the (incorrect) line numbers from the derived file
  11409. which @TeX{} is reading, rather than the preprocessor-specified line
  11410. numbers. This is another example of why we recommend running
  11411. @command{makeinfo} for the best diagnostics (@pxref{@command{makeinfo}
  11412. Advantages}).
  11413. @node @samp{#line} Syntax Details
  11414. @subsection @samp{#line} Syntax Details
  11415. @cindex @samp{#line} syntax details
  11416. @cindex Syntax details, @samp{#line}
  11417. @cindex Regular expression, for @samp{#line}
  11418. Syntax details for the @samp{#line} directive: the @samp{#} character
  11419. can be preceded or followed by whitespace, the word @samp{line} is
  11420. optional, and the file name can be followed by a whitespace-separated
  11421. list of integers (these are so-called ``flags'' output by CPP in some
  11422. cases). For those who like to know the gory details, the actual
  11423. (Perl) regular expression which is matched is this:
  11424. @example
  11425. /^\s*#\s*(line)? (\d+)(( "([^"]+)")(\s+\d+)*)?\s*$/
  11426. @end example
  11427. As far as we've been able to tell, the trailing integer flags only
  11428. occur in conjunction with a filename, so that is reflected in the
  11429. regular expression.
  11430. As an example, the following is a syntactically valid @samp{#line}
  11431. directive, meaning line 1 of @file{/usr/include/stdio.h}:
  11432. @example
  11433. @hashchar{} 1 "/usr/include/stdio.h" 2 3 4
  11434. @end example
  11435. Unfortunately, the quoted filename (@samp{"..."}) has to be optional,
  11436. because M4 (especially) can often generate @samp{#line} directives
  11437. within a single file. Since the @samp{line} is also optional, the
  11438. result is that lines might match which you wouldn't expect, e.g.,
  11439. @example
  11440. @hashchar{} 1
  11441. @end example
  11442. The possible solutions are described above (@pxref{@samp{#line} Directive}).
  11443. @node Include Files
  11444. @chapter Include Files
  11445. @cindex Include files
  11446. When a Texinfo processor sees an @code{@@include} command in a Texinfo
  11447. file, it processes the contents of the file named by the
  11448. @code{@@include} and incorporates them into the output files being
  11449. created. Include files thus let you keep a single large document as a
  11450. collection of conveniently small parts.
  11451. @menu
  11452. * Using Include Files:: How to use the @code{@@include} command.
  11453. * @code{texinfo-multiple-files-update}:: How to create and update nodes and
  11454. menus when using included files.
  11455. * Include Files Requirements:: @code{texinfo-multiple-files-update} needs.
  11456. * Sample Include File:: A sample outer file with included files
  11457. within it; and a sample included file.
  11458. * @code{@@verbatiminclude}:: Including a file verbatim.
  11459. * Include Files Evolution:: How use of the @code{@@include} command
  11460. has changed over time.
  11461. @end menu
  11462. @node Using Include Files
  11463. @section How to Use Include Files
  11464. @findex include
  11465. To include another file within a Texinfo file, write the
  11466. @code{@@include} command at the beginning of a line and follow it on
  11467. the same line by the name of a file to be included. For example:
  11468. @example
  11469. @@include buffers.texi
  11470. @end example
  11471. @@-commands are expanded in file names. The one most likely to be
  11472. useful is @code{@@value} (@pxref{@code{@@set @@value}}), and even then
  11473. only in complicated situations.
  11474. An included file should simply be a segment of text that you expect to
  11475. be included as is into the overall or @dfn{outer} Texinfo file; it
  11476. should not contain the standard beginning and end parts of a Texinfo
  11477. file. In particular, you should not start an included file with a
  11478. line saying @samp{\input texinfo}; if you do, that text is inserted
  11479. into the output file literally. Likewise, you should not end an
  11480. included file with a @code{@@bye} command; nothing after @code{@@bye}
  11481. is formatted.
  11482. In the long-ago past, you were required to write an
  11483. @code{@@setfilename} line at the beginning of an included file, but no
  11484. longer. Now, it does not matter whether you write such a line. If an
  11485. @code{@@setfilename} line exists in an included file, it is ignored.
  11486. @node @code{texinfo-multiple-files-update}
  11487. @section @code{texinfo-multiple-files-update}
  11488. @findex texinfo-multiple-files-update
  11489. GNU Emacs Texinfo mode provides the
  11490. @code{texinfo-multiple-files-update} command. This command creates or
  11491. updates `Next', `Previous', and `Up' pointers of included files as
  11492. well as those in the outer or overall Texinfo file, and it creates or
  11493. updates a main menu in the outer file. Depending on whether you call
  11494. it with optional arguments, the command updates only the pointers in
  11495. the first @code{@@node} line of the included files or all of them:
  11496. @table @kbd
  11497. @item M-x texinfo-multiple-files-update
  11498. Called without any arguments:
  11499. @itemize @minus
  11500. @item
  11501. Create or update the `Next', `Previous', and `Up' pointers of the
  11502. first @code{@@node} line in each file included in an outer or overall
  11503. Texinfo file.
  11504. @item
  11505. Create or update the `Top' level node pointers of the outer or
  11506. overall file.
  11507. @item
  11508. Create or update a main menu in the outer file.
  11509. @end itemize
  11510. @item C-u M-x texinfo-multiple-files-update
  11511. Called with @kbd{C-u} as a prefix argument:
  11512. @itemize @minus{}
  11513. @item
  11514. Create or update pointers in the first @code{@@node} line in each
  11515. included file.
  11516. @item
  11517. Create or update the `Top' level node pointers of the outer file.
  11518. @item
  11519. Create and insert a master menu in the outer file. The master menu
  11520. is made from all the menus in all the included files.
  11521. @end itemize
  11522. @item C-u 8 M-x texinfo-multiple-files-update
  11523. Called with a numeric prefix argument, such as @kbd{C-u 8}:
  11524. @itemize @minus
  11525. @item
  11526. Create or update @emph{all} the `Next', `Previous', and `Up' pointers
  11527. of all the included files.
  11528. @item
  11529. Create or update @emph{all} the menus of all the included
  11530. files.
  11531. @item
  11532. Create or update the `Top' level node pointers of the outer or
  11533. overall file.
  11534. @item
  11535. And then create a master menu in the outer file. This is similar to
  11536. invoking @code{texinfo-master-menu} with an argument when you are
  11537. working with just one file.
  11538. @end itemize
  11539. @end table
  11540. Note the use of the prefix argument in interactive use: with a regular
  11541. prefix argument, just @w{@kbd{C-u}}, the
  11542. @code{texinfo-multiple-files-update} command inserts a master menu;
  11543. with a numeric prefix argument, such as @kbd{C-u 8}, the command
  11544. updates @emph{every} pointer and menu in @emph{all} the files and
  11545. then inserts a master menu.
  11546. @node Include Files Requirements
  11547. @section Include Files Requirements
  11548. @cindex Include files requirements
  11549. @cindex Requirements for include files
  11550. If you plan to use the @code{texinfo-multiple-files-update} command,
  11551. the outer Texinfo file that lists included files within it should
  11552. contain nothing but the beginning and end parts of a Texinfo file, and
  11553. a number of @code{@@include} commands listing the included files. It
  11554. should not even include indices, which should be listed in an included
  11555. file of their own.
  11556. Moreover, each of the included files must contain exactly one highest
  11557. level node (conventionally, @code{@@chapter} or equivalent),
  11558. and this node must be the first node in the included file.
  11559. Furthermore, each of these highest level nodes in each included file
  11560. must be at the same hierarchical level in the file structure.
  11561. Usually, each is a @code{@@chapter}, an @code{@@appendix}, or an
  11562. @code{@@unnumbered} node. Thus, normally, each included file contains
  11563. one, and only one, chapter or equivalent-level node.
  11564. The outer file should contain only @emph{one} node, the `Top' node. It
  11565. should @emph{not} contain any nodes besides the single `Top' node. The
  11566. @code{texinfo-multiple-files-update} command will not process
  11567. them.
  11568. @node Sample Include File
  11569. @section Sample File with @code{@@include}
  11570. @cindex Sample @code{@@include} file
  11571. @cindex Include file sample
  11572. @cindex @code{@@include} file sample
  11573. Here is an example of an outer Texinfo file with @code{@@include} files
  11574. within it before running @code{texinfo-multiple-files-update}, which
  11575. would insert a main or master menu:
  11576. @example
  11577. @group
  11578. \input texinfo @@c -*-texinfo-*-
  11579. @c %**start of header
  11580. @@settitle Include Example
  11581. @c %**end of header
  11582. @end group
  11583. ... @xref{Sample Texinfo Files}, for
  11584. examples of the rest of the frontmatter ...
  11585. @group
  11586. @@ifnottex
  11587. @@node Top
  11588. @@top Include Example
  11589. @@end ifnottex
  11590. @end group
  11591. @group
  11592. @@include foo.texinfo
  11593. @@include bar.texinfo
  11594. @@include concept-index.texinfo
  11595. @@bye
  11596. @end group
  11597. @end example
  11598. An included file, such as @file{foo.texinfo}, might look like this:
  11599. @example
  11600. @group
  11601. @@node First
  11602. @@chapter First Chapter
  11603. Contents of first chapter @dots{}
  11604. @end group
  11605. @end example
  11606. The full contents of @file{concept-index.texinfo} might be as simple as this:
  11607. @example
  11608. @group
  11609. @@node Concept Index
  11610. @@unnumbered Concept Index
  11611. @@printindex cp
  11612. @end group
  11613. @end example
  11614. The outer Texinfo source file for @cite{The GNU Emacs Lisp Reference
  11615. Manual} is named @file{elisp.texi}. This outer file contains a master
  11616. menu with 417 entries and a list of 41 @code{@@include}
  11617. files.
  11618. @node @code{@@verbatiminclude}
  11619. @section @code{@@verbatiminclude} @var{file}: Include a File Verbatim
  11620. @anchor{verbatiminclude}@c old name
  11621. @findex verbatiminclude
  11622. @cindex Verbatim, include file
  11623. @cindex Including a file verbatim
  11624. You can include the exact contents of a file in the document with the
  11625. @code{@@verbatiminclude} command:
  11626. @example
  11627. @@verbatiminclude @var{filename}
  11628. @end example
  11629. The contents of @var{filename} is printed in a verbatim environment
  11630. (@pxref{@code{@@verbatim}}). Generally, the file is printed exactly
  11631. as it is, with all special characters and white space retained. No
  11632. indentation is added; if you want indentation, enclose the
  11633. @code{@@verbatiminclude} within @code{@@example}
  11634. (@pxref{@code{@@example}}).
  11635. The name of the file is taken literally, with a single exception:
  11636. @code{@@value@{@var{var}@}} references are expanded. This makes it
  11637. possible to include files in other directories within a distribution,
  11638. for instance:
  11639. @example
  11640. @@verbatiminclude @@value@{top_srcdir@}/NEWS
  11641. @end example
  11642. @noindent (You still have to get @code{top_srcdir} defined in the
  11643. first place.)
  11644. For a method on printing the file contents in a smaller font size, see
  11645. the end of the section on @code{@@verbatim}.
  11646. @node Include Files Evolution
  11647. @section Evolution of Include Files
  11648. When Info was first created, it was customary to create many small
  11649. Info files on one subject. Each Info file was formatted from its own
  11650. Texinfo source file. This custom meant that Emacs did not need to
  11651. make a large buffer to hold the whole of a large Info file when
  11652. someone wanted information; instead, Emacs allocated just enough
  11653. memory for the small Info file that contained the particular
  11654. information sought. This way, Emacs could avoid wasting memory.
  11655. References from one file to another were made by referring to the file
  11656. name as well as the node name. (@xref{Other Info Files, , Referring to
  11657. Other Info Files}. Also, see @ref{Four and Five Arguments, ,
  11658. @code{@@xref} with Four and Five Arguments}.)
  11659. Include files were designed primarily as a way to create a single,
  11660. large printed manual out of several smaller Info files. In a printed
  11661. manual, all the references were within the same document, so @TeX{}
  11662. could automatically determine the references' page numbers. The Info
  11663. formatting commands used include files only for creating joint
  11664. indices; each of the individual Texinfo files had to be formatted for
  11665. Info individually. (Each, therefore, required its own
  11666. @code{@@setfilename} line.)
  11667. However, because large Info files are now split automatically, it is
  11668. no longer necessary to keep them small.
  11669. Nowadays, multiple Texinfo files are used mostly for large documents,
  11670. such as @cite{The GNU Emacs Lisp Reference Manual}, and for projects
  11671. in which several different people write different sections of a
  11672. document simultaneously.
  11673. In addition, the Info formatting commands have been extended to work
  11674. with the @code{@@include} command so as to create a single large Info
  11675. file that is split into smaller files if necessary. This means that
  11676. you can write menus and cross-references without naming the different
  11677. Texinfo files.
  11678. @node Hardcopy
  11679. @chapter Formatting and Printing Hardcopy
  11680. @cindex Format and print hardcopy
  11681. @cindex Printing hardcopy
  11682. @cindex Hardcopy, printing it
  11683. @cindex Making a printed manual
  11684. @cindex Sorting indices
  11685. @cindex Indices, sorting
  11686. @cindex @TeX{} index sorting
  11687. Running the @command{texi2dvi} or @command{texi2pdf} command is the
  11688. simplest way to create printable output. These commands are installed
  11689. as part of the Texinfo package.
  11690. In more detail, three major shell commands are used to print formatted
  11691. output from a Texinfo manual: one converts the Texinfo source into
  11692. something printable, a second sorts indices, and a third actually
  11693. prints the formatted document. When you use the shell commands, you
  11694. can either work directly in the operating system shell or work within
  11695. a shell inside GNU Emacs (or some other computing environment).
  11696. If you are using GNU Emacs, you can use commands provided by Texinfo
  11697. mode instead of shell commands. In addition to the three commands to
  11698. format a file, sort the indices, and print the result, Texinfo mode
  11699. offers key bindings for commands to recenter the output buffer, show the
  11700. print queue, and delete a job from the print queue.
  11701. Details are in the following sections.
  11702. @menu
  11703. * Use @TeX{}:: Use @TeX{} to format for hardcopy.
  11704. * Format with @command{texi2dvi}:: The simplest way to format.
  11705. * Format with @command{tex}/@command{texindex}:: Formatting with explicit shell commands.
  11706. * Print with @command{lpr}:: How to print.
  11707. * Within Emacs:: How to format and print from an Emacs shell.
  11708. * Texinfo Mode Printing:: How to format and print in Texinfo mode.
  11709. * Compile-Command:: How to print using Emacs's compile command.
  11710. * Requirements Summary:: @TeX{} formatting requirements summary.
  11711. * Preparing for @TeX{}:: What to do before you use @TeX{}.
  11712. * Overfull hboxes:: What are and what to do with overfull hboxes.
  11713. * @code{@@smallbook}:: How to print small format books and manuals.
  11714. * A4 Paper:: How to print on A4 or A5 paper.
  11715. * @code{@@pagesizes}:: How to print with customized page sizes.
  11716. * Cropmarks and Magnification:: How to print marks to indicate the size
  11717. of pages and how to print scaled up output.
  11718. * PDF Output:: Portable Document Format output.
  11719. * Obtaining @TeX{}:: How to obtain @TeX{}.
  11720. @end menu
  11721. @node Use @TeX{}
  11722. @section Use @TeX{}
  11723. The typesetting program called @TeX{} is used to format a Texinfo
  11724. document for printable output. @TeX{} is a very powerful typesetting
  11725. program and, when used correctly, does an exceptionally good job.
  11726. @xref{Obtaining @TeX{}}, for information on how to obtain @TeX{}. It
  11727. is not included in the Texinfo package, being a vast suite of software
  11728. in itself.
  11729. @node Format with @command{texi2dvi}
  11730. @section Format with @command{texi2dvi}
  11731. @pindex texi2dvi @r{(shell script)}
  11732. @cindex DVI, output in
  11733. The @code{texi2dvi} program takes care of all the steps for producing
  11734. a @TeX{} DVI file from a Texinfo document. Similarly, @code{texi2pdf}
  11735. produces a PDF file.
  11736. To run @code{texi2dvi} or @code{texi2pdf} on an input file
  11737. @file{foo.texi}, do this (where @samp{prompt$ } is your shell prompt):
  11738. @example
  11739. prompt$ @kbd{texi2dvi foo.texi}
  11740. prompt$ @kbd{texi2pdf foo.texi}
  11741. @end example
  11742. As shown in this example, the input filenames to @code{texi2dvi} and
  11743. @code{texi2pdf} must include any extension, such as @samp{.texi}.
  11744. (Under MS-DOS and perhaps in other circumstances, you may need to run
  11745. @samp{sh texi2dvi foo.texi} instead of relying on the operating system
  11746. to invoke the shell on the @samp{texi2dvi} script.)
  11747. For a list of all the options, run @samp{texi2dvi --help}. Some of the
  11748. options are discussed below.
  11749. @opindex --pdf@r{, for @command{texi2dvi}}
  11750. @pindex pdftexi2dvi
  11751. With the @option{--pdf} option, @command{texi2dvi} produces PDF output
  11752. instead of DVI (@pxref{PDF Output}), by running @command{pdftex}
  11753. instead of @command{tex}. Alternatively, the command
  11754. @command{texi2pdf} is an abbreviation for running @samp{texi2dvi
  11755. --pdf}. The command @command{pdftexi2dvi} is also provided as a
  11756. convenience for AUC-@TeX{} (@pxref{Top,,, auctex, AUC-@TeX{}}), as it
  11757. prefers to merely prepend @samp{pdf} to DVI producing tools to have
  11758. PDF producing tools.
  11759. @opindex --dvipdf@r{, for @command{texi2dvi}}
  11760. @pindex dvipdfmx
  11761. With the @option{--dvipdf} option, @command{texi2dvi} produces PDF
  11762. output by running @TeX{} and then a DVI-to-PDF program: if the
  11763. @env{DVIPDF} environment variable is set, that value is used, else the
  11764. first program extant among @code{dvipdfmx}, @code{dvipdfm},
  11765. @code{dvipdf}, @code{dvi2pdf}, @code{dvitopdf}. This method generally
  11766. supports CJK typesetting better than @command{pdftex}.
  11767. @opindex --ps@r{, for @command{texi2dvi}}
  11768. @pindex dvips
  11769. With the @option{--ps} option, @command{texi2dvi} produces PostScript
  11770. instead of DVI, by running @command{tex} and then @command{dvips}
  11771. (@pxref{Top,,, dvips, Dvips}). (Or the value of the @env{DVIPS}
  11772. environment variable, if set.)
  11773. @opindex --language@r{, for @command{texi2dvi}}
  11774. @cindex @LaTeX{}, processing with @command{texi2dvi}
  11775. @command{texi2dvi} can also be used to process @LaTeX{} files.
  11776. Normally @command{texi2dvi} is able to guess the input file language
  11777. by its contents and file name extension; however, if it guesses wrong
  11778. you can explicitly specify the input language using
  11779. @option{--language=@var{lang}} command line option, where @var{lang}
  11780. is either @samp{latex} or @samp{texinfo}.
  11781. @opindex --command@r{, for @command{texi2dvi}}
  11782. One useful option to @code{texi2dvi} is @samp{--command=@var{cmd}}.
  11783. This inserts @var{cmd} on a line by itself, after a
  11784. @code{@@setfilename} line in a temporary copy of the input file, before
  11785. running @TeX{}. With this, you can specify different printing
  11786. formats, such as @code{@@smallbook} (@pxref{@code{@@smallbook}}),
  11787. @code{@@afourpaper} (@pxref{A4 Paper}), or @code{@@pagesizes}
  11788. (@pxref{@code{@@pagesizes}}), without actually changing the document
  11789. source. (You can also do this on a site-wide basis with
  11790. @file{texinfo.cnf}; @pxref{Preparing for @TeX{}}).
  11791. The option @option{-E} (equivalently, @option{-e} and
  11792. @option{--expand}) does Texinfo macro expansion using
  11793. @command{makeinfo} instead of the @TeX{} implementation (@pxref{Macro
  11794. Details}). Each implementation has its own limitations and
  11795. advantages. If this option is used, no line in the source file
  11796. may begin with the string @code{@@c@tie{}_texi2dvi} or the
  11797. string @code{@@c@tie{}(_texi2dvi)}.
  11798. @command{texi2dvi} takes the @option{--build=@var{mode}} option to
  11799. specify where the @TeX{} compilation takes place, and, as a
  11800. consequence, how auxiliary files are treated. The build mode
  11801. can also be set using the environment variable
  11802. @env{TEXI2DVI_BUILD_MODE}. The valid values for @var{mode} are:
  11803. @table @samp
  11804. @item local
  11805. Compile in the current directory, leaving all the auxiliary
  11806. files around. This is the traditional TeX use.
  11807. @item tidy
  11808. Compile in a local @code{*.t2d} directory, where the auxiliary files
  11809. are left. Output files are copied back to the original file.
  11810. Using the @samp{tidy} mode brings several advantages:
  11811. @itemize -
  11812. @item the current directory is not cluttered with plethora of temporary files.
  11813. @item clutter can be even further reduced using @option{--build-dir=dir}: all
  11814. the @code{*.t2d} directories are stored there.
  11815. @item clutter can be reduced to zero using, e.g.,
  11816. @option{--build-dir=/tmp/\$USER.t2d} or @option {--build-dir=\$HOME/.t2d}.
  11817. @item the output file is updated after every successful @TeX{} run, for
  11818. sake of concurrent visualization of the output. In a @samp{local} build
  11819. the viewer stops during the whole @TeX{} run.
  11820. @item if the compilation fails, the previous state of the output file
  11821. is preserved.
  11822. @item @acronym{PDF} and @acronym{DVI} compilation are kept in separate
  11823. subdirectories
  11824. preventing any possibility of auxiliary file incompatibility.
  11825. @end itemize
  11826. On the other hand, because @samp{tidy} compilation takes place in another
  11827. directory, occasionally @TeX{} won't be able to find some files (e.g., when
  11828. using @code{\graphicspath}): in that case, use @option{-I} to specify the
  11829. additional directories to consider.
  11830. @item clean
  11831. Same as @samp{tidy}, but remove the auxiliary directory afterwards.
  11832. Every compilation therefore requires the full cycle.
  11833. @end table
  11834. @pindex etex
  11835. @pindex pdfetex
  11836. @command{texi2dvi} will use @command{etex} (or @command{pdfetex}) if
  11837. it is available, because it runs faster in some cases, and
  11838. provides additional tracing information when debugging
  11839. @file{texinfo.tex}. Nevertheless, this extended version of @TeX{} is
  11840. not required, and the DVI output is identical.
  11841. (These days, @command{pdftex} and @command{pdfetex} are exactly the
  11842. same, but we still run @command{pdfetex} to cater to ancient @TeX{}
  11843. installations.)
  11844. @cindex filename recorder for @TeX{}
  11845. @cindex @samp{\openout} line in log file
  11846. @command{texi2dvi} attempts to detect auxiliary files output by @TeX{},
  11847. either by using the @option{-recorder} option, or by scanning for
  11848. @samp{\openout} in the log file that a run of @TeX{} produces. You may
  11849. control how @command{texi2dvi} does this with the @env{TEXI2DVI_USE_RECORDER}
  11850. environment variable. Valid values are:
  11851. @table @samp
  11852. @item yes
  11853. use the @option{-recorder} option, no checks.
  11854. @item no
  11855. scan for @samp{\openout} in the log file, no checks.
  11856. @item yesmaybe
  11857. check whether @option{-recorder} option is supported, and if yes
  11858. use it, otherwise check for tracing @samp{\openout} in the log file is
  11859. supported, and if yes use it, else it is an error.
  11860. @item nomaybe
  11861. same as @samp{yesmaybe}, except that the @samp{\openout} trace in log
  11862. file is checked first.
  11863. @end table
  11864. The default is @samp{nomaybe}. This environment variable is provided
  11865. for troubleshooting purposes, and may change or disappear in the future.
  11866. @node Format with @command{tex}/@command{texindex}
  11867. @section Format with @command{tex}/@command{texindex}
  11868. @cindex Shell formatting with @code{tex} and @code{texindex}
  11869. @cindex Formatting with @code{tex} and @code{texindex}
  11870. @cindex DVI file
  11871. You can do the basic formatting of a Texinfo file with the shell
  11872. command @code{tex} followed by the name of the Texinfo file. For
  11873. example:
  11874. @example
  11875. tex foo.texi
  11876. @end example
  11877. @noindent @TeX{} will produce a @dfn{DVI file} as well as several auxiliary
  11878. files containing information for indices, cross-references, etc. The
  11879. DVI file (for @dfn{DeVice Independent} file) can be printed on
  11880. virtually any device, perhaps after a further conversion (see the
  11881. previous section).
  11882. @pindex texindex
  11883. The @code{tex} formatting command itself does not sort the indices; it
  11884. writes an output file of unsorted index data. To generate a printed
  11885. index after running the @command{tex} command, you first need a sorted
  11886. index to work from. The @command{texindex} command sorts indices.
  11887. (@command{texi2dvi}, described in the previous section, runs
  11888. @command{tex} and @command{texindex} as necessary.)
  11889. @anchor{Names of index files}
  11890. @cindex Names of index files
  11891. @cindex Index file names
  11892. @code{tex} outputs unsorted index files under names following a
  11893. standard convention: the name of your main input file with any
  11894. @samp{.texi} or similar extension replaced by the two letter index
  11895. name. For example, the raw index output files for the input file
  11896. @file{foo.texi} would be, by default, @file{foo.cp}, @file{foo.vr},
  11897. @file{foo.fn}, @file{foo.tp}, @file{foo.pg} and @file{foo.ky}. Those
  11898. are exactly the arguments to give to @code{texindex}.
  11899. @need 1000
  11900. @cindex Wildcards
  11901. @cindex Globbing
  11902. Instead of specifying all the unsorted index file names explicitly,
  11903. it's typical to use @samp{??} as shell wildcards and give the command
  11904. in this form:
  11905. @example
  11906. texindex foo.??
  11907. @end example
  11908. @noindent
  11909. This command will run @code{texindex} on all the unsorted index files,
  11910. including any two letter indices that you have defined yourself using
  11911. @code{@@defindex} or @code{@@defcodeindex}. You can safely run
  11912. @samp{texindex foo.??} even if there are files with two letter
  11913. extensions that are not index files, such as @samp{foo.el}. The
  11914. @code{texindex} command reports but otherwise ignores such files.
  11915. For each file specified, @code{texindex} generates a sorted index file
  11916. whose name is made by appending @samp{s} to the input file name; for
  11917. example, @file{foo.cps} is made from @file{foo.cp}. The
  11918. @code{@@printindex} command looks for a file with that name
  11919. (@pxref{Printing Indices & Menus}). @TeX{} does not read the raw
  11920. index output file, and @code{texindex} does not alter it.
  11921. After you have sorted the indices, you need to rerun @code{tex} on the
  11922. Texinfo file. This regenerates the output file, this time with
  11923. up-to-date index entries.
  11924. Finally, you may need to run @code{tex} one more time, to get the page
  11925. numbers in the cross-references correct.
  11926. To summarize, this is a five step process. (Alternatively, it's a
  11927. one-step process: run @code{texi2dvi}; see the previous section.)
  11928. @enumerate
  11929. @item
  11930. Run @code{tex} on your Texinfo file. This generates a DVI file (with
  11931. undefined cross-references and no indices), and the raw index files
  11932. (with two letter extensions).
  11933. @item
  11934. Run @code{texindex} on the raw index files. This creates the
  11935. corresponding sorted index files (with three letter extensions).
  11936. @item
  11937. Run @code{tex} again on your Texinfo file. This regenerates the DVI
  11938. file, this time with indices and defined cross-references, but with
  11939. page numbers for the cross-references from the previous run, generally
  11940. incorrect.
  11941. @item
  11942. Sort the indices again, with @code{texindex}.
  11943. @item
  11944. Run @code{tex} one last time. This time the correct page numbers are
  11945. written for the cross-references.
  11946. @end enumerate
  11947. @menu
  11948. * Formatting Partial Documents::
  11949. * Details of @command{texindex}::
  11950. @end menu
  11951. @node Formatting Partial Documents
  11952. @subsection Formatting Partial Documents
  11953. @cindex Formatting partial documents
  11954. @cindex Partial documents, formatting
  11955. @cindex Chapters, formatting one at a time
  11956. @cindex Auxiliary files, omitting
  11957. @cindex Pointer validation, suppressing
  11958. @findex novalidate
  11959. Sometimes you may wish to print a document while you know it is
  11960. incomplete, or to print just one chapter of a document. In such a
  11961. case, the usual auxiliary files that @TeX{} creates and warnings
  11962. @TeX{} gives about undefined cross-references are just nuisances. You
  11963. can avoid them with the @code{@@novalidate} command, which you must
  11964. give @emph{before} any sectioning or cross-reference commands.
  11965. Thus, the beginning of your file would look approximately like this:
  11966. @example
  11967. \input texinfo
  11968. @@novalidate
  11969. @dots{}
  11970. @end example
  11971. @noindent @code{@@novalidate} also turns off validation in
  11972. @code{makeinfo}, just like its @code{--no-validate} option
  11973. (@pxref{Pointer Validation}).
  11974. Furthermore, you need not run @code{texindex} each time after you run
  11975. @code{tex}. The @code{tex} formatting command simply uses whatever
  11976. sorted index files happen to exist from a previous use of
  11977. @code{texindex}. If those are out of date, that is usually ok while
  11978. you are creating or debugging a document.
  11979. @node Details of @command{texindex}
  11980. @subsection Details of @command{texindex}
  11981. @cindex Braces, in index entries
  11982. In Texinfo version 6, released in 2015, the @command{texindex} program
  11983. was completely reimplemented. The principal functional difference is
  11984. that index entries beginning with a left brace or right brace
  11985. (@samp{@{} resp.@: @samp{@}}) can work properly. For example, these
  11986. simple index entries are processed correctly, including the ``index
  11987. initial'' shown in the index:
  11988. @example
  11989. @@cindex @@@{
  11990. @@cindex @@@}
  11991. ...
  11992. @@printindex cp
  11993. @end example
  11994. @findex \usebracesinindexestrue
  11995. However, to enable this behavior, it's necessary (for the time being)
  11996. to give a special option to @TeX{} early in a source document:
  11997. @example
  11998. @@tex
  11999. \global\usebracesinindexestrue
  12000. @@end tex
  12001. @end example
  12002. @cindex Sort string, incorrect @samp{|}
  12003. This is because the previous @command{texindex} implementation aborted
  12004. with an incorrect error message (@samp{No page number in \entry...})
  12005. on such index entries when handled in the normal way. Therefore
  12006. @TeX{} wrote out an incorrect ``sort string'' using the @samp{|}
  12007. character; this did not affect the text of the entry, but the index
  12008. initial was the incorrect @samp{|}, and sorting was not perfect.
  12009. Because of that fatal error, and because relatively few documents have
  12010. index entries beginning with braces, we want to provide some
  12011. transition time for installations to have the new @command{texindex}.
  12012. At some point in the future, we'll make @code{\usebracesinindexes}
  12013. true by default (the above @TeX{} code will continue to work fine).
  12014. @cindex Literate programming, with Texinfo and @code{awk}
  12015. @cindex Texinfo, and literate programming
  12016. @cindex Robbins, Arnold
  12017. @pindex texiwebjr
  12018. @pindex ti.twjr
  12019. Although not a matter of functionality, readers may be interested to
  12020. know that the new @command{texindex} is a literate program
  12021. (@url{http://en.wikipedia.org/wiki/Literate_programming}) using
  12022. Texinfo for documentation and (portable) @code{awk} for code. A
  12023. single source file, @file{texindex/ti.twjr} in this case, produces the
  12024. runnable program, a printable document, and an online document.
  12025. The system is called TexiWeb Jr.@: and was created by Arnold
  12026. Robbins, who also wrote the new @command{texindex}. Not
  12027. coincidentally, he is also the long-time maintainer of @command{gawk}
  12028. (GNU Awk, @pxref{Top,,, gawk, The GNU Awk User's Guide}). The file
  12029. @file{texindex/Makefile.am} shows example usage of the system.
  12030. @node Print with @command{lpr}
  12031. @section Print with @command{lpr} from Shell
  12032. @pindex lpr @r{(DVI print command)}
  12033. The way to print a DVI file depends on your system installation. Two
  12034. common ones are @samp{dvips foo.dvi -o} to make a PostScript file
  12035. first and then print that, and @samp{lpr -d foo.dvi} to print a DVI
  12036. file directly.
  12037. For example, the following commands will (probably) suffice to sort
  12038. the indices, format, and print this manual using the @code{texi2dvi}
  12039. shell script (@pxref{Format with @command{texi2dvi}}).
  12040. @example
  12041. @group
  12042. texi2dvi texinfo.texi
  12043. dvips texinfo.dvi -o
  12044. lpr texinfo.ps
  12045. @end group
  12046. @end example
  12047. Depending on the @code{lpr} setup on your machine, you might able to
  12048. combine the last two steps into @code{lpr -d texinfo.dvi}.
  12049. @cindex PCL file, for printing
  12050. You can also generate a PDF file by running @code{texi2pdf} instead of
  12051. @code{texi2dvi}; a PDF is often directly printable. Or you can
  12052. generate a PCL file by using @code{dvilj} instead of @code{dvips}, if
  12053. you have a printer that prefers that format.
  12054. @cindex Shell printing, on MS-DOS/MS-Windows
  12055. @cindex Printing DVI files, on MS-DOS/MS-Windows
  12056. @pindex lpr@r{-d, replacements on MS-DOS/MS-Windows}
  12057. @code{lpr} is a standard program on Unix systems, but it is usually
  12058. absent on MS-DOS/MS-Windows. If so, just create a PostScript or PDF
  12059. or PCL file, whatever is most convenient, and print that in the usual
  12060. way for your machine (e.g., by sending to the appropriate port,
  12061. usually @samp{PRN}).
  12062. @node Within Emacs
  12063. @section Printing From an Emacs Shell
  12064. @cindex Print, format from Emacs shell
  12065. @cindex Format, print from Emacs shell
  12066. @cindex Shell, format, print from
  12067. @cindex Emacs shell, format, print from
  12068. @cindex GNU Emacs shell, format, print from
  12069. You can give formatting and printing commands from a shell within GNU
  12070. Emacs, just like any other shell command. To create a shell within
  12071. Emacs, type @kbd{M-x shell} (@pxref{Shell,,, emacs, The GNU Emacs
  12072. Manual}). In this shell, you can format and print the document.
  12073. @xref{Hardcopy, , Format and Print Hardcopy}, for details.
  12074. You can switch to and from the shell buffer while @code{tex} is
  12075. running and do other editing. If you are formatting a long document
  12076. on a slow machine, this can be very convenient.
  12077. For example, you can use @code{texi2dvi} from an Emacs shell. Here is
  12078. one way to use @code{texi2pdf} to format and print @cite{Using and
  12079. Porting GNU CC} from a shell within Emacs:
  12080. @example
  12081. @group
  12082. texi2pdf gcc.texi
  12083. lpr gcc.pdf
  12084. @end group
  12085. @end example
  12086. See the next section for more information about formatting
  12087. and printing in Texinfo mode.
  12088. @node Texinfo Mode Printing
  12089. @section Formatting and Printing in Texinfo Mode
  12090. @cindex Region printing in Texinfo mode
  12091. @cindex Format and print in Texinfo mode
  12092. @cindex Print and format in Texinfo mode
  12093. Texinfo mode provides several predefined key commands for @TeX{}
  12094. formatting and printing. These include commands for sorting indices,
  12095. looking at the printer queue, killing the formatting job, and
  12096. recentering the display of the buffer in which the operations
  12097. occur.
  12098. @table @kbd
  12099. @item C-c C-t C-b
  12100. @itemx M-x texinfo-tex-buffer
  12101. Run @code{texi2dvi} on the current buffer.
  12102. @item C-c C-t C-r
  12103. @itemx M-x texinfo-tex-region
  12104. Run @TeX{} on the current region.
  12105. @item C-c C-t C-i
  12106. @itemx M-x texinfo-texindex
  12107. Sort the indices of a Texinfo file formatted with
  12108. @code{texinfo-tex-region}.
  12109. @item C-c C-t C-p
  12110. @itemx M-x texinfo-tex-print
  12111. Print a DVI file that was made with @code{texinfo-tex-region} or
  12112. @code{texinfo-tex-buffer}.
  12113. @item C-c C-t C-q
  12114. @itemx M-x tex-show-print-queue
  12115. Show the print queue.
  12116. @item C-c C-t C-d
  12117. @itemx M-x texinfo-delete-from-print-queue
  12118. Delete a job from the print queue; you will be prompted for the job
  12119. number shown by a preceding @kbd{C-c C-t C-q} command
  12120. (@code{texinfo-show-tex-print-queue}).
  12121. @item C-c C-t C-k
  12122. @itemx M-x tex-kill-job
  12123. Kill the currently running @TeX{} job started by either
  12124. @code{texinfo-tex-region} or @code{texinfo-tex-buffer}, or any other
  12125. process running in the Texinfo shell buffer.
  12126. @item C-c C-t C-x
  12127. @itemx M-x texinfo-quit-job
  12128. Quit a @TeX{} formatting job that has stopped because of an error by
  12129. sending an @key{x} to it. When you do this, @TeX{} preserves a record
  12130. of what it did in a @file{.log} file.
  12131. @item C-c C-t C-l
  12132. @itemx M-x tex-recenter-output-buffer
  12133. Redisplay the shell buffer in which the @TeX{} printing and formatting
  12134. commands are run to show its most recent output.
  12135. @end table
  12136. @need 1000
  12137. Thus, the usual sequence of commands for formatting a buffer is as
  12138. follows (with comments to the right):
  12139. @example
  12140. @group
  12141. C-c C-t C-b @r{Run @code{texi2dvi} on the buffer.}
  12142. C-c C-t C-p @r{Print the DVI file.}
  12143. C-c C-t C-q @r{Display the printer queue.}
  12144. @end group
  12145. @end example
  12146. The Texinfo mode @TeX{} formatting commands start a subshell in Emacs
  12147. called the @file{*tex-shell*}. The @code{texinfo-tex-command},
  12148. @code{texinfo-texindex-command}, and @code{tex-dvi-print-command}
  12149. commands are all run in this shell.
  12150. You can watch the commands operate in the @samp{*tex-shell*} buffer,
  12151. and you can switch to and from and use the @samp{*tex-shell*} buffer
  12152. as you would any other shell buffer.
  12153. @need 1500
  12154. The formatting and print commands depend on the values of several variables.
  12155. The default values are:
  12156. @example
  12157. @group
  12158. @r{Variable} @r{Default value}
  12159. texinfo-texi2dvi-command "texi2dvi"
  12160. texinfo-tex-command "tex"
  12161. texinfo-texindex-command "texindex"
  12162. texinfo-delete-from-print-queue-command "lprm"
  12163. texinfo-tex-trailer "@@bye"
  12164. tex-start-of-header "%**start"
  12165. tex-end-of-header "%**end"
  12166. tex-dvi-print-command "lpr -d"
  12167. tex-show-queue-command "lpq"
  12168. @end group
  12169. @end example
  12170. You can change the values of these variables with the @kbd{M-x
  12171. set-variable} command (@pxref{Examining, , Examining and Setting
  12172. Variables, emacs, The GNU Emacs Manual}), or with your @file{.emacs}
  12173. initialization file (@pxref{Init File, , , emacs, The GNU Emacs
  12174. Manual}).
  12175. @cindex Customize Emacs package (@t{Development/Docs/Texinfo})
  12176. Beginning with version 20, GNU Emacs offers a user-friendly interface,
  12177. called @dfn{Customize}, for changing values of user-definable variables.
  12178. @xref{Easy Customization, , Easy Customization Interface, emacs, The GNU
  12179. Emacs Manual}, for more details about this. The Texinfo variables can
  12180. be found in the @samp{Development/Docs/Texinfo} group, once you invoke
  12181. the @kbd{M-x customize} command.
  12182. @node Compile-Command
  12183. @section Using the Local Variables List
  12184. @cindex Local variables
  12185. @cindex Compile command for formatting
  12186. @cindex Format with the compile command
  12187. Yet another way to apply the @TeX{} formatting command to a Texinfo file
  12188. is to put that command in a @dfn{local variables list} at the end of the
  12189. Texinfo file. You can then specify the @code{tex} or @code{texi2dvi}
  12190. commands as a @code{compile-command} and have Emacs run it by typing
  12191. @kbd{M-x compile}. This creates a special shell called the
  12192. @file{*compilation*} buffer in which Emacs runs the compile command.
  12193. For example, at the end of the @file{gdb.texi} file, after the
  12194. @code{@@bye}, you could put the following:
  12195. @example
  12196. @group
  12197. Local Variables:
  12198. compile-command: "texi2dvi gdb.texi"
  12199. End:
  12200. @end group
  12201. @end example
  12202. @noindent
  12203. This technique is most often used by programmers who also compile programs
  12204. this way; see @ref{Compilation, , , emacs, The GNU Emacs Manual}.
  12205. @node Requirements Summary
  12206. @section @TeX{} Formatting Requirements Summary
  12207. @cindex Requirements for formatting
  12208. @cindex Minimal requirements for formatting
  12209. @cindex Formatting requirements
  12210. Every Texinfo file that is to be input to @TeX{} must begin with a
  12211. @code{\input} command:
  12212. @example
  12213. \input texinfo
  12214. @end example
  12215. @noindent
  12216. This instructs @TeX{} to load the macros it needs to process a Texinfo
  12217. file.
  12218. Every Texinfo file must end with a line that terminates @TeX{}'s
  12219. processing and forces out unfinished pages:
  12220. @example
  12221. @@bye
  12222. @end example
  12223. Strictly speaking, these two lines are all a Texinfo file needs to be
  12224. processed successfully by @TeX{}.
  12225. Usually, however, the beginning includes a @code{@@settitle} command
  12226. to define the title of the printed manual, a title page, a copyright
  12227. page, permissions, and a table of contents. Besides @code{@@bye}, the
  12228. end of a file usually includes indices. (Not to mention that most
  12229. manuals contain a body of text as well.)
  12230. For more information, see:
  12231. @itemize @bullet
  12232. @item @ref{@code{@@settitle}}.
  12233. @item @ref{@code{@@setchapternewpage}}.
  12234. @item @ref{Headings}.
  12235. @item @ref{Titlepage & Copyright Page}.
  12236. @item @ref{Printing Indices & Menus}.
  12237. @item @ref{Contents}.
  12238. @end itemize
  12239. @node Preparing for @TeX{}
  12240. @section Preparing for @TeX{}
  12241. @cindex Preparing for @TeX{}
  12242. @cindex @TeX{} input initialization
  12243. @cindex @sortas{profile init} @file{.profile} initialization file
  12244. @cindex @sortas{cshrc init} @file{.cshrc} initialization file
  12245. @cindex Initialization file for @TeX{} input
  12246. @TeX{} needs to know where to find the @file{texinfo.tex} file that the
  12247. @samp{\input texinfo} command on the first line reads. The
  12248. @file{texinfo.tex} file tells @TeX{} how to handle @@-commands; it is
  12249. included in all standard GNU distributions. The latest version
  12250. released for general use is available
  12251. from the usual GNU servers and mirrors:
  12252. @smalldisplay
  12253. @uref{http://ftp.gnu.org/gnu/texinfo/texinfo.tex}
  12254. @uref{http://ftpmirror.gnu.org/texinfo/texinfo.tex}
  12255. @end smalldisplay
  12256. The latest development version is available from the Texinfo source
  12257. repository:
  12258. @smalldisplay
  12259. @uref{http://svn.savannah.gnu.org/viewvc/trunk/doc/texinfo.tex?root=texinfo&view=log}
  12260. @end smalldisplay
  12261. @pindex texinfo.tex@r{, installing}
  12262. @file{texinfo.tex} is essentially a standalone file, and compatibility
  12263. is of utmost concern; so, if you need or want to try a newer version
  12264. than came with your system, it nearly always suffices to download it
  12265. and put it anywhere that @TeX{} will find it (first). You can replace
  12266. any existing @file{texinfo.tex} with a newer version (of course saving
  12267. the original in case of disaster).
  12268. @pindex epsf.tex@r{, installing}
  12269. Also, you should install @file{epsf.tex}, if it is not already installed
  12270. from another distribution. More details are at the end of the description
  12271. of the @code{@@image} command (@pxref{Images}).
  12272. @cindex European Computer Modern fonts, installing
  12273. @cindex EC fonts, installing
  12274. @cindex CM-Super fonts, installing
  12275. To use quotation marks other than those used in English, you'll need
  12276. to have the European Computer Modern fonts (e.g., @file{ecrm1000}) and
  12277. (for PDF output) CM-Super fonts (@pxref{Inserting Quotation Marks}).
  12278. @pindex feymr10@r{, installing}
  12279. @cindex Euro font, installing
  12280. To use the @code{@@euro} command, you'll need the @samp{feym*} fonts
  12281. (e.g., @file{feymr10}). @xref{@code{@@euro}}.
  12282. All of the above files (and a whole lot more) should be installed by
  12283. default in a reasonable @TeX{} installation.
  12284. @pindex texinfo.cnf @r{installation}
  12285. @cindex Customizing of @TeX{} for Texinfo
  12286. @cindex Site-wide Texinfo configuration file
  12287. Optionally, you may create a file @file{texinfo.cnf} for site configuration.
  12288. This file is read by @TeX{} at the beginning of a Texinfo file.
  12289. You can put any commands you like there, according to local site-wide
  12290. conventions. They will be read by @TeX{} when processing any Texinfo
  12291. document. For example, if @file{texinfo.cnf} contains the line
  12292. @samp{@@afourpaper} (@pxref{A4 Paper}), then all Texinfo documents
  12293. will be processed with that page size in effect. If you have nothing
  12294. to put in @file{texinfo.cnf}, you do not need to create it.
  12295. @cindex Environment variable @code{TEXINPUTS}
  12296. @vindex TEXINPUTS
  12297. If neither of the above locations for these system files suffice, you
  12298. can specify the directories explicitly. For @file{texinfo.tex}, you
  12299. can do this by writing the complete path for the file after the
  12300. @code{\input} command. Another way, that works for both
  12301. @file{texinfo.tex} and @file{texinfo.cnf} (and any other file @TeX{}
  12302. might read), is to set the @code{TEXINPUTS} environment variable in
  12303. your @file{.profile} or @file{.cshrc} file.
  12304. Whether you use @file{.profile} or @file{.cshrc} depends on
  12305. whether you use a Bourne shell-compatible (@code{sh}, @code{bash},
  12306. @code{ksh}, @dots{}) or C shell-compatible (@code{csh}, @code{tcsh})
  12307. command interpreter, respeictvely.
  12308. In a @file{.profile} file, you could use the following @code{sh} command
  12309. sequence:
  12310. @example
  12311. @group
  12312. TEXINPUTS=.:/home/me/mylib:
  12313. export TEXINPUTS
  12314. @end group
  12315. @end example
  12316. @need 1000
  12317. While in a @file{.cshrc} file, you could use the following @code{csh}
  12318. command sequence:
  12319. @example
  12320. setenv TEXINPUTS .:/home/me/mylib:
  12321. @end example
  12322. On MS-DOS/MS-Windows, you'd do this (note the use of the @samp{;}
  12323. character as directory separator, instead of @samp{:}):
  12324. @example
  12325. @group
  12326. set TEXINPUTS=.;d:/home/me/mylib;c:
  12327. @end group
  12328. @end example
  12329. @noindent
  12330. It is customary for DOS/Windows users to put such commands in the
  12331. @file{autoexec.bat} file, or in the Windows registry.
  12332. @noindent
  12333. These settings would cause @TeX{} to look for @file{\input} file first
  12334. in the current directory, indicated by the @samp{.}, then in a
  12335. hypothetical user @samp{me}'s @file{mylib} directory, and finally in
  12336. the system directories. (A leading, trailing, or doubled @samp{:}
  12337. indicates searching the system directories at that point.)
  12338. @node Overfull hboxes
  12339. @section Overfull ``hboxes''
  12340. @cindex Overfull @samp{hboxes}
  12341. @cindex @samp{hbox}, overfull
  12342. @cindex Final output
  12343. @TeX{} is sometimes unable to typeset a line within the normal
  12344. margins. This most often occurs when @TeX{} comes upon what it
  12345. interprets as a long word that it cannot hyphenate, such as an
  12346. electronic mail network address or a very long identifier. When this
  12347. happens, @TeX{} prints an error message like this:
  12348. @example
  12349. Overfull @@hbox (20.76302pt too wide)
  12350. @end example
  12351. @findex hbox
  12352. @noindent
  12353. (In @TeX{}, lines are in ``horizontal boxes'', hence the term, ``hbox''.
  12354. @samp{@@hbox} is a @TeX{} primitive not used in the Texinfo language.)
  12355. @TeX{} also provides the line number in the Texinfo source file and
  12356. the text of the offending line, which is marked at all the places that
  12357. @TeX{} considered hyphenation. @xref{Debugging with @TeX{}}, for more
  12358. information about typesetting errors.
  12359. If the Texinfo file has an overfull hbox, you can rewrite the sentence
  12360. so the overfull hbox does not occur, or you can decide to leave it. A
  12361. small excursion into the right margin often does not matter and may not
  12362. even be noticeable.
  12363. If you have many overfull boxes and/or an antipathy to rewriting, you
  12364. can coerce @TeX{} into greatly increasing the allowable interword
  12365. spacing, thus (if you're lucky) avoiding many of the bad line breaks,
  12366. like this:
  12367. @findex \emergencystretch
  12368. @example
  12369. @@tex
  12370. \global\emergencystretch = .9\hsize
  12371. @@end tex
  12372. @end example
  12373. @noindent
  12374. (You should adjust the fraction as needed.) This huge value for
  12375. @code{\emergencystretch} cannot be the default, since then the typeset
  12376. output would generally be of noticeably lower quality; its default
  12377. value is @samp{.15\hsize}. @code{\hsize} is the @TeX{} dimension
  12378. containing the current line width.
  12379. @cindex Black rectangle in hardcopy
  12380. @cindex Rectangle, black in hardcopy
  12381. @cindex Box, ugly black in hardcopy
  12382. @cindex Ugly black rectangles in hardcopy
  12383. For any overfull boxes you do have, @TeX{} will print a large, ugly,
  12384. black rectangle beside the line that contains the overfull hbox unless
  12385. told otherwise. This is so you will notice the location of the
  12386. problem if you are correcting a draft.
  12387. @findex finalout
  12388. To prevent such a monstrosity from marring your final printout, write
  12389. the following in the beginning of the Texinfo file on a line of its own,
  12390. before the @code{@@titlepage} command:
  12391. @example
  12392. @@finalout
  12393. @end example
  12394. @node @code{@@smallbook}
  12395. @section @code{@@smallbook}: Printing ``Small'' Books
  12396. @anchor{smallbook}@c old name
  12397. @findex smallbook
  12398. @cindex Small book size
  12399. @cindex Book, printing small
  12400. @cindex Page sizes for books
  12401. @cindex Size of printed book
  12402. By default, @TeX{} typesets pages for printing in an 8.5 by 11 inch
  12403. format. However, you can direct @TeX{} to typeset a document in a 7 by
  12404. 9.25 inch format that is suitable for bound books by inserting the
  12405. following command on a line by itself at the beginning of the Texinfo
  12406. file, before the title page:
  12407. @example
  12408. @@smallbook
  12409. @end example
  12410. @noindent
  12411. (Since many books are about 7 by 9.25 inches, this command might better
  12412. have been called the @code{@@regularbooksize} command, but it came to be
  12413. called the @code{@@smallbook} command by comparison to the 8.5 by 11
  12414. inch format.)
  12415. If you write the @code{@@smallbook} command between the
  12416. start-of-header and end-of-header lines, the Texinfo mode @TeX{}
  12417. region formatting command, @code{texinfo-tex-region}, will format the
  12418. region in ``small'' book size (@pxref{Start of Header}).
  12419. @xref{@code{@@small@dots{}}}, for information about commands that make
  12420. it easier to produce examples for a smaller manual.
  12421. @xref{Format with @command{texi2dvi}}, and @ref{Preparing for @TeX{}},
  12422. for other ways to format with @code{@@smallbook} that do not require
  12423. changing the source file.
  12424. @node A4 Paper
  12425. @section Printing on A4 Paper
  12426. @cindex A4 paper, printing on
  12427. @cindex A5 paper, printing on
  12428. @cindex Paper size, A4
  12429. @cindex European A4 paper
  12430. @findex afourpaper
  12431. @findex afivepaper
  12432. You can tell @TeX{} to format a document for printing on European size
  12433. A4 paper (or A5) with the @code{@@afourpaper} (or @code{@@afivepaper})
  12434. command. Write the command on a line by itself near the beginning of
  12435. the Texinfo file, before the title page. For example, this is how you
  12436. would write the header for this manual:
  12437. @example
  12438. @group
  12439. \input texinfo @@c -*-texinfo-*-
  12440. @@c %**start of header
  12441. @@settitle Texinfo
  12442. @@afourpaper
  12443. @@c %**end of header
  12444. @end group
  12445. @end example
  12446. @xref{Format with @command{texi2dvi}}, and @ref{Preparing for @TeX{}},
  12447. for other ways to format for different paper sizes that do not require
  12448. changing the source file.
  12449. @findex afourlatex
  12450. @findex afourwide
  12451. You may or may not prefer the formatting that results from the command
  12452. @code{@@afourlatex}. There's also @code{@@afourwide} for A4 paper in
  12453. wide format.
  12454. @node @code{@@pagesizes}
  12455. @section @code{@@pagesizes} [@var{width}][, @var{height}]: Custom Page Sizes
  12456. @anchor{pagesizes}@c old node name
  12457. @findex pagesizes
  12458. @cindex Custom page sizes
  12459. @cindex Page sizes, customized
  12460. @cindex Text width and height
  12461. @cindex Width of text area
  12462. @cindex Height of text area
  12463. @cindex Depth of text area
  12464. You can explicitly specify the height and (optionally) width of the main
  12465. text area on the page with the @code{@@pagesizes} command. Write this
  12466. on a line by itself near the beginning of the Texinfo file, before the
  12467. title page. The height comes first, then the width if desired,
  12468. separated by a comma. Examples:
  12469. @example
  12470. @@pagesizes 200mm,150mm @c for b5 paper
  12471. @end example
  12472. @noindent and
  12473. @example
  12474. @@pagesizes 11.5in @c for legal paper
  12475. @end example
  12476. @cindex B5 paper, printing on
  12477. @cindex Legal paper, printing on
  12478. This would be reasonable for printing on B5-size paper. To emphasize,
  12479. this command specifies the size of the @emph{text area}, not the size of
  12480. the paper (which is 250@dmn{mm} by 177@dmn{mm} for B5, 14@dmn{in} by
  12481. 8.5@dmn{in} for legal).
  12482. @cindex Margins on page, not controllable
  12483. To make more elaborate changes, such as changing any of the page
  12484. margins, you must define a new command in @file{texinfo.tex} or
  12485. @file{texinfo.cnf}.
  12486. @xref{Format with @command{texi2dvi}}, and @ref{Preparing for @TeX{}},
  12487. for other ways to specify @code{@@pagesizes} that do not require
  12488. changing the source file.
  12489. @node Cropmarks and Magnification
  12490. @section Cropmarks and Magnification
  12491. @findex cropmarks
  12492. @cindex Cropmarks for printing
  12493. @cindex Printing cropmarks
  12494. You can (attempt to) direct @TeX{} to print cropmarks at the corners
  12495. of pages with the @code{@@cropmarks} command. Write the
  12496. @code{@@cropmarks} command on a line by itself near the beginning of
  12497. the Texinfo file, before the title page, like this:
  12498. @example
  12499. @@cropmarks
  12500. @end example
  12501. This command is mainly for printers that typeset several pages on one
  12502. sheet of film; but you can attempt to use it to mark the corners of a
  12503. book set to 7 by 9.25 inches with the @code{@@smallbook} command.
  12504. (Printers will not produce cropmarks for regular sized output that is
  12505. printed on regular sized paper.) Since different printing machines
  12506. work in different ways, you should explore the use of this command
  12507. with a spirit of adventure. You may have to redefine the command in
  12508. @file{texinfo.tex}.
  12509. The @code{@@cropmarks} command is recognized and ignored in non-@TeX{}
  12510. output formats.
  12511. @findex \mag @r{(raw @TeX{} magnification)}
  12512. @cindex Magnified printing
  12513. @cindex Larger or smaller pages
  12514. You can attempt to direct @TeX{} to typeset pages larger or smaller
  12515. than usual with the @code{\mag} @TeX{} command. Everything that is
  12516. typeset is scaled proportionally larger or smaller. (@code{\mag}
  12517. stands for ``magnification''.) This is @emph{not} a Texinfo
  12518. @@-command, but is a raw @TeX{} command that is prefixed with a
  12519. backslash. You have to write this command between @code{@@tex} and
  12520. @code{@@end tex} (@pxref{Raw Formatter Commands}).
  12521. Follow the @code{\mag} command with an @samp{=} and then a number that
  12522. is 1000 times the magnification you desire. For example, to print pages
  12523. at 1.2 normal size, write the following near the beginning of the
  12524. Texinfo file, before the title page:
  12525. @example
  12526. @group
  12527. @@tex
  12528. \global\mag=1200
  12529. @@end tex
  12530. @end group
  12531. @end example
  12532. With some printing technologies, you can print normal-sized copies that
  12533. look better than usual by giving a larger-than-normal master to your
  12534. print shop. They do the reduction, thus effectively increasing the
  12535. resolution.
  12536. Depending on your system, DVI files prepared with a
  12537. nonstandard-@code{\mag} may not print or may print only with certain
  12538. magnifications. Be prepared to experiment.
  12539. @node PDF Output
  12540. @section PDF Output
  12541. @cindex PDF output
  12542. @cindex Output, in PDF
  12543. @pindex pdftex
  12544. The simplest way to generate PDF output from Texinfo source is to run
  12545. the convenience script @command{texi2pdf} (or @command{pdftexi2dvi});
  12546. this executes the @command{texi2dvi} script with the @option{--pdf}
  12547. option (@pxref{Format with @command{texi2dvi}}). If for some reason you
  12548. want to process the document by hand, you can run the @command{pdftex}
  12549. program instead of plain @command{tex}. That is, run @samp{pdftex
  12550. foo.texi} instead of @samp{tex foo.texi}.
  12551. @dfn{PDF} stands for `Portable Document Format'. It was invented by
  12552. Adobe Systems some years ago for document interchange, based on their
  12553. PostScript language. Related links:
  12554. @itemize
  12555. @item
  12556. GNU GV, a @uref{http://www.gnu.org/software/gv/, Ghostscript-based PDF
  12557. reader}. (It can also preview PostScript documents.)
  12558. @item
  12559. @code{xpdf}, a freely available standalone
  12560. @uref{http://www.foolabs.com/xpdf/, PDF reader} for the X window
  12561. system.
  12562. @item
  12563. @uref{https://en.wikipedia.org/wiki/Portable_Document_Format, PDF at
  12564. Wikipedia}.
  12565. @end itemize
  12566. At present, Texinfo does not provide @samp{@@ifpdf} or @samp{@@pdf}
  12567. commands as for the other output formats, since PDF documents contain
  12568. many internal low-level offsets and cross-references that would be
  12569. hard or impossible to specify at the Texinfo source level.
  12570. PDF files require dedicated software to be displayed, unlike the plain
  12571. ASCII formats (Info, HTML) that Texinfo supports. They also tend to
  12572. be much larger than the DVI files output by @TeX{} by default.
  12573. Nevertheless, a PDF file does define an actual typeset document in a
  12574. self-contained file, notably including all the fonts that are used, so
  12575. it has its place.
  12576. @node Obtaining @TeX{}
  12577. @section Obtaining @TeX{}
  12578. @cindex Obtaining @TeX{}
  12579. @cindex @TeX{}, how to obtain
  12580. @TeX{} is a document formatter that is used by the FSF for its
  12581. documentation. It is the easiest way to get printed output (e.g., PDF
  12582. and PostScript) for Texinfo manuals. TeX is freely redistributable,
  12583. and you can get it over the Internet or on physical media. See
  12584. @url{http://tug.org/texlive}.
  12585. @c please keep that text in sync with www.gnu.org/prep/FTP
  12586. @node Generic Translator @command{texi2any}
  12587. @chapter @command{texi2any}: The Generic Translator for Texinfo
  12588. @command{texi2any} is the generic translator for Texinfo that can
  12589. produce different output formats and is highly customizable. It
  12590. supports these formats:
  12591. @table @asis
  12592. @item Info (by default, or with @option{--info}),
  12593. @item HTML (with @option{--html}),
  12594. @item plain text (with @option{--plaintext}),
  12595. @item Docbook (with @option{--docbook}),
  12596. @item Texinfo XML (with @option{--xml}).
  12597. @end table
  12598. @command{makeinfo} is an alias for @command{texi2any}. By default,
  12599. both @command{texi2any} and @command{makeinfo} generate Info output;
  12600. indeed, there are no differences in behavior based on the name.
  12601. Beside these default formats, command line options to
  12602. @command{texi2any} can change many aspects of the output. Beyond
  12603. that, initialization files provide even more control over the final
  12604. output---nearly anything not specified in the Texinfo input file.
  12605. Initialization files are written in Perl, like the main program, and
  12606. anything which can be specified on the command line can also be
  12607. specified within a initialization file.
  12608. The rest of this chapter goes into the details.
  12609. @menu
  12610. * Reference Implementation:: @command{texi2any}: the reference implementation.
  12611. * Invoking @command{texi2any}:: Running the translator from a shell.
  12612. * @command{texi2any} Environment Variables::
  12613. * @command{texi2any} Printed Output:: Calling @command{texi2dvi}.
  12614. * Pointer Validation:: How to check that pointers point somewhere.
  12615. * Customization Variables:: Configuring @command{texi2any}.
  12616. * Internationalization of Document Strings:: Translating program-inserted text.
  12617. * Invoking @command{pod2texi}:: Translating Perl pod to Texinfo.
  12618. * @command{texi2html}:: An ancestor of @command{texi2any}.
  12619. @end menu
  12620. @node Reference Implementation
  12621. @section @command{texi2any}: A Texinfo Reference Implementation
  12622. @cindex @command{texi2any}, as reference implementation
  12623. @cindex Reference implementation
  12624. @cindex Implementation, @command{texi2any} as reference
  12625. Above, we called @command{texi2any} ``the'' translator for Texinfo
  12626. instead of just ``a'' translator, even though (of course) it's
  12627. technically and legally possible for other implementations to be
  12628. written. The reason is that alternative implementations are very
  12629. likely to have subtle, or not-so-subtle, differences in behavior, and
  12630. thus Texinfo documents would become dependent on the processor.
  12631. Therefore, it is important to have a reference implementation that
  12632. defines parts of the language not fully specified by the manual (often
  12633. intentionally so). It is equally important to have consistent
  12634. command-line options and other behavior for all processors.
  12635. @cindex Tree representation of documents
  12636. @cindex Syntax tree representation of documents
  12637. @cindex Abstract syntax tree representation of documents
  12638. For this reason, the once-independent @command{texi2html} Perl Texinfo
  12639. processor was made compatible with the C implementation of
  12640. @command{makeinfo}, to avoid continuing with two different
  12641. implementations (@pxref{History}). The current implementation,
  12642. @command{texi2any}, serves as the reference implementation. It
  12643. inherited the design of customization and other features from
  12644. @command{texi2html} (for more on @command{texi2html} compatibility,
  12645. @pxref{@command{texi2html}}). However, @code{texi2any} is a full
  12646. reimplementation: it constructs a tree-based representation of the
  12647. input document for all back-ends to work from.
  12648. @cindex Texinfo language tests
  12649. @cindex Tests, of Texinfo language
  12650. Extensive tests of the language were developed at the same time as
  12651. @command{texi2any}; we plead with anyone thinking of writing a program
  12652. to parse Texinfo input to at least make use of these tests.
  12653. @cindex Examples of using @command{texi2any}
  12654. @findex Texinfo::Parser module
  12655. The @command{texi2html} wrapper script (@pxref{@command{texi2html}})
  12656. provides a very simple example of calling @command{texi2any} from a
  12657. shell script; it's in @file{util/texi2html} in the Texinfo sources.
  12658. More consequentially, @command{texi-elements-by-size} is an example
  12659. Perl script using the @code{Texinfo::Parser} module interface; it's
  12660. also in the @file{util} source directory. (Its functionality may also
  12661. be useful to authors; @pxref{texi-elements-by-size}.)
  12662. @cindex Future of Texinfo implementations
  12663. With the release of @command{texi2any} as the reference
  12664. implementation, development of both the C implementation of
  12665. @command{makeinfo} and @command{texi2html} has been halted. Going
  12666. forward, we ask authors of Texinfo documents to use only
  12667. @command{texi2any}.
  12668. @node Invoking @command{texi2any}
  12669. @section Invoking @command{texi2any}/@command{makeinfo} from a Shell
  12670. @anchor{Invoking makeinfo}
  12671. @pindex makeinfo
  12672. @pindex texi2any
  12673. To process a Texinfo file, invoke @command{texi2any} or
  12674. @command{makeinfo} (the two names are synonyms for the same program;
  12675. we'll use the names interchangeably) followed by the name of the
  12676. Texinfo file. Also select the format you want to output with the
  12677. appropriate command line option (default is Info). Thus, to create
  12678. the Info file for Bison, type the following to the shell:
  12679. @example
  12680. texi2any --info bison.texinfo
  12681. @end example
  12682. You can specify more than one input file name; each is processed in
  12683. turn. If an input file name is @samp{-}, standard input is read.
  12684. @anchor{@command{makeinfo} Options}
  12685. @c anchor{makeinfo options}@c prev name, but case-insensitive clash
  12686. @cindex @code{makeinfo} options
  12687. @cindex Options for @code{makeinfo}
  12688. @anchor{texi2any Options}
  12689. @cindex @code{texi2any} options
  12690. @cindex Options for @code{texi2any}
  12691. The @command{texi2any} program accepts many options. Perhaps the
  12692. most basic are those that change the output format. By default,
  12693. @command{texi2any} outputs Info.
  12694. Each command line option is either a long name preceded by @samp{--}
  12695. or a single letter preceded by @samp{-}. You can use abbreviations
  12696. for the long option names as long as they are unique.
  12697. For example, you could use the following shell command to create an
  12698. Info file for @file{bison.texinfo} in which lines are filled to only
  12699. 68 columns:
  12700. @example
  12701. texi2any --fill-column=68 bison.texinfo
  12702. @end example
  12703. You can write two or more options in sequence, like this:
  12704. @example
  12705. texi2any --no-split --fill-column=70 @dots{}
  12706. @end example
  12707. @noindent
  12708. (This would keep the Info file together as one possibly very long
  12709. file and would also set the fill column to 70.)
  12710. The options are (approximately in alphabetical order):
  12711. @table @code
  12712. @item --commands-in-node-names
  12713. @opindex --commands-in-node-names
  12714. This option now does nothing, but remains for compatibility. (It used
  12715. to ensure that @@-commands in node names were expanded throughout the
  12716. document, especially @code{@@value}. This is now done by default.)
  12717. @item --conf-dir=@var{path}
  12718. @opindex --conf-dir=@var{path}
  12719. Prepend @var{path} to the directory search list for finding
  12720. customization files that may be loaded with @option{--init-file} (see
  12721. below). The @var{path} value can be a single directory, or a list of
  12722. several directories separated by the usual path separator character
  12723. (@samp{:} on Unix-like systems, @samp{;} on Windows). @c @xref{Loading
  12724. @c Init Files}.
  12725. @item --css-include=@var{file}
  12726. @opindex --css-include
  12727. When producing HTML, literally include the contents of @var{file},
  12728. which should contain W3C cascading style sheets specifications, in the
  12729. @samp{<style>} block of the HTML output. If @var{file} is @samp{-},
  12730. read standard input. @xref{HTML CSS}.
  12731. @item --css-ref=@var{url}
  12732. @opindex --css-ref
  12733. When producing HTML, add a @samp{<link>} tag to the output which
  12734. references a cascading style sheet at @var{url}. This allows using
  12735. standalone style sheets.
  12736. @item -D @var{var}
  12737. @itemx -D '@var{var} @var{value}'
  12738. @opindex -D @var{var}
  12739. Cause the Texinfo variable @var{var} to be defined. This is
  12740. equivalent to @code{@@set @var{var}} in the Texinfo file
  12741. (@pxref{@code{@@set @@clear @@value}}).
  12742. The argument to the option is always one word to the shell; if it
  12743. contains internal whitespace, the first word is taken as the variable
  12744. name and the remainder as the value. For example, @code{-D 'myvar
  12745. someval'} is equivalent to @code{@@set myvar someval}.
  12746. @item --disable-encoding
  12747. @itemx --enable-encoding
  12748. @opindex --disable-encoding
  12749. @opindex --enable-encoding
  12750. By default, or with @option{--enable-encoding}, output accented and
  12751. special characters in Info and plain text output based on
  12752. @samp{@@documentencoding}. With @option{--disable-encoding}, 7-bit
  12753. ASCII transliterations are output. @xref{@code{@@documentencoding}},
  12754. and @ref{Inserting Accents}.
  12755. @item --docbook
  12756. @opindex --docbook
  12757. Generate Docbook output (rather than Info).
  12758. @item --document-language=@var{lang}
  12759. @opindex --document-language
  12760. Use @var{lang} to translate Texinfo keywords which end up in the
  12761. output document. The default is the locale specified by the
  12762. @code{@@documentlanguage} command if there is one, otherwise English
  12763. (@pxref{@code{@@documentlanguage}}).
  12764. @item --dvi
  12765. @opindex --dvi
  12766. Generate a TeX DVI file using @command{texi2dvi}, rather than Info
  12767. (@pxref{@command{texi2any} Printed Output}).
  12768. @item --dvipdf
  12769. @opindex --dvipdf
  12770. Generate a PDF file using @command{texi2dvi --dvipdf}, rather than
  12771. Info (@pxref{@command{texi2any} Printed Output}).
  12772. @item --error-limit=@var{limit}
  12773. @itemx -e @var{limit}
  12774. @opindex --error-limit=@var{limit}
  12775. @opindex -e @var{limit}
  12776. Report @var{LIMIT} errors before aborting (on the assumption that
  12777. continuing would be useless); default 100.
  12778. @item --fill-column=@var{width}
  12779. @itemx -f @var{width}
  12780. @opindex --fill-column=@var{width}
  12781. @opindex -f @var{width}
  12782. Specify the maximum number of columns in a line; this is the
  12783. right-hand edge of a line. Paragraphs that are filled will be filled
  12784. to this width. (Filling is the process of breaking up and connecting
  12785. lines so that lines are the same length as or shorter than the number
  12786. specified as the fill column. Lines are broken between words.) The
  12787. default value is 72.
  12788. @item --footnote-style=@var{style}
  12789. @itemx -s @var{style}
  12790. @opindex --footnote-style=@var{style}
  12791. @opindex -s @var{style}
  12792. Set the footnote style to @var{style}: either @samp{end} for the end
  12793. node style (the default) or @samp{separate} for the separate node
  12794. style. The value set by this option overrides the value set in a
  12795. Texinfo file by a @code{@@footnotestyle} command (@pxref{Footnote
  12796. Styles}).
  12797. When the footnote style is @samp{separate}, @code{makeinfo} makes a
  12798. new node containing the footnotes found in the current node. When the
  12799. footnote style is @samp{end}, @code{makeinfo} places the footnote
  12800. references at the end of the current node.
  12801. In HTML, when the footnote style is @samp{end}, or if the output is
  12802. not split, footnotes are put at the end of the output. If set to
  12803. @samp{separate}, and the output is split, they are placed in a
  12804. separate file.
  12805. @item --force
  12806. @itemx -F
  12807. @opindex --force
  12808. @opindex -F
  12809. Ordinarily, if the input file has errors, the output files are not
  12810. created. With this option, they are preserved.
  12811. @item --help
  12812. @itemx -h
  12813. @opindex --help@r{, for @command{texi2any}}
  12814. @opindex -h
  12815. Print a message with available options and basic usage, then exit
  12816. successfully.
  12817. @item --html
  12818. @opindex --html
  12819. Generate HTML output (rather than Info). By default, the HTML output
  12820. is split into one output file per Texinfo source node, and the split
  12821. output is written into a subdirectory based on the name of the
  12822. top-level Info file. @xref{Generating HTML}.
  12823. @item -I @var{path}
  12824. @opindex -I @var{path}
  12825. Append @var{path} to the directory search list for finding files that
  12826. are included using the @code{@@include} command. By default,
  12827. @code{texi2any} searches only the current directory. If @var{path} is
  12828. not given, the current directory is appended. The @var{path} value
  12829. can be a single directory or a list of several directories separated
  12830. by the usual path separator character (@samp{:} on Unix-like systems,
  12831. @samp{;} on Windows).
  12832. @item --ifdocbook
  12833. @opindex --ifdocbook
  12834. @itemx --ifhtml
  12835. @opindex --ifhtml
  12836. @itemx --ifinfo
  12837. @opindex --ifinfo
  12838. @itemx --ifplaintext
  12839. @opindex --ifplaintext
  12840. @itemx --iftex
  12841. @opindex --iftex
  12842. @itemx --ifxml
  12843. @opindex --ifxml
  12844. For the given format, process @samp{@@if@var{format}} and
  12845. @samp{@@@var{format}} commands, and do not process
  12846. @samp{@@ifnot@var{format}}, regardless of the format being output.
  12847. For instance, if @option{--iftex} is given, then @samp{@@iftex} and
  12848. @samp{@@tex} blocks will be read, and @samp{@@ifnottex} blocks will be
  12849. ignored.
  12850. @item --info
  12851. @opindex --info
  12852. Generate Info output. By default, if the output file contains more
  12853. than about 300,000 bytes, it is split into shorter subfiles of about
  12854. that size. The name of the output file and any subfiles is determined
  12855. by @code{@@setfilename} (@pxref{@code{@@setfilename}}). @xref{Tag and
  12856. Split Files}.
  12857. @item --init-file=@var{file}
  12858. @opindex --init-file=@var{file}
  12859. Load @var{file} as code to modify the behavior and output of the
  12860. generated manual. It is customary to use the @code{.pm} or the
  12861. @code{.init} extensions for these customization files, but that is not
  12862. enforced; the @var{file} name can be anything. The
  12863. @option{--conf-dir} option (see above) can be used to add to the list
  12864. of directories in which these customization files are searched for.
  12865. @c @xref{Loading Init Files}.
  12866. @item --internal-links=@var{file}
  12867. @opindex --internal-links=@var{file}
  12868. @cindex Internal links, of HTML
  12869. In HTML mode, output a tab-separated file containing three columns:
  12870. the internal link to an indexed item or item in the table of contents,
  12871. the name of the index (or table of contents) in which it occurs, and
  12872. the term which was indexed or entered. The items are in the natural
  12873. sorting order for the given element. This dump can be useful for
  12874. post-processors.
  12875. @item --macro-expand=@var{file}
  12876. @itemx -E @var{file}
  12877. @opindex --macro-expand=@var{file}
  12878. @opindex -E @var{file}
  12879. Output the Texinfo source, with all Texinfo macros expanded, to
  12880. @var{file}. Normally, the result of macro expansion is used
  12881. internally by @code{makeinfo} and then discarded.
  12882. @item --no-headers
  12883. @opindex --no-headers
  12884. @cindex Node separators, omitting with @option{--no-headers}
  12885. @cindex Generating plain text files with @option{--no-headers}
  12886. @cindex Menus, omitting with @option{--no-headers}
  12887. Do not include menus or node separator lines in the output.
  12888. When generating Info, this is the same as using @option{--plaintext},
  12889. resulting in a simple plain text file. Furthermore,
  12890. @code{@@setfilename} is ignored, and output is to standard output
  12891. unless overridden with @option{-o}. (This behavior is for backward
  12892. compatibility.)
  12893. @cindex Navigation links, omitting
  12894. When generating HTML, and output is split, also output navigation
  12895. links only at the beginning of each file. If output is not split, do
  12896. not include navigation links at the top of each node at all.
  12897. @xref{Generating HTML}.
  12898. @item --no-ifdocbook
  12899. @opindex --no-ifdocbook
  12900. @itemx --no-ifhtml
  12901. @opindex --no-ifhtml
  12902. @itemx --no-ifinfo
  12903. @opindex --no-ifinfo
  12904. @itemx --no-ifplaintext
  12905. @opindex --no-ifplaintext
  12906. @itemx --no-iftex
  12907. @opindex --no-iftex
  12908. @itemx --no-ifxml
  12909. @opindex --no-ifxml
  12910. For the given format, do not process @samp{@@if@var{format}} and
  12911. @samp{@@@var{format}} commands, and do process
  12912. @samp{@@ifnot@var{format}}, regardless of the format being output.
  12913. For instance, if @option{--no-ifhtml} is given, then @samp{@@ifhtml}
  12914. and @samp{@@html} blocks will not be read, and @samp{@@ifnothtml}
  12915. blocks will be.
  12916. @item --no-node-files
  12917. @itemx --node-files
  12918. @opindex --no-node-files
  12919. @opindex --node-files
  12920. When generating HTML, create redirection files for anchors and any
  12921. nodes not already output with the file name corresponding to the node
  12922. name (@pxref{HTML Xref Node Name Expansion}). This makes it possible
  12923. for section- and chapter-level cross-manual references to succeed
  12924. (@pxref{HTML Xref Configuration}).
  12925. If the output is split, this is enabled by default. If the output is
  12926. not split, @option{--node-files} enables the creation of the
  12927. redirection files, in addition to the monolithic main output file.
  12928. @option{--no-node-files} suppresses the creation of redirection files
  12929. in any case. This option has no effect with any output format other
  12930. than HTML@. @xref{Generating HTML}.
  12931. @item --no-number-footnotes
  12932. @opindex --no-number-footnotes
  12933. Suppress automatic footnote numbering. By default, footnotes are
  12934. numbered sequentially within a node, i.e., the current footnote number
  12935. is reset to 1 at the start of each node.
  12936. @item --no-number-sections
  12937. @itemx --number-sections
  12938. @opindex --no-number-sections
  12939. @opindex --number-sections
  12940. With @option{--number_sections} (the default), output chapter,
  12941. section, and appendix numbers as in printed manuals. This works only
  12942. with hierarchically-structured manuals. You should specify
  12943. @code{--no-number-sections} if your manual is not normally structured.
  12944. @item --no-pointer-validate
  12945. @itemx --no-validate
  12946. @opindex --no-pointer-validate
  12947. @opindex --no-validate
  12948. @cindex Pointer validation, suppressing from command line
  12949. Suppress the pointer-validation phase of @code{makeinfo}---a dangerous
  12950. thing to do. This can also be done with the @code{@@novalidate}
  12951. command (@pxref{Use @TeX{}}). Normally, consistency checks are made
  12952. to ensure that cross-references can be resolved, etc. @xref{Pointer
  12953. Validation}.
  12954. @item --no-warn
  12955. @opindex --no-warn
  12956. Suppress warning messages (but not error messages).
  12957. @item --output=@var{file}
  12958. @itemx -o @var{file}
  12959. @opindex --output=@var{file}
  12960. @opindex -o @var{file}
  12961. Specify that the output should be directed to @var{file}. This
  12962. overrides any file name specified in a @code{@@setfilename} command
  12963. found in the Texinfo source. If neither @code{@@setfilename} nor this
  12964. option are specified, the input file name is used to determine the
  12965. output name. @xref{@code{@@setfilename}}.
  12966. If @var{file} is @samp{-}, output goes to standard output and
  12967. @samp{--no-split} is implied.
  12968. If @var{file} is a directory or ends with a @samp{/} the usual rules
  12969. are used to determine the output file name (namely, use
  12970. @code{@@setfilename} or the input file name) but the files are written
  12971. to the @var{file} directory. For example, @samp{makeinfo -o bar/
  12972. foo.texi}, with or without @option{--no-split}, will write
  12973. @file{bar/foo.info}, and possibly other files, under @file{bar/}.
  12974. When generating HTML and output is split, @var{file} is used as the
  12975. name for the directory into which all files are written. For example,
  12976. @samp{makeinfo -o bar --html foo.texi} will write
  12977. @file{bar/index.html}, among other files.
  12978. @item --output-indent=@var{val}
  12979. @opindex --outputindent
  12980. This option now does nothing, but remains for compatibility. (It used
  12981. to alter indentation in XML/Docbook output.)
  12982. @item -P @var{path}
  12983. @opindex -P @var{path}
  12984. Prepend @var{path} to the directory search list for @code{@@include}.
  12985. If @var{path} is not given, the current directory is prepended. See
  12986. @samp{-I} above.
  12987. @item --paragraph-indent=@var{indent}
  12988. @itemx -p @var{indent}
  12989. @opindex --paragraph-indent=@var{indent}
  12990. @opindex -p @var{indent}
  12991. Set the paragraph indentation style to @var{indent}. The value set by
  12992. this option overrides the value set in a Texinfo file by an
  12993. @code{@@paragraphindent} command (@pxref{@code{@@paragraphindent}}).
  12994. The value of @var{indent} is interpreted as follows:
  12995. @table @asis
  12996. @item @samp{asis}
  12997. Preserve any existing indentation (or lack thereof) at the beginnings
  12998. of paragraphs.
  12999. @item @samp{0} or @samp{none}
  13000. Delete any existing indentation.
  13001. @item @var{num}
  13002. Indent each paragraph by @var{num} spaces.
  13003. @end table
  13004. The default is to indent by two spaces, except for paragraphs
  13005. following a section heading, which are not indented.
  13006. @item --pdf
  13007. @opindex --pdf
  13008. Generate a PDF file using @command{texi2dvi --pdf}, rather than Info
  13009. (@pxref{@command{texi2any} Printed Output}).
  13010. @item --plaintext
  13011. @opindex --plaintext
  13012. @cindex Plain text output with @option{--plaintext}
  13013. @cindex ASCII text output with @option{--plaintext}
  13014. @cindex Generating plain text files with @option{--plaintext}
  13015. @cindex Node separators, omitting with @option{--plaintext}
  13016. @cindex Menus, omitting with @option{--plaintext}
  13017. @cindex @file{INSTALL} file, generating
  13018. Output a plain text file (rather than Info): do not include menus or
  13019. node separator lines in the output. This results in a straightforward
  13020. plain text file that you can (for example) send in email without
  13021. complications, or include in a distribution (for example, an
  13022. @file{INSTALL} file).
  13023. With this option, @code{@@setfilename} is ignored and the output goes
  13024. to standard output by default; this can be overridden with @option{-o}.
  13025. @item --ps
  13026. @opindex --ps
  13027. Generate a PostScript file using @command{texi2dvi --ps}, rather than
  13028. Info (@pxref{@command{texi2any} Printed Output}).
  13029. @item --set-customization-variable @var{var}=@var{value}
  13030. @itemx -c @var{var}=@var{value}
  13031. @opindex --set-customization-variable @var{var}=@var{value}
  13032. @opindex -c @var{var}=@var{value}
  13033. Set the customization variable @var{var} to @var{value}. The @code{=}
  13034. is optional, but both @var{var} and @var{value} must be quoted to the
  13035. shell as necessary so the result is a single word. Many aspects of
  13036. @command{texi2any} behavior and output may be controlled by
  13037. customization variables, beyond what can be set in the document by
  13038. @@-commands and with other command line switches. @xref{Customization
  13039. Variables}.
  13040. @item --split=@var{how}
  13041. @itemx --no-split
  13042. @opindex --split=@var{how}
  13043. @opindex --no-split
  13044. @cindex Splitting of output files
  13045. @cindex Output file splitting
  13046. @anchor{Splitting Output}
  13047. @c
  13048. When generating Info, by default large output files are split into
  13049. smaller subfiles, of approximately 300k bytes. When generating HTML,
  13050. by default each output file contains one node (@pxref{Generating
  13051. HTML}). @option{--no-split} suppresses this splitting of the output.
  13052. Alternatively, @option{--split=@var{how}} may be used to specify at
  13053. which level the HTML output should be split. The possible values for
  13054. @var{how} are:
  13055. @table @samp
  13056. @item chapter
  13057. The output is split at @code{@@chapter} and other sectioning
  13058. @@-commands at this level (@code{@@appendix}, etc.).
  13059. @item section
  13060. The output is split at @code{@@section} and similar.
  13061. @item node
  13062. The output is split at every node. This is the default.
  13063. @end table
  13064. Plain text output can be split similarly to HTML@. This may be useful
  13065. for extracting sections from a Texinfo document and making them
  13066. available as separate files.
  13067. @item --split-size=@var{num}
  13068. @opindex --split-size=@var{num}
  13069. Keep Info files to at most @var{num} characters if possible; default
  13070. is 300,000. (However, a single node will never be split across Info
  13071. files.)
  13072. @item --transliterate-file-names
  13073. @opindex --transliterate-file-names
  13074. Enable transliteration of 8-bit characters in node names for the
  13075. purpose of file name creation. @xref{HTML Xref 8-bit Character Expansion}.
  13076. @item -U @var{var}
  13077. Cause @var{var} to be undefined. This is equivalent to @code{@@clear
  13078. @var{var}} in the Texinfo file (@pxref{@code{@@set @@clear @@value}}).
  13079. @item --verbose
  13080. @opindex --verbose
  13081. Cause @code{makeinfo} to display messages saying what it is doing.
  13082. Normally, @code{makeinfo} only outputs messages if there are errors or
  13083. warnings.
  13084. @item --version
  13085. @itemx -V
  13086. @opindex --version@r{, for @command{texi2any}}
  13087. @opindex -V
  13088. Print the version number, then exit successfully.
  13089. @item --Xopt @var{str}
  13090. @opindex --Xopt @var{str}
  13091. Pass @var{str} (a single shell word) to @command{texi2dvi}; may be
  13092. repeated (@pxref{@command{texi2any} Printed Output}).
  13093. @item --xml
  13094. @opindex --xml
  13095. Generate Texinfo XML output (rather than Info).
  13096. @end table
  13097. @node @command{texi2any} Environment Variables
  13098. @section Environment Variables Recognized by @command{texi2any}
  13099. @vindex TEXINFO_OUTPUT_FORMAT
  13100. @cindex Environment variable @code{TEXINFO_OUTPUT_FORMAT}
  13101. @command{makeinfo} also reads the environment variable
  13102. @env{TEXINFO_OUTPUT_FORMAT} to determine the output format, if not
  13103. overridden by a command line option. The value should be one of:
  13104. @example
  13105. docbook dvi dvipdf html info pdf plaintext ps xml
  13106. @end example
  13107. If not set or otherwise specified, Info output is the default.
  13108. The customization variable of the same name is also read; if set, that
  13109. overrides an environment variable setting, but not a command-line
  13110. option. @xref{Customization Variables and Options}.
  13111. @vindex TEXINFO_XS
  13112. @cindex Perl extension modules (XS)
  13113. You can control @command{texi2any}'s use of Perl extension modules
  13114. by setting the @env{TEXINFO_XS} environment variable. These modules
  13115. are compiled native code that the interpreted Perl code can use.
  13116. Ideally, these extension modules should just work, and the only noticable
  13117. difference they should make is that @command{texi2any} finishes running
  13118. sooner. However, you can use this environment variable for the purposes
  13119. of troubleshooting: for example, if you have problems with the output of
  13120. @command{texi2any} varying depending on whether the extension modules are
  13121. in use.
  13122. The following values of @env{TEXINFO_XS} are recognized by
  13123. @command{texi2any}:
  13124. @table @samp
  13125. @item default
  13126. The default behavior. Try to load extension modules, and silently fall
  13127. back to the interpreted Perl implementations if this fails.
  13128. @item warn
  13129. Try to load extension modules, and if this fails, give a warning message
  13130. before falling back to the interpreted Perl implementations.
  13131. @item debug
  13132. Try to load extension modules, printing many messages while doing so.
  13133. @item omit
  13134. Do not use extension modules.
  13135. @end table
  13136. @node @command{texi2any} Printed Output
  13137. @section @command{texi2any} Printed Output
  13138. @cindex Printed output, through @command{texi2any}
  13139. @cindex Output, printed through @command{texi2any}
  13140. To justify the name Texinfo-to-@emph{any}, @command{texi2any} has
  13141. basic support for creating printed output in the various formats:
  13142. @TeX{} DVI, PDF, and PostScript. This is done via the simple method
  13143. of executing the @command{texi2dvi} program when those output formats
  13144. are requested, after checking the validity of the input to give users
  13145. the benefit of @command{texi2any}'s error checking. If you don't want
  13146. such error checking, perhaps because your manual plays advanced @TeX{}
  13147. tricks together with @file{texinfo.tex}, just invoke
  13148. @command{texi2dvi} directly.
  13149. The output format options for this are @option{--dvi},
  13150. @option{--dvipdf}, @option{--pdf}, and @option{--ps}. @xref{Format
  13151. with @command{texi2dvi}}, for more details on these options and general
  13152. @command{texi2dvi} operation. In addition, the @option{--verbose},
  13153. @option{--silent}, and @option{--quiet} options are passed on if
  13154. specified; the @option{-I} and @option{-o} options are likewise passed
  13155. on with their arguments, and @option{--debug} without its argument.
  13156. The only option remaining that is related to the @command{texi2dvi}
  13157. invocation is @option{--Xopt}. Here, just the argument is passed on
  13158. and multiple @option{--Xopt} options accumulate. This provides a way
  13159. to construct an arbitrary command line for @command{texi2dvi}. For
  13160. example, running
  13161. @example
  13162. texi2any --Xopt -t --Xopt @@a4paper --pdf foo.texi
  13163. @end example
  13164. @noindent is equivalent to running
  13165. @example
  13166. texi2dvi -t @@a4paper --pdf foo.texi
  13167. @end example
  13168. @noindent except for the validity check.
  13169. Although one might wish that other options to @command{texi2any} would
  13170. take effect, they don't. For example, running @samp{texi2any
  13171. --no-number-sections --dvi foo.texi} still results in a DVI file with
  13172. numbered sections. (Perhaps this could be improved in the future, if
  13173. requests are received.)
  13174. The actual name of the command that is invoked is specified by the
  13175. @code{TEXI2DVI} customization variable (@pxref{Other Customization
  13176. Variables}). As you might guess, the default is @samp{texi2dvi}.
  13177. @command{texi2any} itself does not generate any normal output when it
  13178. invokes @command{texi2dvi}, only diagnostic messages.
  13179. @node Pointer Validation
  13180. @section Pointer Validation
  13181. @cindex Pointer validation with @code{makeinfo}
  13182. @cindex Validation of pointers
  13183. If you do not suppress pointer validation with the
  13184. @samp{--no-validate} option or the @code{@@novalidate} command in the
  13185. source file (@pxref{Use @TeX{}}), @code{makeinfo} will check the
  13186. validity of the Texinfo file.
  13187. Most validation checks are different depending on whether node
  13188. pointers are explicitly or implicitly determined. With explicit node
  13189. pointers, here is the list of what is checked:
  13190. @enumerate
  13191. @item
  13192. If a `Next', `Previous', or `Up' node reference is a reference to a
  13193. node in the current file and is not an external reference such as to
  13194. @file{(dir)}, then the referenced node must exist.
  13195. @item
  13196. Every node except the `Top' node must have an `Up' pointer.
  13197. @item
  13198. The node referenced by an `Up' pointer must itself reference the
  13199. current node through a menu item, unless the node referenced by `Up'
  13200. has the form @samp{(@var{file})}.
  13201. @end enumerate
  13202. With implicit node pointers, the above error cannot occur, as such.
  13203. (Which is a major reason why we recommend using this feature of
  13204. @code{makeinfo}, and not specifying any node pointers yourself.)
  13205. Instead, @code{makeinfo} checks that the tree constructed from the
  13206. document's menus matches the tree constructed from the sectioning
  13207. commands. For example, if a chapter-level menu mentions nodes
  13208. @var{n1} and @var{n2}, in that order, nodes @var{n1} and @var{n2} must
  13209. be associated with @code{@@section} commands in the chapter.
  13210. Finally, with both explicit and implicit node pointers,
  13211. @code{makeinfo} checks that every node except the `Top' node is
  13212. referenced in a menu.
  13213. @node Customization Variables
  13214. @section Customization Variables
  13215. @quotation Warning
  13216. These customization variable names and meanings may change in any
  13217. Texinfo release. We always try to avoid incompatible changes, but we
  13218. cannot absolutely promise, since needs change over time.
  13219. @end quotation
  13220. Many aspects of the behavior and output of @command{texi2any} may be
  13221. modified by modifying so-called @dfn{customization variables}. These
  13222. fall into a few general categories:
  13223. @itemize @bullet
  13224. @item
  13225. Those associated with @@-commands; for example,
  13226. @code{@@documentlanguage}.
  13227. @item
  13228. Those associated with command-line options; for example, the
  13229. customization variable @code{SPLIT} is associated with the
  13230. @option{--split} command-line option, and @code{TEXINFO_OUTPUT_FORMAT}
  13231. allows specifying the output format.
  13232. @item
  13233. Those associated with customizing the HTML output.
  13234. @item
  13235. Other ad hoc variables.
  13236. @end itemize
  13237. Customization variables may set on the command line using
  13238. @code{--set-customization-variable '@var{var} @var{value}'} (quoting
  13239. the variable/value pair to the shell) or
  13240. @code{--set-customization-variable @var{var}=@var{value}} (using
  13241. @code{=}). A special @var{value} is @samp{undef}, which sets the
  13242. variable to this special ``undefined'' Perl value.
  13243. The sections below give the details for each of these.
  13244. @menu
  13245. * Commands: Customization Variables for @@-Commands.
  13246. * Options: Customization Variables and Options.
  13247. * HTML: HTML Customization Variables.
  13248. * Other: Other Customization Variables.
  13249. @end menu
  13250. @node Customization Variables for @@-Commands
  13251. @subsection Customization Variables for @@-Commands
  13252. @cindex Customization variables for @@-commands
  13253. @cindex @@-commands, customization variables for
  13254. Each of the following @@-commands has an associated customization
  13255. variable with the same name (minus the leading @code{@@}):
  13256. @smallexample
  13257. @@allowcodebreaks @@clickstyle @@codequotebacktick
  13258. @@codequoteundirected @@contents @@deftypefnnewline
  13259. @@documentdescription @@documentencoding @@documentlanguage
  13260. @@evenfooting @@evenfootingmarks
  13261. @@evenheading @@evenheadingmarks
  13262. @@everyfooting @@everyfootingmarks
  13263. @@everyheading @@everyheadingmarks
  13264. @@exampleindent @@firstparagraphindent
  13265. @@fonttextsize @@footnotestyle @@frenchspacing @@headings
  13266. @@kbdinputstyle @@novalidate
  13267. @@oddfooting @@oddfootingmarks
  13268. @@oddheading @@oddheadingmarks
  13269. @@pagesizes @@paragraphindent
  13270. @@setchapternewpage @@setfilename
  13271. @@shortcontents @@urefbreakstyle
  13272. @@validatemenus @@xrefautomaticsectiontitle
  13273. @end smallexample
  13274. Setting such a customization variable to a value @samp{foo} is similar
  13275. to executing @code{@@@var{cmd} foo}. It is not exactly the same,
  13276. though, since any side effects of parsing the Texinfo source are not
  13277. redone. Also, some variables do not take Texinfo code when generating
  13278. particular formats, but an argument that is already formatted. This
  13279. is the case, for example, for HTML for @code{documentdescription}.
  13280. @node Customization Variables and Options
  13281. @subsection Customization Variables and Options
  13282. @cindex Customization variables for options
  13283. @cindex Options, customization variables for
  13284. The following table gives the customization variables associated with
  13285. some command line options. @xref{Invoking @command{texi2any}}, for the
  13286. meaning of the options.
  13287. @multitable @columnfractions 0.5 0.5
  13288. @headitem Option @tab Variable
  13289. @item
  13290. @vindex ENABLE_ENCODING
  13291. @option{--enable-encoding} @tab @code{ENABLE_ENCODING}
  13292. @item
  13293. @option{--document-language} @tab @code{documentlanguage}
  13294. @item
  13295. @vindex ERROR_LIMIT
  13296. @option{--error-limit} @tab @code{ERROR_LIMIT}
  13297. @item
  13298. @vindex FILLCOLUMN
  13299. @option{--fill-column} @tab @code{FILLCOLUMN}
  13300. @vindex footnotestyle
  13301. @item
  13302. @option{--footnote-style} @tab @code{footnotestyle}
  13303. @item
  13304. @vindex FORCE
  13305. @option{--force} @tab @code{FORCE}
  13306. @vindex INTERNAL_LINKS
  13307. @item
  13308. @option{--internal-links} @tab @code{INTERNAL_LINKS}
  13309. @item
  13310. @vindex MACRO_EXPAND
  13311. @option{--macro-expand} @tab @code{MACRO_EXPAND}
  13312. @item
  13313. @option{--headers} @tab @code{HEADERS}, @code{SHOW_MENU}
  13314. @item
  13315. @vindex NO_WARN
  13316. @option{--no-warn} @tab @code{NO_WARN}
  13317. @item
  13318. @vindex novalidate
  13319. @option{--no-validate} @tab @code{novalidate}
  13320. @item
  13321. @vindex NUMBER_FOOTNOTES
  13322. @option{--number-footnotes} @tab @code{NUMBER_FOOTNOTES}
  13323. @item
  13324. @vindex NUMBER_SECTIONS
  13325. @option{--number-sections} @tab @code{NUMBER_SECTIONS}
  13326. @item
  13327. @vindex NODE_FILES
  13328. @option{--node-files} @tab @code{NODE_FILES}
  13329. @item
  13330. @vindex OUT
  13331. @vindex OUTFILE
  13332. @vindex SUBDIR
  13333. @option{--output} @tab @code{OUT}, @code{OUTFILE},
  13334. @code{SUBDIR}
  13335. @item
  13336. @vindex paragraphindent
  13337. @option{--paragraph-indent} @tab @code{paragraphindent}
  13338. @item
  13339. @vindex SILENT
  13340. @option{--silent} @tab @code{SILENT}
  13341. @item
  13342. @vindex SPLIT
  13343. @option{--split} @tab @code{SPLIT}
  13344. @item
  13345. @vindex SPLIT_SIZE
  13346. @option{--split-size} @tab @code{SPLIT_SIZE}
  13347. @item
  13348. @vindex TRANSLITERATE_FILE_NAMES
  13349. @option{--transliterate-file-names} @tab @code{TRANSLITERATE_FILE_NAMES}
  13350. @item
  13351. @vindex VERBOSE
  13352. @option{--verbose} @tab @code{VERBOSE}
  13353. @end multitable
  13354. Setting such a customization variable to a value @samp{foo} is
  13355. essentially the same as specifying the @code{--@var{opt}=foo} if the
  13356. option takes an argument, or @code{--@var{opt}} if not.
  13357. @vindex TEXINFO_OUTPUT_FORMAT
  13358. In addition, the customization variable @code{TEXINFO_OUTPUT_FORMAT}
  13359. allows specifying what @code{makeinfo} outputs, either one of the usual
  13360. output formats that can be specified with options, or various other
  13361. forms:
  13362. @ftable @samp
  13363. @item docbook
  13364. @itemx dvi
  13365. @itemx dvipdf
  13366. @itemx html
  13367. @itemx info
  13368. @itemx pdf
  13369. @itemx plaintext
  13370. @itemx ps
  13371. @itemx xml
  13372. These correspond to the command-line options (and
  13373. @code{TEXINFO_OUTPUT_FORMAT} environment variable values) of the same
  13374. name. @xref{Invoking @command{texi2any}}.
  13375. @item debugtree
  13376. @cindex tree representation, for debugging
  13377. @cindex debugging document, with tree representation
  13378. Instead of generating a regular output format, output a text representation
  13379. of the tree obtained by parsing the input texinfo document.
  13380. @item parse
  13381. Do only Texinfo source parsing; there is no output.
  13382. @item plaintexinfo
  13383. Output the Texinfo source with all the macros, @code{@@include} and
  13384. @code{@@value@{@}} expanded. This is similar to setting
  13385. @option{--macro-expand}, but instead of being output in addition to
  13386. the normal conversion, output of Texinfo is the main output.
  13387. @item rawtext
  13388. @cindex raw text output
  13389. Output raw text, with minimal formatting. For example, footnotes are
  13390. ignored and there is no paragraph filling. This is used by the parser
  13391. for file names and copyright text in HTML comments, for example.
  13392. @item structure
  13393. Do only Texinfo source parsing and determination of the document
  13394. structure; there is no output.
  13395. @item texinfosxml
  13396. @cindex SXML output
  13397. @cindex S-expressions, output format
  13398. Output the document in TexinfoSXML representation, a syntax for
  13399. writing XML data using Lisp S-expressions.
  13400. @item textcontent
  13401. @cindex spell checking
  13402. @cindex word counting
  13403. @pindex detexinfo
  13404. @cindex stripping Texinfo commands
  13405. Output the text content only, stripped of commands; this is useful for
  13406. spell checking or word counting, for example. The trivial
  13407. @code{detexinfo} script setting this is in the @file{util} directory
  13408. of the Texinfo source as an example. It's one line:
  13409. @example
  13410. exec texi2any -c TEXINPUT_OUTPUT_FORMAT=textcontent "$@@"
  13411. @end example
  13412. @end ftable
  13413. @node HTML Customization Variables
  13414. @subsection HTML Customization Variables
  13415. This table gives the customization variables which apply to HTML
  13416. output only. A few other customization variable apply to both HTML
  13417. and other output formats; those are given in the next section.
  13418. @vtable @code
  13419. @item AVOID_MENU_REDUNDANCY
  13420. For HTML@. If set, and the menu entry and menu description are the
  13421. same, then do not print the menu description; default false.
  13422. @item AFTER_BODY_OPEN
  13423. For HTML@. If set, the corresponding text will appear at the
  13424. beginning of each HTML file; default unset.
  13425. @item AFTER_ABOUT
  13426. For HTML, when an About-element is output. If set, the corresponding
  13427. text will appear at the end of the About element; default unset.
  13428. @item AFTER_OVERVIEW
  13429. @itemx AFTER_TOC_LINES
  13430. For HTML@. If set, the corresponding text is output after the short
  13431. table of contents for @code{AFTER_OVERVIEW} and after the table of
  13432. contents for @code{AFTER_TOC_LINES}; otherwise, a default string is
  13433. used. At the time of writing, a @code{</div>} element is closed.
  13434. In general, you should set @code{BEFORE_OVERVIEW} if
  13435. @code{AFTER_OVERVIEW} is set, and you should set
  13436. @code{BEFORE_TOC_LINES} if @code{AFTER_TOC_LINES} is set.
  13437. @item BASEFILENAME_LENGTH
  13438. For HTML@. The maximum length of the base filenames; default 245.
  13439. Changing this would make cross-manual references to such long node
  13440. names invalid (@pxref{HTML Xref Link Basics}).
  13441. @item BEFORE_OVERVIEW
  13442. @itemx BEFORE_TOC_LINES
  13443. For HTML@. If set, the corresponding text is output before the short
  13444. table of contents for @code{BEFORE_OVERVIEW} and before the table of
  13445. contents for @code{BEFORE_TOC_LINES}, otherwise a default string is
  13446. used. At the time of writing, a @code{<div ...>} element is opened.
  13447. In general you should set @code{AFTER_OVERVIEW} if
  13448. @code{BEFORE_OVERVIEW} is set, and you should set
  13449. @code{AFTER_TOC_LINES} if @code{BEFORE_TOC_LINES} is set.
  13450. @item BIG_RULE
  13451. For HTML@. Rule used after and before the top element and before
  13452. special elements, but not for footers and headers; default
  13453. @code{<hr>}.
  13454. @item BODYTEXT
  13455. @cindex @code{<body>} text, customizing
  13456. @opindex lang@r{, HTML attribute}
  13457. For HTML, the text appearing in @code{<body>}. By default, sets the
  13458. HTML @code{lang} attribute to the document language
  13459. (@pxref{@code{@@documentlanguage}}).
  13460. @item CASE_INSENSITIVE_FILENAMES
  13461. For HTML@. Construct output file names as if the filesystem were case
  13462. insensitive (@pxref{HTML Splitting}); default false.
  13463. @item CHAPTER_HEADER_LEVEL
  13464. For HTML@. Header formatting level used for chapter level sectioning
  13465. commands; default @samp{2}.
  13466. @item CHECK_HTMLXREF
  13467. For HTML@. Check that manuals which are the target of external
  13468. cross-references (@pxref{Four and Five Arguments}) are present in
  13469. @file{htmlxref.cnf} (@pxref{HTML Xref Configuration}); default false.
  13470. @item COMPLEX_FORMAT_IN_TABLE
  13471. For HTML@. If set, use tables for indentation of complex formats; default
  13472. false.
  13473. @item CSS_LINES
  13474. For HTML@. CSS output, automatically determined by default (@pxref{HTML CSS}).
  13475. @item DATE_IN_HEADER
  13476. For HTML@. Put the document generation date in the header; off by default.
  13477. @item DEF_TABLE
  13478. For HTML@. If set, a @code{<table>} construction for @code{@@deffn}
  13479. and similar @@-commands is used (looking more like the @TeX{} output),
  13480. instead of definition lists; default false.
  13481. @item DEFAULT_RULE
  13482. For HTML@. Rule used between element, except before and after the
  13483. top element, and before special elements, and for footers and headers;
  13484. default @code{<hr>}.
  13485. @item DO_ABOUT
  13486. For HTML@. If set to 0 never do an About special element;
  13487. if set to 1 always do an About special element;
  13488. default 0.
  13489. @c @xref{Output Elements Defined}.
  13490. @item EXTERNAL_DIR
  13491. For HTML@. Base directory for external manuals; default none. It is
  13492. better to use the general external cross-reference mechanism
  13493. (@pxref{HTML Xref Configuration}) than this variable.
  13494. @item EXTRA_HEAD
  13495. For HTML@. Additional text appearing within @code{<head>}; default unset.
  13496. @item FOOTNOTE_END_HEADER_LEVEL
  13497. For HTML@. Header formatting level used for the footnotes header with
  13498. the `end' footnotestyle; default @samp{4}. @xref{Footnote Styles}.
  13499. @item FOOTNOTE_SEPARATE_HEADER_LEVEL
  13500. For HTML@. Header formatting level used for the footnotes header with
  13501. the `separate' footnotestyle; default @samp{4}. @xref{Footnote
  13502. Styles}.
  13503. @item FRAMES
  13504. For HTML@. If set, a file describing the frame layout is generated,
  13505. together with a file with the short table of contents; default false.
  13506. @item FRAMESET_DOCTYPE
  13507. For HTML@. Same as DOCTYPE, but for the file containing the frame
  13508. description.
  13509. @item HEADER_IN_TABLE
  13510. For HTML@. Use tables for header formatting rather than a simple
  13511. @code{<div>} element; default false.
  13512. @item ICONS
  13513. For HTML@. Use icons for the navigation panel; default false.
  13514. @item IMAGE_LINK_PREFIX
  13515. For HTML@. If set, the associated value is prepended to the image file
  13516. links; default unset.
  13517. @item INLINE_CONTENTS
  13518. For HTML@. If set, output the contents where the @code{@@contents} and
  13519. similar @@-commands are located; default true. This is ignored if
  13520. @code{@@set*contentsaftertitlepage} is set (@pxref{Contents}).
  13521. @item INLINE_CSS_STYLE
  13522. For HTML@. Put CSS directly in HTML elements rather than at the
  13523. beginning of the output; default false.
  13524. @item KEEP_TOP_EXTERNAL_REF
  13525. For HTML@. If set, do not ignore @samp{Top} as the first
  13526. argument for an external ref to a manual, as is done by default.
  13527. @xref{Referring to a Manual as a Whole}.
  13528. @item L2H
  13529. For HTML@. If set, @command{latex2html} is used to convert @code{@@math}
  13530. and @code{@@tex} sections; default false. Best used with @option{--iftex}.
  13531. @item L2H_CLEAN
  13532. (Relevant only if @code{L2H} is set.) If set, the intermediate files
  13533. generated in relation with @command{latex2html} are removed; default
  13534. true.
  13535. @item L2H_FILE
  13536. (Relevant only if @code{L2H} is set.) If set, the given file is used
  13537. as @command{latex2html}'s init file; default unset.
  13538. @item L2H_HTML_VERSION
  13539. (Relevant only if @code{L2H} is set.) The HTML version used in the
  13540. @command{latex2html} call; default unset.
  13541. @item L2H_L2H
  13542. (Relevant only if @code{L2H} is set.) The program invoked as
  13543. @command{latex2html}; default is @code{latex2html}.
  13544. @item L2H_SKIP
  13545. (Relevant only if @code{L2H} is set.) If set to a true value, the
  13546. actual call to @command{latex2html} is skipped; previously generated
  13547. content is reused instead. If set to 0, the cache is not used at all.
  13548. If set to @samp{undef}, the cache is used for as many @TeX{} fragments as
  13549. possible and for any remaining the command is run. The default is
  13550. @samp{undef}.
  13551. @item L2H_TMP
  13552. (Relevant only if @code{L2H} is set.) Set the directory used for
  13553. temporary files. None of the file name components in this directory
  13554. name may start with @samp{.}; otherwise, @command{latex2html} will
  13555. fail (because of @command{dvips}). The default is the empty string,
  13556. which means the current directory.
  13557. @item MAX_HEADER_LEVEL
  13558. For HTML@. Maximum header formatting level used (higher header
  13559. formatting level numbers correspond to lower sectioning levels);
  13560. default @samp{4}.
  13561. @item MENU_SYMBOL
  13562. For HTML@. Symbol used in front of menu entries when node names are used
  13563. for menu entries formatting; default @samp{&bull;}.
  13564. @item MONOLITHIC
  13565. For HTML@. Output only one file including the table of contents. Set
  13566. by default, but only relevant when the output is not split.
  13567. @item NO_CSS
  13568. For HTML@. Do not use CSS; default false. @xref{HTML CSS}.
  13569. @item NODE_FILE_EXTENSION
  13570. For HTML@. Extension for node files if @code{NODE_FILENAMES} is set;
  13571. default @samp{html}.
  13572. @item PRE_ABOUT
  13573. For HTML, when an About element is output. If set to a text string,
  13574. this text will appear at the beginning of the About element. If set
  13575. to a reference on a subroutine, the result of the subroutine call will
  13576. appear at the beginning of the About element. If not set (the
  13577. default), default text is used.
  13578. @item PRE_BODY_CLOSE
  13579. For HTML@. If set, the given text will appear at the footer of each
  13580. HTML file; default unset.
  13581. @item PROGRAM_NAME_IN_FOOTER
  13582. For HTML@. If set, output the program name and miscellaneous related
  13583. information in the page footers; default false.
  13584. @item SHORTEXTN
  13585. For HTML@. If set, use @samp{.htm} as extension; default false.
  13586. @item SHOW_TITLE
  13587. For HTML@. If set, output the title at the beginning of the document;
  13588. default true.
  13589. @item SIMPLE_MENU
  13590. For HTML@. If set, use a simple preformatted style for the menu,
  13591. instead of breaking down the different parts of the menu; default false.
  13592. @xref{Menu Parts}.
  13593. @item TOC_LINKS
  13594. For HTML@. If set, links from headings to toc entries are created;
  13595. default false.
  13596. @item TOP_FILE
  13597. This file name may be used for the top-level file. The extension is
  13598. set appropriately, if necessary. This is used to override the default,
  13599. and is, in general, only taken into account when output is split, and
  13600. for HTML@.
  13601. @item TOP_NODE_FILE
  13602. For HTML@. File name used for the Top node, if @code{NODE_FILENAMES}
  13603. is set; default is @code{index}.
  13604. @item TOP_NODE_FILE_TARGET
  13605. For HTML@. File name used for the Top node in cross-references;
  13606. default is @code{index}.
  13607. @item TOP_NODE_UP_URL
  13608. For HTML@. A url used for @code{(dir)} references; the default is
  13609. @code{undef}, meaning that the normal rules apply, typically leading
  13610. to a link to @samp{dir.html} from an implicit or explicit reference to
  13611. @samp{(dir)} (@pxref{HTML Xref}). For more about the Top node
  13612. pointers, @pxref{First Node}. For overriding the Up pointer in other
  13613. formats, see @code{TOP_NODE_UP} in @ref{Other Customization
  13614. Variables}.
  13615. @item USE_ACCESSKEY
  13616. @cindex @code{accesskey}, customization variable for
  13617. For HTML@. Use @code{accesskey} in cross-references; default true.
  13618. @item USE_ISO
  13619. For HTML@. Use entities for doubled single-quote characters
  13620. (@pxref{Inserting Quotation Marks}), and @samp{---} and @samp{--}
  13621. (@pxref{Conventions}); default true.
  13622. @item USE_LINKS
  13623. @cindex @code{<link>} HTML tag, in @code{<head>}
  13624. @cindex @code{<head>} HTML tag, and @code{<link>}
  13625. For HTML@. Generate @code{<link>} elements in the HTML @code{<head>}
  13626. output; default true.
  13627. @item USE_REL_REV
  13628. For HTML@. Use @code{rel} in cross-references; default true.
  13629. @item VERTICAL_HEAD_NAVIGATION
  13630. For HTML@. If set, a vertical navigation panel is used; default false.
  13631. @item WORDS_IN_PAGE
  13632. @cindex Navigation panel, bottom of page
  13633. @cindex Navigation footer
  13634. For HTML, with output split at nodes. Specifies the approximate
  13635. minimum page length at which a navigation panel is placed at the
  13636. bottom of a page. To avoid ever having the navigation buttons at the
  13637. bottom of a page, set this to a sufficiently large number. The
  13638. default is 300.
  13639. @item XREF_USE_FLOAT_LABEL
  13640. For HTML@. If set, for the float name in cross-references, use the
  13641. float label instead of the type followed by the float number
  13642. (@pxref{@code{@@float}}). The default is off.
  13643. @item XREF_USE_NODE_NAME_ARG
  13644. For HTML@. Only relevant for cross-reference commands with no cross
  13645. reference name (second argument). If set to@tie{}1, use the node name
  13646. (first) argument in cross-reference @@-commands for the text displayed
  13647. as the hyperlink. If set to@tie{}0, use the node name if
  13648. @code{USE_NODES} is set, otherwise the section name. If set to
  13649. @samp{undef}, use the first argument in preformatted environments,
  13650. otherwise use the node name or section name depending on
  13651. @code{USE_NODES}. The default is @samp{undef}.
  13652. @end vtable
  13653. @node Other Customization Variables
  13654. @subsection Other Customization Variables
  13655. This table gives the remaining customization variables, which apply to
  13656. multiple formats, or affect global behavior, or otherwise don't fit
  13657. into the categories of the previous sections.
  13658. @vtable @code
  13659. @item CLOSE_QUOTE_SYMBOL
  13660. When a closing quote is needed, use this character; default @code{&rsquo;}
  13661. in HTML, @code{&#8217;} in Docbook. The default for Info is the same
  13662. as @code{OPEN_QUOTE_SYMBOL} (see below).
  13663. @c @item COMPLETE_IMAGE_PATHS
  13664. @c If set, the image files are computed to be relative from the document
  13665. @c directory to the source manual directory, and then to the image.
  13666. @item CPP_LINE_DIRECTIVES
  13667. Recognize @code{#line} directives in a ``preprocessing'' pass
  13668. (@pxref{External Macro Processors}); on by default.
  13669. @item DEBUG
  13670. If set, debugging output is generated; default is off (zero).
  13671. @c The integer value specifies what kinds of debugging output are
  13672. @c generated. It is a bitmask. Setting it to 255 ensures having all
  13673. @c available debugging output.
  13674. @item DOCTYPE
  13675. @vindex SystemLiteral
  13676. For Docbook, HTML, XML@. Specifies the @code{SystemLiteral}, the
  13677. entity's system identifier. This is a URI which may be used to
  13678. retrieve the entity, and identifies the canonical DTD for the
  13679. document. The default value is different for each of HTML, Docbook
  13680. and Texinfo@tie{}XML.
  13681. @item DUMP_TEXI
  13682. For debugging. If set, no conversion is done, only parsing and macro
  13683. expansion. If the option @option{--macro-expand} is set, the Texinfo
  13684. source is also expanded to the corresponding file. Default false.
  13685. @item DUMP_TREE
  13686. For debugging. If set, the tree constructed upon parsing a Texinfo
  13687. document is output to standard error; default false.
  13688. @item ENABLE_ENCODING_USE_ENTITY
  13689. For HTML, XML@. If @option{--enable-encoding} is set, and there is an
  13690. entity corresponding with the letter or the symbol being output,
  13691. prefer the entity. Set by default for HTML, but not XML.
  13692. @item EXTERNAL_CROSSREF_SPLIT
  13693. For cross-references to other manuals, this determines if the other
  13694. manual is considered to be split or monolithic. By default, it is set
  13695. based on the value of @code{SPLIT}. @xref{HTML Xref}, and @pxref{HTML
  13696. Xref Configuration}.
  13697. @item EXTENSION
  13698. The extension added to the output file name. The default is different
  13699. for each output format.
  13700. @item FIX_TEXINFO
  13701. For ``plain Texinfo'' (see the @code{PLAINTEXINFO} item). If set to
  13702. false, the resulting Texinfo does not have all errors corrected, such
  13703. as missing @samp{@@end}; default true. This variable is only
  13704. relevant when expanding Texinfo; other converters always try to
  13705. output something sane even if the input is erroneous.
  13706. @c @item IDX_SUMMARY
  13707. @c If set, for each @code{@@printindex} a file named
  13708. @c @file{@var{docname}_@var{idxname}.idx} is created, containing lines of
  13709. @c the form:
  13710. @c
  13711. @c @example
  13712. @c @var{key} @var{reference}
  13713. @c @end example
  13714. @c
  13715. @c @noindent sorted alphabetically (case matters).
  13716. @item IGNORE_BEFORE_SETFILENAME
  13717. If set, begin outputting at @code{@@setfilename}, if
  13718. @code{@@setfilename} is present; default true.
  13719. @item IGNORE_SPACE_AFTER_BRACED_COMMAND_NAME
  13720. If set, spaces are ignored after an @@-command that takes braces.
  13721. Default true, matching the @TeX{} behavior.
  13722. @item INDEX_ENTRY_COLON
  13723. Symbol used between the index entry and the associated node or section;
  13724. default @samp{:}.
  13725. @item INDEX_SPECIAL_CHARS_WARNING
  13726. If set, warn about @samp{:} in index entry, as it leads to invalid entries in
  13727. index menus in output Info files. For Info and plaintext only.
  13728. @anchor{INFO_SPECIAL_CHARS_QUOTE}
  13729. @item INFO_SPECIAL_CHARS_QUOTE
  13730. If set, whenever there are problematic characters for Info output in
  13731. places such as node names or menu items, surround the part of the
  13732. construct where they appear with quoting characters, as described in
  13733. @ref{Info Format Specification}. @xref{Node Line Requirements}.
  13734. @item INFO_SPECIAL_CHARS_WARNING
  13735. If set, warn about problematic constructs for Info output (such as the
  13736. string @samp{::}) in node names, menu items, and cross-references;
  13737. default true. Do not warn about index entries, since parsing problems
  13738. there don't prevent navigation; readers can still relatively easily
  13739. find their way to the node in question.
  13740. @item INLINE_INSERTCOPYING
  13741. If set, @code{@@insertcopying} is replaced by the @code{@@copying}
  13742. content (@pxref{@code{@@copying}}) as if @code{@@insertcopying} were a
  13743. user-defined macro; default false.
  13744. @item INPUT_ENCODING_NAME
  13745. Normalized encoding name suitable for output. Should be a usable
  13746. charset name in HTML, typically one of the preferred IANA encoding
  13747. names. You should not need to use this variable, since it is set by
  13748. @code{@@documentencoding} (@pxref{@code{@@documentencoding}}).
  13749. @item INPUT_PERL_ENCODING
  13750. Perl encoding used to process the Texinfo source. You should not need
  13751. to use that variable, since it is set by @code{@@documentencoding}
  13752. (@pxref{@code{@@documentencoding}}).
  13753. @item MAX_MACRO_CALL_NESTING
  13754. The maximal number of recursive calls of @@-commands defined through
  13755. @code{@@rmacro}; default 100000. The purpose of this variable is to
  13756. avoid infinite recursions.
  13757. @item MENU_ENTRY_COLON
  13758. Symbol used between the menu entry and the description; default
  13759. @samp{:}.
  13760. @item NO_USE_SETFILENAME
  13761. If set, do not use @code{@@setfilename} to set the document name;
  13762. instead, base the output document name only on the input file name.
  13763. The default is false.
  13764. @item NODE_FILENAMES
  13765. If set, node names are used to construct file names. By default, it
  13766. is set if the output is split by node, or if @code{NODE_FILES} is set
  13767. and the output is split in any way.
  13768. @item NODE_NAME_IN_INDEX
  13769. If set, use node names in index entries, otherwise prefer section names;
  13770. default true.
  13771. @item NODE_NAME_IN_MENU
  13772. If set, use node names in menu entries, otherwise prefer section names;
  13773. default true.
  13774. @item OPEN_QUOTE_SYMBOL
  13775. When an opening quote is needed, e.g., for @samp{@@samp} output, use
  13776. the specified character; default @code{&lsquo;} for HTML,
  13777. @code{&#8216;} for Docbook. For Info, the default depends on the
  13778. enabled document encoding (@pxref{@code{@@documentencoding}}); if no
  13779. document encoding is set, or the encoding is US-ASCII, etc., @samp{'}
  13780. is used. This character usually appears as an undirected single quote
  13781. on modern systems. If the document encoding is Unicode, the Info
  13782. output uses a Unicode left quote.
  13783. @item OUTPUT_ENCODING_NAME
  13784. Normalized encoding name used for output files. Should be a usable
  13785. charset name in HTML, typically one of the preferred IANA encoding
  13786. names. By default, if an input encoding is set (typically through
  13787. @code{@@documentencoding} or @code{INPUT_ENCODING_NAME}), this
  13788. information is used to set the output encoding name. If no input
  13789. encoding is specified, the default output encoding name may be set by
  13790. the output format. In particular, the XML-based formats use
  13791. @code{utf-8} for @code{OUTPUT_ENCODING_NAME} if the encoding is not
  13792. otherwise specified. @xref{@code{@@documentencoding}}.
  13793. @item OVERVIEW_LINK_TO_TOC
  13794. If set, the cross-references in the Overview link to the corresponding
  13795. Table of Contents entries; default true.
  13796. @item PACKAGE
  13797. @itemx PACKAGE_VERSION
  13798. @itemx PACKAGE_AND_VERSION
  13799. @itemx PACKAGE_URL
  13800. @itemx PACKAGE_NAME
  13801. The implementation's short package name, package version, package name
  13802. and version concatenated, package url, and full package name,
  13803. respectively. By default, these variables are all set through
  13804. Autoconf, Automake, and @code{configure}.
  13805. @item PREFIX
  13806. The output file prefix, which is prepended to some output file names.
  13807. By default it is set by @code{@@setfilename} or from the input file
  13808. (@pxref{@code{@@setfilename}}). How this value is used depends on the
  13809. value of other customization variables or command line options, such
  13810. as whether the output is split and @code{NODE_FILENAMES}. The default
  13811. is unset.
  13812. @item PROGRAM
  13813. Name of the program used. By default, it is set to the name of the
  13814. program launched, with a trailing @samp{.pl} removed.
  13815. @item RENAMED_NODES_FILE
  13816. If set, use the value for the renamed nodes description file. If not
  13817. set, the file is @file{@var{doc_basename}-noderename.cnf}.
  13818. @xref{HTML Xref Link Preservation}.
  13819. @item RENAMED_NODES_REDIRECTIONS
  13820. If set, create redirection files for renamed nodes. Set by default
  13821. when generating HTML@.
  13822. @item SHOW_MENU
  13823. @vindex HEADERS
  13824. @opindex --no-headers
  13825. If set, Texinfo menus are output. By default, it is set unless
  13826. generating Docbook or if @option{--no-headers} is specified.
  13827. @item SORT_ELEMENT_COUNT
  13828. @pindex texi-elements-by-size
  13829. @cindex Longest nodes, finding
  13830. @cindex Sorting nodes by size
  13831. If set, the name of a file to which a list of elements (nodes or
  13832. sections, depending on the output format) is dumped, sorted by the
  13833. number of lines they contain after removal of @@-commands; default
  13834. unset. This is used by the program @code{texi-elements-by-size} in
  13835. the @file{util/} directory of the Texinfo source distribution
  13836. (@pxref{texi-elements-by-size}).
  13837. @item SORT_ELEMENT_COUNT_WORDS
  13838. When dumping the elements-by-size file (see preceding item), use word
  13839. counts instead of line counts; default false.
  13840. @c @item SPLIT_INDEX
  13841. @c For HTML@. If set, the output is split, and the output from
  13842. @c @code{@@printindex} happens in a sectioning element at the level of
  13843. @c splitting, then split index pages at the next letter after they have
  13844. @c more than that many entries. If set to 0, no index splitting.
  13845. @item TEST
  13846. If set to true, some variables which are normally dynamically
  13847. generated anew for each run (date, program name, version) are set to
  13848. fixed and given values. This is useful to compare the output to a
  13849. reference file, as is done for the tests. The default is false.
  13850. @item TEXI2DVI
  13851. Name of the command used to produce PostScript, PDF, and DVI; default
  13852. @samp{texi2dvi}. @xref{@command{texi2any} Printed Output}.
  13853. @item TEXI2HTML
  13854. @cindex compatibility, with @command{texi2html}
  13855. Generate HTML and try to be as compatible as possible with
  13856. @command{texi2html}; default false.
  13857. @item TEXINFO_DTD_VERSION
  13858. For XML@. Version of the DTD used in the XML output preamble. The
  13859. default is set based on a variable in @file{configure.ac}.
  13860. @item TEXTCONTENT_COMMENT
  13861. For stripped text content output (i.e., when
  13862. @code{TEXINFO_OUTPUT_FORMAT} is set to @code{textcontent}). If set,
  13863. also output comments. Default false.
  13864. @item TOP_NODE_UP
  13865. Up node for the Top node; default @samp{(dir)}. For overriding the
  13866. url in HTML output, see @code{TOP_NODE_UP_URL} in @ref{HTML
  13867. Customization Variables}.
  13868. @item TREE_TRANSFORMATIONS
  13869. The associated value is a comma separated list of transformations that
  13870. can be applied to the Texinfo tree prior to outputting the result. If
  13871. more than one is specified, the ordering is irrelevant; each is always
  13872. applied at the necessary point during processing.
  13873. The only one executed by default is
  13874. @samp{move_index_entries_after_items} for HTML and Docbook output.
  13875. Here's an example of updating the master menu in a document:
  13876. @example
  13877. makeinfo \
  13878. -c TREE_TRANSFORMATIONS=regenerate_master_menu \
  13879. -c PLAINTEXINFO=1 \
  13880. mydoc.texi \
  13881. -o /tmp/out
  13882. @end example
  13883. @noindent (Caveat: Since @code{PLAINTEXINFO} output does expand
  13884. Texinfo macros and conditionals, it's necessary to remove any such
  13885. differences before installing the updates in the original document.
  13886. This will be remedied in a future release.)
  13887. The following transformations are currently supported (many are used
  13888. in the @code{pod2texi} utility distributed with Texinfo;
  13889. @pxref{Invoking @command{pod2texi}}):
  13890. @ftable @samp
  13891. @item complete_tree_nodes_menus
  13892. Add menu entries or whole menus for nodes associated with sections of
  13893. any level, based on the sectioning tree.
  13894. @item fill_gaps_in_sectioning
  13895. Adds empty @code{@@unnumbered...} sections in a tree to fill gaps in
  13896. sectioning. For example, an @code{@@unnumberedsec} will be inserted
  13897. if a @code{@@chapter} is followed by a @code{@@subsection}.
  13898. @item insert_nodes_for_sectioning_commands
  13899. Insert nodes for sectioning commands lacking a corresponding node.
  13900. @item move_index_entries_after_items
  13901. In @code{@@enumerate} and @code{@@itemize}, move index entries
  13902. appearing just before an @code{@@item} to just after the
  13903. @code{@@item}. Comment lines between index entries are moved too. As
  13904. mentioned, this is always done for HTML and Docbook output.
  13905. @item regenerate_master_menu
  13906. Update the Top node master menu, either replacing the (first)
  13907. @code{@@detailmenu} in the Top node menu, or creating it at the end of
  13908. the Top node menu.
  13909. @item simple_menu
  13910. Mostly the same as @code{SIMPLE_MENU}: use a simple preformatted style
  13911. for the menu. It differs from setting @code{SIMPLE_MENU} in that
  13912. @code{SIMPLE_MENU} only has an effect in HTML output.
  13913. @end ftable
  13914. @item USE_NODES
  13915. Preferentially use nodes to decide where elements are separated. If
  13916. set to false, preferentially use sectioning to decide where elements
  13917. are separated. The default is true.
  13918. @item USE_NODE_TARGET
  13919. If set, use the node associated with a section for the section target
  13920. in cross-references; default true.
  13921. @item USE_NUMERIC_ENTITY
  13922. For HTML and XML@. If set, use numeric entities instead of ASCII
  13923. characters when there is no named entity. By default, set to true for
  13924. HTML.
  13925. @item USE_UP_NODE_FOR_ELEMENT_UP
  13926. Fill in up sectioning direction with node direction when there is no
  13927. sectioning up direction. In practice this can only happen when there
  13928. is no @@top section. Not set by default.
  13929. @item USE_SETFILENAME_EXTENSION
  13930. Default is on for Info, off for other output. If set, use exactly
  13931. what @code{@@setfilename} gives for the output file name, including
  13932. the extension. You should not need to explicitly set this variable.
  13933. @item USE_TITLEPAGE_FOR_TITLE
  13934. Use the full @code{@@titlepage} as the title, not a simple title string;
  13935. default false.
  13936. @item USE_UNIDECODE
  13937. @pindex Text::Unidecode
  13938. If set to false, do not use the @code{Text::Unidecode} Perl module to
  13939. transliterate more characters; default true.
  13940. @end vtable
  13941. @node Internationalization of Document Strings
  13942. @section Internationalization of Document Strings
  13943. @cindex I18n, of document strings
  13944. @cindex Internationalization of document strings
  13945. @cindex Document strings, internationalization of
  13946. @cindex Output document strings, internationalization of
  13947. @cindex Translating strings in output documents
  13948. @vindex documentlanguage @r{customization variable}
  13949. @command{texi2any} writes fixed strings into the output document at
  13950. various places: cross-references, page footers, the help page,
  13951. alternate text for images, and so on. The string chosen depends on
  13952. the value of the @code{documentlanguage} at the time of the string
  13953. being output (@pxref{@code{@@documentlanguage}}, for the Texinfo
  13954. command interface).
  13955. @pindex libintl-perl @r{Gettext implementation}
  13956. The Gettext framework is used for those strings (@pxref{Top,,,
  13957. gettext, Gettext}). The @code{libintl-perl} package is used as the
  13958. @code{gettext} implementation; more specifically, the pure Perl
  13959. implementation is used, so Texinfo can support consistent behavior
  13960. across all platforms and installations, which would not otherwise be
  13961. possible. @code{libintl-perl} is included in the Texinfo distribution
  13962. and always installed, to ensure that it is available if needed. It is
  13963. also possible to use the system @code{gettext} (the choice can be made
  13964. at build-time).
  13965. @vindex texinfo_document @r{Gettext domain}
  13966. @cindex Perl format strings for translation
  13967. The Gettext domain @samp{texinfo_document} is used for the strings.
  13968. Translated strings are written as Texinfo, and may include
  13969. @@-commands. In translated strings, the varying parts of the string
  13970. are not usually denoted by @code{%s} and the like, but by
  13971. @samp{@{arg_name@}}. (This convention is common for @code{gettext} in
  13972. Perl and is fully supported in GNU Gettext; @pxref{perl-format,, Perl
  13973. Format Strings, gettext, GNU Gettext}.) For example, in the
  13974. following, @samp{@{section@}} will be replaced by the section name:
  13975. @example
  13976. see @{section@}
  13977. @end example
  13978. These Perl-style brace format strings are used for two reasons: first,
  13979. changing the order of @code{printf} arguments is only available since
  13980. Perl@tie{}5.8.0; second, and more importantly, the order of arguments
  13981. is unpredictable, since @@-command expansion may lead to different
  13982. orders depending on the output format.
  13983. The expansion of a translation string is done like this:
  13984. @enumerate
  13985. @item First, the string is translated. The locale
  13986. is @var{@@documentlanguage}@code{.}@var{@@documentencoding}.
  13987. @cindex @code{us-ascii} encoding, and translations
  13988. If the @var{@@documentlanguage} has the form @samp{ll_CC}, that is
  13989. tried first, and then just @samp{ll}. If that does not exist, and the
  13990. encoding is not @code{us-ascii}, then @code{us-ascii} is tried.
  13991. The idea is that if there is a @code{us-ascii} encoding, it means that
  13992. all the characters in the charset may be expressed as @@-commands.
  13993. For example, there is a @code{fr.us-ascii} locale that can accommodate
  13994. any encoding, since all the Latin@tie{}1 characters have associated
  13995. @@-commands. On the other hand, Japanese has only a translation
  13996. @code{ja.utf-8}, since there are no @@-commands for Japanese
  13997. characters.
  13998. @item Next, the string is expanded as Texinfo, and converted.
  13999. The arguments are substituted; for example, @samp{@{arg_name@}} is
  14000. replaced by the corresponding actual argument.
  14001. @end enumerate
  14002. In the following example, @samp{@{date@}}, @samp{@{program_homepage@}}
  14003. and @samp{@{program@}} are the arguments of the string. Since they
  14004. are used in @code{@@uref}, their order is not predictable.
  14005. @samp{@{date@}}, @samp{@{program_homepage@}} and @samp{@{program@}} are
  14006. substituted after the expansion:
  14007. @example
  14008. Generated on @@emph@{@{date@}@} using
  14009. @@uref@{@{program_homepage@}, @@emph@{@{program@}@}@}.
  14010. @end example
  14011. This approach is admittedly a bit complicated. Its usefulness is that
  14012. it supports having translations available in different encodings for
  14013. encodings which can be covered by @@-commands, and also specifying how
  14014. the formatting for some commands is done, independently of the output
  14015. format---yet still be language-dependent. For example, the
  14016. @samp{@@pxref} translation string can be like this:
  14017. @example
  14018. see @{node_file_href@} section `@{section@}\' in @@cite@{@{book@}@}
  14019. @end example
  14020. @noindent
  14021. which allows for specifying a string independently of the output
  14022. format, while nevertheless with rich formatting it may be translated
  14023. appropriately in many languages.
  14024. @node Invoking @command{pod2texi}
  14025. @section Invoking @command{pod2texi}: Convert POD to Texinfo
  14026. @pindex pod2texi
  14027. @cindex Invoking @code{pod2texi}
  14028. @cindex POD, converting to Texinfo
  14029. @cindex Perl POD, converting to Texinfo
  14030. The @code{pod2texi} program translates Perl pod documentation file(s)
  14031. to Texinfo. There are two basic modes of operation: generating a
  14032. standalone manual from each input pod, or (if @code{--base-level=1} or
  14033. higher is given) generating Texinfo subfiles suitable for use
  14034. with @code{@@include}.
  14035. Although ordinarily this documentation in the Texinfo manual would be
  14036. the best place to look, in this case we have documented all the
  14037. options and examples in the @code{pod2texi} program itself, since it
  14038. may be useful outside of the rest of Texinfo. Thus, please see the
  14039. output of @code{pod2texi --help}, the version on the web at
  14040. @url{http://www.gnu.org/software/texinfo/manual/pod2texi.html}, etc.
  14041. For an example of using @code{pod2texi} to make Texinfo out of the
  14042. Perl documentation itself, see
  14043. @url{http://svn.savannah.gnu.org/viewvc/trunk/contrib/perldoc-all/?root=texinfo,
  14044. @file{contrib/perldoc-all}} in the Texinfo source distribution (the
  14045. output is available at @url{http://www.gnu.org/software/perl/manual}).
  14046. @node @command{texi2html}
  14047. @section @command{texi2html}: Ancestor of @command{texi2any}
  14048. @pindex texi2html
  14049. @cindex Cons, Lionel
  14050. Conceptually, the @command{texi2html} program is the parent of today's
  14051. @command{texi2any} program. @command{texi2html} was developed
  14052. independently, originally by Lionel Cons in 1998; at the time,
  14053. @command{makeinfo} could not generate HTML@. Many other people
  14054. contributed to @command{texi2html} over the years.
  14055. The present @command{texi2any} uses little of the actual code of
  14056. @command{texi2html}, and has quite a different basic approach to the
  14057. implementation (namely, parsing the Texinfo document into a tree), but
  14058. still, there is a family resemblance.
  14059. By design, @command{texi2any} supports nearly all the features of
  14060. @command{texi2html} in some way. However, we did not attempt to
  14061. maintain strict compatibility, so no @command{texi2html} executable is
  14062. installed by the Texinfo package. An approximation can be run with an
  14063. invocation like this (available as @file{util/texi2html} in the
  14064. Texinfo source):
  14065. @example
  14066. texi2any --set-customization-variable TEXI2HTML=1 ...
  14067. @end example
  14068. @noindent but, to emphasize, this is @emph{not} a drop-in replacement
  14069. for the previous @command{texi2html}. Here are the biggest differences:
  14070. @itemize @bullet
  14071. @item Most blatantly, the command line options of @command{texi2html}
  14072. are now customization variables, for the most part. A table of
  14073. approximate equivalents is given below.
  14074. @item The program-level customization API is very different in
  14075. @command{texi2any}.
  14076. @item Indices cannot be split.
  14077. @item Translated strings cannot be customized; we hope to introduce
  14078. this feature in @command{texi2any} in the future.
  14079. @end itemize
  14080. Aside from the last, we do not intend to reimplement these
  14081. differences. Therefore, the route forward for authors is alter
  14082. manuals and build processes as necessary to use the new features and
  14083. methods of @command{texi2any}. The @command{texi2html} maintainers
  14084. (one of whom is the principal author of @command{texi2any}) do not
  14085. intend to make further releases.
  14086. @cindex Options of @command{texi2html}
  14087. @cindex Command-line options of @command{texi2html}
  14088. Here is the table showing @command{texi2html} options and
  14089. corresponding @command{texi2any} customization variables.
  14090. @c (@pxref{texi2any Output Customization,, @command{texi2any} Output
  14091. @c Customization}).
  14092. @multitable {@option{--ignore-preamble-text}} {@code{IGNORE_PREAMBLE_TEXT}}
  14093. @item @option{--toc-links} @tab @code{TOC_LINKS}
  14094. @item @option{--short-ext} @tab @code{SHORTEXTN}
  14095. @item @option{--prefix} @tab @code{PREFIX}
  14096. @item @option{--short-ref} @tab @code{SHORT_REF}
  14097. @item @option{--idx-sum} @tab @code{IDX_SUMMARY}
  14098. @item @option{--def-table} @tab @code{DEF_TABLE}
  14099. @item @option{--ignore-preamble-text} @tab @code{IGNORE_PREAMBLE_TEXT}
  14100. @item @option{--html-xref-prefix} @tab @code{EXTERNAL_DIR}
  14101. @item @option{--l2h} @tab @code{L2H}
  14102. @item @option{--l2h-l2h} @tab @code{L2H_L2H}
  14103. @item @option{--l2h-skip} @tab @code{L2H_SKIP}
  14104. @item @option{--l2h-tmp} @tab @code{L2H_TMP}
  14105. @item @option{--l2h-file} @tab @code{L2H_FILE}
  14106. @item @option{--l2h-clean} @tab @code{L2H_CLEAN}
  14107. @item @option{--use-nodes} @tab @code{USE_NODES}
  14108. @item @option{--monolithic} @tab @code{MONOLITHIC}
  14109. @item @option{--top-file} @tab @code{TOP_FILE}
  14110. @item @option{--toc-file} @tab @code{TOC_FILE}
  14111. @item @option{--frames} @tab @code{FRAMES}
  14112. @item @option{--menu} @tab @code{SHOW_MENU}
  14113. @item @option{--debug} @tab @code{DEBUG}
  14114. @item @option{--doctype} @tab @code{DOCTYPE}
  14115. @item @option{--frameset-doctype} @tab @code{FRAMESET_DOCTYPE}
  14116. @item @option{--test} @tab @code{TEST}
  14117. @end multitable
  14118. @cindex @file{texi2oldapi.texi}, for @command{texi2any}
  14119. Finally, any @command{texi2html} users seeking more detailed
  14120. information can check the draft file @file{doc/texi2oldapi.texi} in
  14121. the Texinfo source repository. It consists mainly of very rough
  14122. notes, but may still be useful to some.
  14123. @node Creating and Installing Info Files
  14124. @chapter Creating and Installing Info Files
  14125. This chapter describes how to create and install Info files.
  14126. @xref{Info Files}, for general information about the file format
  14127. itself.
  14128. @menu
  14129. * Creating an Info File::
  14130. * Installing an Info File::
  14131. @end menu
  14132. @node Creating an Info File
  14133. @section Creating an Info File
  14134. @cindex Creating an Info file
  14135. @cindex Info, creating an online file
  14136. @cindex Formatting a file for Info
  14137. @code{makeinfo} is a program that converts a Texinfo file into an Info
  14138. file, HTML file, or plain text. @code{texinfo-format-region} and
  14139. @code{texinfo-format-buffer} are GNU Emacs functions that convert
  14140. Texinfo to Info.
  14141. For information on installing the Info file in the Info system,
  14142. @pxref{Installing an Info File}.
  14143. @menu
  14144. * @command{makeinfo} Advantages:: @command{makeinfo} provides better error checking.
  14145. * @code{makeinfo} in Emacs:: How to run @code{makeinfo} from Emacs.
  14146. * @code{texinfo-format} commands:: Two Info formatting commands written
  14147. in Emacs Lisp are an alternative
  14148. to @code{makeinfo}.
  14149. * Batch Formatting:: How to format for Info in Emacs batch mode.
  14150. * Tag and Split Files:: How tagged and split files help Info
  14151. to run better.
  14152. @end menu
  14153. @node @command{makeinfo} Advantages
  14154. @subsection @code{makeinfo} Advantages
  14155. @anchor{makeinfo advantages}@c old name
  14156. The @code{makeinfo} utility creates an Info file from a Texinfo source
  14157. providing better error messages than either of the Emacs formatting
  14158. commands. We recommend it. The @code{makeinfo} program is
  14159. independent of Emacs. You can run @code{makeinfo} in any of three
  14160. ways: from an operating system shell, from a shell inside Emacs, or by
  14161. typing the @kbd{C-c C-m C-r} or the @kbd{C-c C-m C-b} command in
  14162. Texinfo mode in Emacs.
  14163. The @code{texinfo-format-region} and the @code{texinfo-format-buffer}
  14164. commands may be useful if you cannot run @code{makeinfo}.
  14165. @node @code{makeinfo} in Emacs
  14166. @subsection Running @code{makeinfo} Within Emacs
  14167. @c anchor{makeinfo in Emacs}@c prev name
  14168. @cindex Running @code{makeinfo} in Emacs
  14169. @cindex @code{makeinfo} inside Emacs
  14170. @cindex Shell, running @code{makeinfo} in
  14171. You can run @code{makeinfo} in GNU Emacs Texinfo mode by using either the
  14172. @code{makeinfo-region} or the @code{makeinfo-buffer} commands. In
  14173. Texinfo mode, the commands are bound to @kbd{C-c C-m C-r} and @kbd{C-c
  14174. C-m C-b} by default.
  14175. @table @kbd
  14176. @item C-c C-m C-r
  14177. @itemx M-x makeinfo-region
  14178. Format the current region for Info.
  14179. @findex makeinfo-region
  14180. @item C-c C-m C-b
  14181. @itemx M-x makeinfo-buffer
  14182. Format the current buffer for Info.
  14183. @findex makeinfo-buffer
  14184. @end table
  14185. When you invoke @code{makeinfo-region} the output goes to a temporary
  14186. buffer. When you invoke @code{makeinfo-buffer} output goes to the
  14187. file set with @code{@@setfilename} (@pxref{@code{@@setfilename}}).
  14188. The Emacs @code{makeinfo-region} and @code{makeinfo-buffer} commands
  14189. run the @code{makeinfo} program in a temporary shell buffer. If
  14190. @code{makeinfo} finds any errors, Emacs displays the error messages in
  14191. the temporary buffer.
  14192. @cindex Errors, parsing
  14193. @cindex Parsing errors
  14194. @findex next-error
  14195. You can parse the error messages by typing @kbd{C-x `}
  14196. (@code{next-error}). This causes Emacs to go to and position the
  14197. cursor on the line in the Texinfo source that @code{makeinfo} thinks
  14198. caused the error. @xref{Compilation, , Running @code{make} or
  14199. Compilers Generally, emacs, The GNU Emacs Manual}, for more
  14200. information about using the @code{next-error} command.
  14201. In addition, you can kill the shell in which the @code{makeinfo}
  14202. command is running or make the shell buffer display its most recent
  14203. output.
  14204. @table @kbd
  14205. @item C-c C-m C-k
  14206. @itemx M-x makeinfo-kill-job
  14207. @findex makeinfo-kill-job
  14208. Kill the current running @code{makeinfo} job
  14209. (from @code{makeinfo-region} or @code{makeinfo-buffer}).
  14210. @item C-c C-m C-l
  14211. @itemx M-x makeinfo-recenter-output-buffer
  14212. @findex makeinfo-recenter-output-buffer
  14213. Redisplay the @code{makeinfo} shell buffer to display its most recent
  14214. output.
  14215. @end table
  14216. @noindent
  14217. (Note that the parallel commands for killing and recentering a @TeX{}
  14218. job are @kbd{C-c C-t C-k} and @kbd{C-c C-t C-l}. @xref{Texinfo Mode
  14219. Printing}.)
  14220. You can specify options for @code{makeinfo} by setting the
  14221. @code{makeinfo-options} variable with either the @kbd{M-x
  14222. customize} or the @kbd{M-x set-variable} command, or by setting the
  14223. variable in your @file{.emacs} initialization file.
  14224. For example, you could write the following in your @file{.emacs} file:
  14225. @example
  14226. @group
  14227. (setq makeinfo-options
  14228. "--paragraph-indent=0 --no-split
  14229. --fill-column=70 --verbose")
  14230. @end group
  14231. @end example
  14232. @noindent
  14233. @c Writing these three cross-references using xref results in
  14234. @c three references to the same named manual, which looks strange.
  14235. @iftex
  14236. For more information, see @ref{@command{makeinfo} Options}, as well as
  14237. ``Easy Customization Interface,'' ``Examining and Setting Variables,''
  14238. and ``Init File'' in @cite{The GNU Emacs Manual}.
  14239. @end iftex
  14240. @ifnottex
  14241. For more information, see@*
  14242. @ref{Easy Customization, , Easy Customization Interface, emacs, The GNU Emacs Manual},@*
  14243. @ref{Examining, , Examining and Setting Variables, emacs, The GNU Emacs Manual},@*
  14244. @ref{Init File, , , emacs, The GNU Emacs Manual}, and@*
  14245. @ref{@command{makeinfo} Options}.
  14246. @end ifnottex
  14247. @node @code{texinfo-format} commands
  14248. @subsection The @code{texinfo-format@dots{}} Commands
  14249. @c anchor{texinfo-format commands}@c prev name
  14250. In GNU Emacs in Texinfo mode, you can format part or all of a Texinfo
  14251. file with the @code{texinfo-format-region} command. This formats the
  14252. current region and displays the formatted text in a temporary buffer
  14253. called @samp{*Info Region*}.
  14254. Similarly, you can format a buffer with the
  14255. @code{texinfo-format-buffer} command. This command creates a new
  14256. buffer and generates the Info file in it. Typing @kbd{C-x C-s} will
  14257. save the Info file under the name specified by the
  14258. @code{@@setfilename} line which must be near the beginning of the
  14259. Texinfo file.
  14260. @table @kbd
  14261. @item C-c C-e C-r
  14262. @itemx @code{texinfo-format-region}
  14263. @findex texinfo-format-region
  14264. Format the current region for Info.
  14265. @item C-c C-e C-b
  14266. @itemx @code{texinfo-format-buffer}
  14267. @findex texinfo-format-buffer
  14268. Format the current buffer for Info.
  14269. @end table
  14270. The @code{texinfo-format-region} and @code{texinfo-format-buffer}
  14271. commands provide you with some error checking, and other functions can
  14272. provide you with further help in finding formatting errors. These
  14273. procedures are described in an appendix; see @ref{Catching Mistakes}.
  14274. However, the @code{makeinfo} program provides better error checking
  14275. (@pxref{@code{makeinfo} in Emacs}).
  14276. A peculiarity of the @code{texinfo-format-buffer} and
  14277. @code{texinfo-format-region} commands is that they do not indent (nor
  14278. fill) paragraphs that contain @code{@@w} or @code{@@*} commands.
  14279. @node Batch Formatting
  14280. @subsection Batch Formatting
  14281. @cindex Batch formatting for Info
  14282. @cindex Info batch formatting
  14283. You can format Texinfo files for Info using @code{batch-texinfo-format}
  14284. and Emacs batch mode. You can run Emacs in batch mode from any shell,
  14285. including a shell inside of Emacs. (@xref{Initial Options,,,
  14286. emacs, The GNU Emacs Manual}.)
  14287. Here is a shell command to format all the files that end in
  14288. @file{.texinfo} in the current directory:
  14289. @example
  14290. emacs -batch -funcall batch-texinfo-format *.texinfo
  14291. @end example
  14292. @noindent
  14293. Emacs processes all the files listed on the command line, even if an
  14294. error occurs while attempting to format some of them.
  14295. Run @code{batch-texinfo-format} only with Emacs in batch mode as shown;
  14296. it is not interactive. It kills the batch mode Emacs on completion.
  14297. @code{batch-texinfo-format} is convenient if you lack @code{makeinfo}
  14298. and want to format several Texinfo files at once. When you use Batch
  14299. mode, you create a new Emacs process. This frees your current Emacs, so
  14300. you can continue working in it. (When you run
  14301. @code{texinfo-format-region} or @code{texinfo-format-buffer}, you cannot
  14302. use that Emacs for anything else until the command finishes.)
  14303. @node Tag and Split Files
  14304. @subsection Tag Files and Split Files
  14305. @cindex Making a tag table automatically
  14306. @cindex Tag table, making automatically
  14307. If a Texinfo file has more than 30,000 bytes,
  14308. @code{texinfo-format-buffer} automatically creates a tag table
  14309. for its Info file; @code{makeinfo} always creates a tag table. With
  14310. a @dfn{tag table}, Info can jump to new nodes more quickly than it can
  14311. otherwise.
  14312. @cindex Indirect subfiles
  14313. In addition, if the Texinfo file contains more than about 300,000
  14314. bytes, @code{texinfo-format-buffer} and @code{makeinfo} split the
  14315. large Info file into shorter @dfn{indirect} subfiles of about 300,000
  14316. bytes each. Big files are split into smaller files so that Emacs does
  14317. not need to make a large buffer to hold the whole of a large Info
  14318. file; instead, Emacs allocates just enough memory for the small, split-off
  14319. file that is needed at the time. This way, Emacs avoids wasting
  14320. memory when you run Info. (Before splitting was implemented, Info
  14321. files were always kept short and @dfn{include files} were designed as
  14322. a way to create a single, large printed manual out of the smaller Info
  14323. files. @xref{Include Files}, for more information. Include files are
  14324. still used for very large documents, such as @cite{The Emacs Lisp
  14325. Reference Manual}, in which each chapter is a separate file.)
  14326. When a file is split, Info itself makes use of a shortened version of
  14327. the original file that contains just the tag table and references to
  14328. the files that were split off. The split-off files are called
  14329. @dfn{indirect} files.
  14330. The split-off files have names that are created by appending @w{@samp{-1}},
  14331. @w{@samp{-2}}, @w{@samp{-3}} and so on to the file name specified by the
  14332. @code{@@setfilename} command. The shortened version of the original file
  14333. continues to have the name specified by @code{@@setfilename}.
  14334. At one stage in writing this document, for example, the Info file was saved
  14335. as the file @file{test-texinfo} and that file looked like this:
  14336. @example
  14337. @group
  14338. Info file: test-texinfo, -*-Text-*-
  14339. produced by texinfo-format-buffer
  14340. from file: new-texinfo-manual.texinfo
  14341. ^_
  14342. Indirect:
  14343. test-texinfo-1: 102
  14344. test-texinfo-2: 50422
  14345. @end group
  14346. @group
  14347. test-texinfo-3: 101300
  14348. ^_^L
  14349. Tag table:
  14350. (Indirect)
  14351. Node: overview^?104
  14352. Node: info file^?1271
  14353. @end group
  14354. @group
  14355. Node: printed manual^?4853
  14356. Node: conventions^?6855
  14357. @dots{}
  14358. @end group
  14359. @end example
  14360. @noindent
  14361. (But @file{test-texinfo} had far more nodes than are shown here.) Each of
  14362. the split-off, indirect files, @file{test-texinfo-1},
  14363. @file{test-texinfo-2}, and @file{test-texinfo-3}, is listed in this file
  14364. after the line that says @samp{Indirect:}. The tag table is listed after
  14365. the line that says @samp{Tag table:}.
  14366. In the list of indirect files, the number following the file name
  14367. records the cumulative number of bytes in the preceding indirect
  14368. files, not counting the file list itself, the tag table, or any
  14369. permissions text in the first file. In the tag table, the number
  14370. following the node name records the location of the beginning of the
  14371. node, in bytes from the beginning of the (unsplit) output.
  14372. If you are using @code{texinfo-format-buffer} to create Info files,
  14373. you may want to run the @code{Info-validate} command. (The
  14374. @code{makeinfo} command does such a good job on its own, you do not
  14375. need @code{Info-validate}.) However, you cannot run the @kbd{M-x
  14376. Info-validate} node-checking command on indirect files. For
  14377. information on how to prevent files from being split and how to
  14378. validate the structure of the nodes, see @ref{Using
  14379. @code{Info-validate}}.
  14380. @node Installing an Info File
  14381. @section Installing an Info File
  14382. @cindex Installing an Info file
  14383. @cindex Info file installation
  14384. @cindex @file{dir} directory for Info installation
  14385. Info files are usually kept in the @file{info} directory. You can
  14386. read Info files using the standalone Info program or the Info reader
  14387. built into Emacs. (@xref{Top,,, info, Info}, for an introduction to
  14388. Info.)
  14389. @menu
  14390. * Directory File:: The top level menu for all Info files.
  14391. * New Info File:: Listing a new Info file.
  14392. * Other Info Directories:: How to specify Info files that are
  14393. located in other directories.
  14394. * Installing Dir Entries:: How to specify what menu entry to add
  14395. to the Info directory.
  14396. * Invoking @command{install-info}:: @code{install-info} options.
  14397. @end menu
  14398. @node Directory File
  14399. @subsection The Directory File @file{dir}
  14400. For Info to work, the @file{info} directory must contain a file that
  14401. serves as a top level directory for the Info system. By convention,
  14402. this file is called @file{dir}. (You can find the location of this file
  14403. within Emacs by typing @kbd{C-h i} to enter Info and then typing
  14404. @kbd{C-x C-f} to see the pathname to the @file{info} directory.)
  14405. The @file{dir} file is itself an Info file. It contains the top level
  14406. menu for all the Info files in the system. The menu looks like
  14407. this:
  14408. @example
  14409. @group
  14410. * Menu:
  14411. * Info: (info). Documentation browsing system.
  14412. * Emacs: (emacs). The extensible, self-documenting
  14413. text editor.
  14414. * Texinfo: (texinfo). With one source file, make
  14415. either a printed manual using
  14416. @@TeX@{@} or an Info file.
  14417. @dots{}
  14418. @end group
  14419. @end example
  14420. Each of these menu entries points to the `Top' node of the Info file
  14421. that is named in parentheses. (The menu entry does not need to
  14422. specify the `Top' node, since Info goes to the `Top' node if no node
  14423. name is mentioned. @xref{Other Info Files, , Nodes in Other Info
  14424. Files}.)
  14425. Thus, the @samp{Info} entry points to the `Top' node of the
  14426. @file{info} file and the @samp{Emacs} entry points to the `Top' node
  14427. of the @file{emacs} file.
  14428. In each of the Info files, the `Up' pointer of the `Top' node refers
  14429. back to the @code{dir} file. For example, the line for the `Top'
  14430. node of the Emacs manual looks like this in Info:
  14431. @example
  14432. File: emacs Node: Top, Up: (DIR), Next: Distrib
  14433. @end example
  14434. @noindent
  14435. In this case, the @file{dir} file name is written in uppercase
  14436. letters---it can be written in either upper- or lowercase. This is not
  14437. true in general, it is a special case for @file{dir}.
  14438. @node New Info File
  14439. @subsection Listing a New Info File
  14440. @cindex Adding a new Info file
  14441. @cindex Listing a new Info file
  14442. @cindex New Info file, listing it in @file{dir} file
  14443. @cindex Info file, listing a new
  14444. @cindex @file{dir} file listing
  14445. To add a new Info file to your system, you must write a menu entry to
  14446. add to the menu in the @file{dir} file in the @file{info} directory.
  14447. For example, if you were adding documentation for GDB, you would write
  14448. the following new entry:
  14449. @example
  14450. * GDB: (gdb). The source-level C debugger.
  14451. @end example
  14452. @noindent
  14453. The first part of the menu entry is the menu entry name, followed by a
  14454. colon. The second part is the name of the Info file, in parentheses,
  14455. followed by a period. The third part is the description.
  14456. The name of an Info file often has a @file{.info} extension. Thus, the
  14457. Info file for GDB might be called either @file{gdb} or @file{gdb.info}.
  14458. The Info reader programs automatically try the file name both with and
  14459. without @file{.info}@footnote{On MS-DOS/MS-Windows systems, Info will
  14460. try the @file{.inf} extension as well.}; so it is better to avoid
  14461. clutter and not to write @samp{.info} explicitly in the menu entry. For
  14462. example, the GDB menu entry should use just @samp{gdb} for the file
  14463. name, not @samp{gdb.info}.
  14464. @node Other Info Directories
  14465. @subsection Info Files in Other Directories
  14466. @cindex Installing Info in another directory
  14467. @cindex Info installed in another directory
  14468. @cindex Another Info directory
  14469. @cindex @file{dir} files and Info directories
  14470. If an Info file is not in the @file{info} directory, there are three
  14471. ways to specify its location:
  14472. @enumerate
  14473. @item
  14474. Write the pathname in the @file{dir} file as the second part of the menu.
  14475. @item
  14476. Specify the Info directory name in the @code{INFOPATH} environment
  14477. variable in your @file{.profile} or @file{.cshrc} initialization file.
  14478. (Only you and others who set this environment variable will be able to
  14479. find Info files whose location is specified this way.)
  14480. @item
  14481. If you are using Emacs, list the name of the file in a second @file{dir}
  14482. file, in its directory; and then add the name of that directory to the
  14483. @code{Info-directory-list} variable in your personal or site
  14484. initialization file.
  14485. This variable tells Emacs where to look for @file{dir} files (the files
  14486. must be named @file{dir}). Emacs merges the files named @file{dir} from
  14487. each of the listed directories. (In Emacs version 18, you can set the
  14488. @code{Info-directory} variable to the name of only one
  14489. directory.)
  14490. @end enumerate
  14491. For example, to reach a test file in the @file{/home/bob/info}
  14492. directory, you could add an entry like this to the menu in the
  14493. standard @file{dir} file:
  14494. @example
  14495. * Test: (/home/bob/info/info-test). Bob's own test file.
  14496. @end example
  14497. @noindent
  14498. In this case, the absolute file name of the @file{info-test} file is
  14499. written as the second part of the menu entry.
  14500. @vindex INFOPATH
  14501. @cindex Environment variable @code{INFOPATH}
  14502. If you don't want to edit the system @file{dir} file, you can tell
  14503. Info where to look by setting the @code{INFOPATH} environment variable
  14504. in your shell startup file. This works with both the Emacs and
  14505. standalone Info readers.
  14506. Specifically, if you use a Bourne-compatible shell such as @code{sh}
  14507. or @code{bash} for your shell command interpreter, you set the
  14508. @code{INFOPATH} environment variable in the @file{.profile}
  14509. initialization file; but if you use @code{csh} or @code{tcsh}, you set
  14510. the variable in the @file{.cshrc} initialization file. On
  14511. MS-DOS/MS-Windows systems, you must set @code{INFOPATH} in your
  14512. @file{autoexec.bat} file or in the registry. Each type of shell uses
  14513. a different syntax.
  14514. @itemize @bullet
  14515. @item
  14516. In a @file{.cshrc} file, you could set the @code{INFOPATH}
  14517. variable as follows:
  14518. @smallexample
  14519. setenv INFOPATH .:~/info:/usr/local/emacs/info
  14520. @end smallexample
  14521. @item
  14522. In a @file{.profile} file, you would achieve the same effect by writing:
  14523. @smallexample
  14524. INFOPATH=.:$HOME/info:/usr/local/emacs/info
  14525. export INFOPATH
  14526. @end smallexample
  14527. @item
  14528. @pindex autoexec.bat
  14529. In a @file{autoexec.bat} file, you write this command (note the
  14530. use of @samp{;} as the directory separator, and a different syntax for
  14531. using values of other environment variables):
  14532. @smallexample
  14533. set INFOPATH=.;%HOME%/info;c:/usr/local/emacs/info
  14534. @end smallexample
  14535. @end itemize
  14536. @noindent
  14537. The @samp{.} indicates the current directory as usual. Emacs uses the
  14538. @code{INFOPATH} environment variable to initialize the value of Emacs's
  14539. own @code{Info-directory-list} variable. The standalone Info reader
  14540. merges any files named @file{dir} in any directory listed in the
  14541. @env{INFOPATH} variable into a single menu presented to you in the node
  14542. called @samp{(dir)Top}.
  14543. @cindex Colon, last in @env{INFOPATH}
  14544. However you set @env{INFOPATH}, if its last character is a colon (on
  14545. MS-DOS/MS-Windows systems, use a semicolon instead), this is replaced
  14546. by the default (compiled-in) path. This gives you a way to augment
  14547. the default path with new directories without having to list all the
  14548. standard places. For example (using @code{sh} syntax):
  14549. @example
  14550. INFOPATH=/home/bob/info:
  14551. export INFOPATH
  14552. @end example
  14553. @noindent
  14554. will search @file{/home/bob/info} first, then the standard directories.
  14555. Leading or doubled colons are not treated specially.
  14556. @cindex @file{dir} file, creating your own
  14557. When you create your own @file{dir} file for use with
  14558. @code{Info-directory-list} or @env{INFOPATH}, it's easiest to start by
  14559. copying an existing @file{dir} file and replace all the text after the
  14560. @samp{* Menu:} with your desired entries. That way, the punctuation
  14561. and special @kbd{CTRL-_} characters that Info needs will be present.
  14562. As one final alternative, which works only with Emacs Info, you can
  14563. change the @code{Info-directory-list} variable. For example:
  14564. @example
  14565. (add-hook 'Info-mode-hook '(lambda ()
  14566. (add-to-list 'Info-directory-list
  14567. (expand-file-name "~/info"))))
  14568. @end example
  14569. @node Installing Dir Entries
  14570. @subsection Installing Info Directory Files
  14571. When you install an Info file onto your system, you can use the program
  14572. @code{install-info} to update the Info directory file @file{dir}.
  14573. Normally the makefile for the package runs @code{install-info}, just
  14574. after copying the Info file into its proper installed location.
  14575. @findex dircategory
  14576. @findex direntry
  14577. In order for the Info file to work with @code{install-info}, you include
  14578. the commands @code{@@dircategory} and
  14579. @code{@@direntry}@dots{}@code{@@end direntry} in the Texinfo source
  14580. file. Use @code{@@direntry} to specify the menu entries to add to the
  14581. Info directory file, and use @code{@@dircategory} to specify which part
  14582. of the Info directory to put it in. Here is how these commands are used
  14583. in this manual:
  14584. @smallexample
  14585. @@dircategory Texinfo documentation system
  14586. @@direntry
  14587. * Texinfo: (texinfo). The GNU documentation format.
  14588. * install-info: (texinfo)Invoking install-info. @dots{}
  14589. @dots{}
  14590. @@end direntry
  14591. @end smallexample
  14592. Here's what this produces in the Info file:
  14593. @smallexample
  14594. INFO-DIR-SECTION Texinfo documentation system
  14595. START-INFO-DIR-ENTRY
  14596. * Texinfo: (texinfo). The GNU documentation format.
  14597. * install-info: (texinfo)Invoking install-info. @dots{}
  14598. @dots{}
  14599. END-INFO-DIR-ENTRY
  14600. @end smallexample
  14601. @noindent
  14602. The @code{install-info} program sees these lines in the Info file, and
  14603. that is how it knows what to do.
  14604. Always use the @code{@@direntry} and @code{@@dircategory} commands near
  14605. the beginning of the Texinfo input, before the first @code{@@node}
  14606. command. If you use them later on in the input, @code{install-info}
  14607. will not notice them.
  14608. @code{install-info} will automatically reformat the description of the
  14609. menu entries it is adding. As a matter of convention, the description
  14610. of the main entry (above, @samp{The GNU documentation format}) should
  14611. start at column 32, starting at zero (as in
  14612. @code{what-cursor-position} in Emacs). This will make it align with
  14613. most others. Description for individual utilities best start in
  14614. column 48, where possible. For more information about formatting see
  14615. the @samp{--calign}, @samp{--align}, and @samp{--max-width} options in
  14616. @ref{Invoking @command{install-info}}.
  14617. If you use @code{@@dircategory} more than once in the Texinfo source,
  14618. each usage specifies the `current' category; any subsequent
  14619. @code{@@direntry} commands will add to that category.
  14620. @cindex Free Software Directory
  14621. @cindex Dir categories, choosing
  14622. @cindex Categories, choosing
  14623. When choosing a category name for the @code{@@dircategory} command, we
  14624. recommend consulting the @uref{http://www.gnu.org/directory,
  14625. Free Software Directory}. If your program is not listed there,
  14626. or listed incorrectly or incompletely, please report the situation to
  14627. the directory maintainers (@url{http://directory.fsf.org}) so that the
  14628. category names can be kept in sync.
  14629. Here are a few examples (see the @file{util/dir-example} file in the
  14630. Texinfo distribution for large sample @code{dir} file):
  14631. @display
  14632. Emacs
  14633. Localization
  14634. Printing
  14635. Software development
  14636. Software libraries
  14637. Text creation and manipulation
  14638. @end display
  14639. @cindex Invoking nodes, including in dir file
  14640. Each `Invoking' node for every program installed should have a
  14641. corresponding @code{@@direntry}. This lets users easily find the
  14642. documentation for the different programs they can run, as with the
  14643. traditional @command{man} system.
  14644. @node Invoking @command{install-info}
  14645. @subsection Invoking @command{install-info}
  14646. @pindex install-info
  14647. @code{install-info} inserts menu entries from an Info file into the
  14648. top-level @file{dir} file in the Info system (see the previous sections
  14649. for an explanation of how the @file{dir} file works). @code{install-info}
  14650. also removes menu entries from the @file{dir} file. It's most often
  14651. run as part of software installation, or when constructing a @file{dir} file
  14652. for all manuals on a system. Synopsis:
  14653. @example
  14654. install-info [@var{option}@dots{}] [@var{info-file} [@var{dir-file}]]
  14655. @end example
  14656. If @var{info-file} or @var{dir-file} are not specified, the options
  14657. (described below) that define them must be. There are no compile-time
  14658. defaults, and standard input is never used. @code{install-info} can
  14659. read only one Info file and write only one @file{dir} file per invocation.
  14660. @cindex @file{dir}, created by @code{install-info}
  14661. If @var{dir-file} (however specified) does not exist,
  14662. @code{install-info} creates it if possible (with no entries).
  14663. @cindex Compressed dir files, reading
  14664. @cindex XZ-compressed dir files, reading
  14665. @cindex Bzipped dir files, reading
  14666. @cindex Lzip-compressed dir files, reading
  14667. @cindex LZMA-compressed dir files, reading
  14668. @cindex Dir files, compressed
  14669. If any input file is compressed with @code{gzip} (@pxref{Top,,, gzip,
  14670. Gzip}), @code{install-info} automatically uncompresses it for reading.
  14671. And if @var{dir-file} is compressed, @code{install-info} also
  14672. automatically leaves it compressed after writing any changes. If
  14673. @var{dir-file} itself does not exist, @code{install-info} tries to
  14674. open @file{@var{dir-file}.gz}, @file{@var{dir-file}.xz},
  14675. @file{@var{dir-file}.bz2}, @file{@var{dir-file}.lz}, and
  14676. @file{@var{dir-file}.lzma}, in that order.
  14677. Options:
  14678. @table @code
  14679. @item --add-once
  14680. @opindex --add-once@r{, for @command{install-info}}
  14681. Specifies that the entry or entries will only be put into a single section.
  14682. @item --align=@var{column}
  14683. @opindex --align=@var{column}@r{, for @command{install-info}}
  14684. Specifies the column that the second and subsequent lines of menu entry's
  14685. description will be formatted to begin at. The default for this option is
  14686. @samp{35}. It is used in conjunction with the @samp{--max-width} option.
  14687. @var{column} starts counting at 1.
  14688. @item --append-new-sections
  14689. @opindex --append-new-sections@r{, for @command{install-info}}
  14690. Instead of alphabetizing new sections, place them at the end of the DIR file.
  14691. @item --calign=@var{column}
  14692. @opindex --calign=@var{column}@r{, for @command{install-info}}
  14693. Specifies the column that the first line of menu entry's description will
  14694. be formatted to begin at. The default for this option is @samp{33}. It is
  14695. used in conjunction with the @samp{--max-width} option.
  14696. When the name of the menu entry exceeds this column, entry's description
  14697. will start on the following line.
  14698. @var{column} starts counting at 1.
  14699. @item --debug
  14700. @opindex --debug@r{, for @command{install-info}}
  14701. Report what is being done.
  14702. @item --delete
  14703. @opindex --delete@r{, for @command{install-info}}
  14704. Delete the entries in @var{info-file} from @var{dir-file}. The file
  14705. name in the entry in @var{dir-file} must be @var{info-file} (except for
  14706. an optional @samp{.info} in either one). Don't insert any new entries.
  14707. Any empty sections that result from the removal are also removed.
  14708. @item --description=@var{text}
  14709. @opindex --description=@var{text}@r{, for @command{install-info}}
  14710. Specify the explanatory portion of the menu entry. If you don't specify
  14711. a description (either via @samp{--entry}, @samp{--item} or this option),
  14712. the description is taken from the Info file itself.
  14713. @item --dir-file=@var{name}
  14714. @opindex --dir-file=@var{name}@r{, for @command{install-info}}
  14715. Specify file name of the Info directory file. This is equivalent to
  14716. using the @var{dir-file} argument.
  14717. @item --dry-run
  14718. @opindex --dry-run@r{, for @command{install-info}}
  14719. Same as @samp{--test}.
  14720. @item --entry=@var{text}
  14721. @opindex --entry=@var{text}@r{, for @command{install-info}}
  14722. Insert @var{text} as an Info directory entry; @var{text} should have the
  14723. form of an Info menu item line plus zero or more extra lines starting
  14724. with whitespace. If you specify more than one entry, they are all
  14725. added. If you don't specify any entries, they are determined from
  14726. information in the Info file itself.
  14727. @item --help
  14728. @opindex --help@r{, for @command{texindex}}
  14729. Display a usage message with basic usage and all available options,
  14730. then exit successfully.
  14731. @item --info-file=@var{file}
  14732. @opindex --info-file=@var{file}@r{, for @command{install-info}}
  14733. Specify Info file to install in the directory. This is
  14734. equivalent to using the @var{info-file} argument.
  14735. @item --info-dir=@var{dir}
  14736. @opindex --info-dir=@var{dir}@r{, for @command{install-info}}
  14737. Specify the directory where the directory file @file{dir} resides.
  14738. Equivalent to @samp{--dir-file=@var{dir}/dir}.
  14739. @item --infodir=@var{dir}
  14740. @opindex --infodir=@var{dir}@r{, for @command{install-info}}
  14741. Same as @samp{--info-dir}.
  14742. @item --item=@var{text}
  14743. @opindex --item=@var{text}@r{, for @command{install-info}}
  14744. Same as @samp{--entry=@var{text}}. An Info directory entry is actually
  14745. a menu item.
  14746. @item --keep-old
  14747. @opindex --keep-old@r{, for @command{install-info}}
  14748. Do not replace pre-existing menu entries. When @samp{--remove} is specified,
  14749. this option means that empty sections are not removed.
  14750. @item --max-width=@var{column}
  14751. @opindex --max-width=@var{column}@r{, for @command{install-info}}
  14752. Specifies the column that the menu entry's description will be word-wrapped
  14753. at. @var{column} starts counting at 1.
  14754. @item --maxwidth=@var{column}
  14755. @opindex --maxwidth=@var{column}@r{, for @command{install-info}}
  14756. Same as @samp{--max-width}.
  14757. @item --menuentry=@var{text}
  14758. @opindex --menuentry=@var{text}@r{, for @command{install-info}}
  14759. Same as @samp{--name}.
  14760. @item --name=@var{text}
  14761. @opindex --name=@var{text}@r{, for @command{install-info}}
  14762. Specify the name portion of the menu entry. If the @var{text} does
  14763. not start with an asterisk @samp{*}, it is presumed to be the text
  14764. after the @samp{*} and before the parentheses that specify the Info
  14765. file. Otherwise @var{text} is taken verbatim, and is taken as
  14766. defining the text up to and including the first period (a space is
  14767. appended if necessary). If you don't specify the name (either via
  14768. @samp{--entry}, @samp{--item} or this option), it is taken from the
  14769. Info file itself. If the Info does not contain the name, the basename
  14770. of the Info file is used.
  14771. @item --no-indent
  14772. @opindex --no-indent@r{, for @command{install-info}}
  14773. Suppress formatting of new entries into the @file{dir} file.
  14774. @item --quiet
  14775. @itemx --silent
  14776. @opindex --quiet@r{, for @command{install-info}}
  14777. @opindex --silent@r{, for @command{install-info}}
  14778. Suppress warnings, etc., for silent operation.
  14779. @item --remove
  14780. @opindex --remove@r{, for @command{install-info}}
  14781. Same as @samp{--delete}.
  14782. @item --remove-exactly
  14783. @opindex --remove-exactly@r{, for @command{install-info}}
  14784. Also like @samp{--delete}, but only entries if the Info file name
  14785. matches exactly; @code{.info} and/or @code{.gz} suffixes are
  14786. @emph{not} ignored.
  14787. @item --section=@var{sec}
  14788. @opindex --section=@var{sec}@r{, for @command{install-info}}
  14789. Put this file's entries in section @var{sec} of the directory. If you
  14790. specify more than one section, all the entries are added in each of the
  14791. sections. If you don't specify any sections, they are determined from
  14792. information in the Info file itself. If the Info file doesn't specify
  14793. a section, the menu entries are put into the Miscellaneous section.
  14794. @item --section @var{regex} @var{sec}
  14795. @opindex --section @var{regex} @var{sec}@r{, for @command{install-info}}
  14796. Same as @samp{--regex=@var{regex} --section=@var{sec} --add-once}.
  14797. @code{install-info} tries to detect when this alternate syntax is used,
  14798. but does not always guess correctly. Here is the heuristic that
  14799. @code{install-info} uses:
  14800. @enumerate
  14801. @item
  14802. If the second argument to @code{--section} starts with a hyphen, the
  14803. original syntax is presumed.
  14804. @item
  14805. If the second argument to @code{--section} is a file that can be
  14806. opened, the original syntax is presumed.
  14807. @item
  14808. Otherwise the alternate syntax is used.
  14809. @end enumerate
  14810. When the heuristic fails because your section title starts with a
  14811. hyphen, or it happens to be a filename that can be opened, the syntax
  14812. should be changed to @samp{--regex=@var{regex} --section=@var{sec}
  14813. --add-once}.
  14814. @item --regex=@var{regex}
  14815. @opindex --regex=@var{regex}@r{, for @command{install-info}}
  14816. Put this file's entries into any section that matches @var{regex}. If
  14817. more than one section matches, all of the entries are added in each of the
  14818. sections. Specify @var{regex} using basic regular expression syntax, more
  14819. or less as used with @command{grep}, for example.
  14820. @item --test
  14821. @opindex --test@r{, for @command{install-info}}
  14822. Suppress updating of the directory file.
  14823. @item --version
  14824. @opindex --version@r{, for @command{install-info}}
  14825. @cindex Version number, for install-info
  14826. Display version information and exit successfully.
  14827. @end table
  14828. @node Generating HTML
  14829. @chapter Generating HTML
  14830. @cindex Generating HTML
  14831. @cindex Outputting HTML
  14832. @command{makeinfo} generates Info output by default, but given the
  14833. @option{--html} option, it will generate HTML, for web browsers and
  14834. other programs. This chapter gives some details on such HTML output.
  14835. @command{makeinfo} has many user-definable customization variables
  14836. with which you can influence the HTML output. @xref{Customization
  14837. Variables}.
  14838. @command{makeinfo} can also produce output in XML and Docbook formats,
  14839. but we do not as yet describe these in detail. @xref{Output Formats},
  14840. for a brief overview of all the output formats.
  14841. @menu
  14842. * HTML Translation:: Details of the HTML output.
  14843. * HTML Splitting:: How HTML output is split.
  14844. * HTML CSS:: Influencing HTML output with Cascading Style Sheets.
  14845. * HTML Xref:: Cross-references in HTML output.
  14846. @end menu
  14847. @node HTML Translation
  14848. @section HTML Translation
  14849. @cindex HTML translation
  14850. @cindex HTML output, browser compatibility of
  14851. First, the HTML generated by @command{makeinfo} is standard
  14852. HTML@tie{}4. It also tries to be compatible with earlier standards
  14853. (e.g., HTML@tie{}2.0, RFC-1866). Thus, please report output from an
  14854. error-free run of @code{makeinfo} which has practical browser
  14855. portability problems as a bug (@pxref{Reporting Bugs}).
  14856. @pindex html32.pm
  14857. Some known exceptions to HTML@tie{}3.2 (using
  14858. @samp{--init-file=html32.pm} produces strict HTML@tie{}3.2 output;
  14859. @pxref{Invoking @command{texi2any}}):
  14860. @enumerate
  14861. @item
  14862. HTML@tie{}3.2 tables are generated for the @code{@@multitable} command
  14863. (@pxref{Multi-column Tables}), but they should degrade reasonably in
  14864. browsers without table support.
  14865. @item
  14866. The HTML@tie{}4 @samp{lang} attribute on the @samp{<html>} attribute
  14867. is used.
  14868. @item
  14869. Entities that are not in the HTML@tie{}3.2 standard are also used.
  14870. @item
  14871. CSS is used (@pxref{HTML CSS}).
  14872. @item
  14873. A few HTML@tie{}4 elements are used: @code{thead}, @code{abbr},
  14874. @code{acronym}.
  14875. @end enumerate
  14876. To achieve maximum portability and accessibility among browsers (both
  14877. graphical and text-based), systems, and users, the HTML output is
  14878. intentionally quite plain and generic. It has always been our goal
  14879. for users to be able to customize the output to their wishes via CSS
  14880. (@pxref{HTML CSS}) or other means (@pxref{Customization Variables}).
  14881. If you cannot accomplish a reasonable customization, feel free to
  14882. report that.
  14883. However, we do not wish to depart from our basic goal of widest
  14884. readability for the core output. For example, using fancy CSS may
  14885. make it possible for the HTML output to more closely resemble the
  14886. @TeX{} output in some details, but this result is not even close to
  14887. being worth the ensuing difficulties.
  14888. It is also intentionally not our goal, and not even possible, to pass
  14889. through every conceivable validation test without any diagnostics.
  14890. Different validation tests have different goals, often about pedantic
  14891. enforcement of some standard or another. Our overriding goal is to
  14892. help users, not blindly comply with standards.
  14893. To repeat what was said at the top: please report output from an
  14894. error-free run of @code{makeinfo} which has @emph{practical} browser
  14895. portability problems as a bug (@pxref{Reporting Bugs}).
  14896. A few other general points about the HTML output follow.
  14897. @cindex Navigation bar, in HTML output
  14898. @strong{Navigation bar:} By default, a navigation bar is inserted at the
  14899. start of each node, analogous to Info output. If the
  14900. @samp{--no-headers} option is used, the navigation bar is only
  14901. inserted at the beginning of split files. Header @code{<link>}
  14902. elements in split output can support Info-like navigation with
  14903. browsers like Lynx and @w{Emacs W3} which implement this HTML@tie{}1.0
  14904. feature.
  14905. @cindex Footnote styles, in HTML
  14906. @strong{Footnotes:} for HTML, when the footnote style is @samp{end},
  14907. or if the output is not split, footnotes are put at the end of the
  14908. output. If the footnoet style is set to @samp{separate}, and the
  14909. output is split, they are placed in a separate file. @xref{Footnote
  14910. Styles}.
  14911. @cindex Escaping to HTML
  14912. @cindex Raw HTML
  14913. @strong{Raw HTML}: @command{makeinfo} will include segments of Texinfo
  14914. source between @code{@@ifhtml} and @code{@@end ifhtml} in the HTML
  14915. output (but not any of the other conditionals, by default). Source
  14916. between @code{@@html} and @code{@@end html} is passed without change
  14917. to the output (i.e., suppressing the normal escaping of input
  14918. @samp{<}, @samp{>} and @samp{&} characters which have special
  14919. significance in HTML)@. @xref{Conditional Commands}.
  14920. @node HTML Splitting
  14921. @section HTML Splitting
  14922. @cindex Split HTML output
  14923. @cindex HTML output, split
  14924. When splitting output at nodes (which is the default),
  14925. @command{makeinfo} writes HTML output into (basically) one output file
  14926. per Texinfo source @code{@@node}.
  14927. Each output file name is the node name with spaces replaced by
  14928. @samp{-}'s and special characters changed to @samp{_} followed by
  14929. their code point in hex (@pxref{HTML Xref}). This is to make it
  14930. portable and easy to use as a filename. In the unusual case of two
  14931. different nodes having the same name after this treatment, they are
  14932. written consecutively to the same file, with HTML anchors so each can
  14933. be referred to independently.
  14934. If @command{makeinfo} is run on a system which does not distinguish
  14935. case in file names, nodes which are the same except for case (e.g.,
  14936. @samp{index} and @samp{Index}) will also be folded into the same
  14937. output file with anchors. You can also pretend to be on a case
  14938. insensitive filesystem by setting the customization variable
  14939. @code{CASE_INSENSITIVE_FILENAMES}.
  14940. It is also possible to split at chapters or sections with
  14941. @option{--split} (@pxref{Invoking @command{texi2any}}). In that case,
  14942. the file names are constructed after the name of the node associated
  14943. with the relevant sectioning command. Also, unless
  14944. @option{--no-node-files} is specified, a redirection file is output
  14945. for every node in order to more reliably support cross-references to
  14946. that manual (@pxref{HTML Xref}).
  14947. When splitting, the HTML output files are written into a subdirectory,
  14948. with the name chosen as follows:
  14949. @enumerate
  14950. @item
  14951. @command{makeinfo} first tries the subdirectory with the base name
  14952. from @code{@@setfilename} (that is, any extension is removed). For
  14953. example, HTML output for @code{@@setfilename gcc.info} would be
  14954. written into a subdirectory named @samp{gcc/}.
  14955. @item
  14956. If that directory cannot be created for any reason, then
  14957. @command{makeinfo} tries appending @samp{.html} to the directory name.
  14958. For example, output for @code{@@setfilename texinfo} would be written
  14959. to @samp{texinfo.html/}.
  14960. @item
  14961. If the @samp{@var{name}.html} directory can't be created either,
  14962. @code{makeinfo} gives up.
  14963. @end enumerate
  14964. @noindent In any case, the top-level output file within the directory
  14965. is always named @samp{index.html}.
  14966. Monolithic output (@code{--no-split}) is named according to
  14967. @code{@@setfilename} (with any @samp{.info} extension is replaced with
  14968. @samp{.html}), @code{--output} (the argument is used literally), or
  14969. based on the input file name as a last resort
  14970. (@pxref{@code{@@setfilename}}).
  14971. @node HTML CSS
  14972. @section HTML CSS
  14973. @cindex HTML, and CSS
  14974. @cindex CSS, and HTML output
  14975. @cindex Cascading Style Sheets, and HTML output
  14976. Cascading Style Sheets (CSS for short) is an Internet standard for
  14977. influencing the display of HTML documents: see
  14978. @uref{http://www.w3.org/Style/CSS/}.
  14979. By default, @command{makeinfo} includes a few simple CSS commands to
  14980. better implement the appearance of some Texinfo environments. Here
  14981. are two of them, as an example:
  14982. @example
  14983. pre.display @{ font-family:inherit @}
  14984. pre.smalldisplay @{ font-family:inherit; font-size:smaller @}
  14985. @end example
  14986. A full explanation of CSS is (far) beyond this manual; please see the
  14987. reference above. In brief, however, the above tells the web browser
  14988. to use a `smaller' font size for @code{@@smalldisplay} text, and to
  14989. use the same font as the main document for both @code{@@smalldisplay}
  14990. and @code{@@display}. By default, the HTML @samp{<pre>} command uses
  14991. a monospaced font.
  14992. You can influence the CSS in the HTML output with two
  14993. @command{makeinfo} options: @option{--css-include=@var{file}} and
  14994. @option{--css-ref=@var{url}}.
  14995. @pindex texinfo-bright-colors.css
  14996. @cindex Visualizing Texinfo CSS
  14997. The option @option{--css-ref=@var{url}} adds to each output HTML file
  14998. a @samp{<link>} tag referencing a CSS at the given @var{url}. This
  14999. allows using external style sheets. You may find the file
  15000. @file{texi2html/examples/texinfo-bright-colors.css} useful for
  15001. visualizing the CSS elements in Texinfo output.
  15002. The option @option{--css-include=@var{file}} includes the contents
  15003. @var{file} in the HTML output, as you might expect. However, the
  15004. details are somewhat tricky, as described in the following, to provide
  15005. maximum flexibility.
  15006. @cindex @samp{@@import} specifications, in CSS files
  15007. The CSS file may begin with so-called @samp{@@import} directives,
  15008. which link to external CSS specifications for browsers to use when
  15009. interpreting the document. Again, a full description is beyond our
  15010. scope here, but we'll describe how they work syntactically, so we can
  15011. explain how @command{makeinfo} handles them.
  15012. @cindex Comments, in CSS files
  15013. There can be more than one @samp{@@import}, but they have to come
  15014. first in the file, with only whitespace and comments interspersed, no
  15015. normal definitions. (Technical exception: a @samp{@@charset}
  15016. directive may precede the @samp{@@import}'s. This does not alter
  15017. @command{makeinfo}'s behavior, it just copies the @samp{@@charset} if
  15018. present.) Comments in CSS files are delimited by @samp{/* ... */}, as
  15019. in C@. An @samp{@@import} directive must be in one of these two forms:
  15020. @example
  15021. @@import url(http://example.org/foo.css);
  15022. @@import "http://example.net/bar.css";
  15023. @end example
  15024. As far as @command{makeinfo} is concerned, the crucial characters are
  15025. the @samp{@@} at the beginning and the semicolon terminating the
  15026. directive. When reading the CSS file, it simply copies any such
  15027. @samp{@@}-directive into the output, as follows:
  15028. @itemize
  15029. @item If @var{file} contains only normal CSS declarations, it is
  15030. included after @command{makeinfo}'s default CSS, thus overriding it.
  15031. @item If @var{file} begins with @samp{@@import} specifications (see
  15032. below), then the @samp{import}'s are included first (they have to come
  15033. first, according to the standard), and then @command{makeinfo}'s
  15034. default CSS is included. If you need to override @command{makeinfo}'s
  15035. defaults from an @samp{@@import}, you can do so with the @samp{!@:
  15036. important} CSS construct, as in:
  15037. @example
  15038. pre.smallexample @{ font-size: inherit ! important @}
  15039. @end example
  15040. @item If @var{file} contains both @samp{@@import} and inline CSS
  15041. specifications, the @samp{@@import}'s are included first, then
  15042. @command{makeinfo}'s defaults, and lastly the inline CSS from
  15043. @var{file}.
  15044. @item Any @@-directive other than @samp{@@import} and @samp{@@charset}
  15045. is treated as a CSS declaration, meaning @command{makeinfo} includes
  15046. its default CSS and then the rest of the file.
  15047. @end itemize
  15048. If the CSS file is malformed or erroneous, @command{makeinfo}'s output
  15049. is unspecified. @command{makeinfo} does not try to interpret the
  15050. meaning of the CSS file in any way; it just looks for the special
  15051. @samp{@@} and @samp{;} characters and blindly copies the text into the
  15052. output. Comments in the CSS file may or may not be included in the
  15053. output.
  15054. In addition to the possibilities offered by CSS, @command{makeinfo}
  15055. has many user-definable customization variables with which you can
  15056. influence the HTML output. @xref{Customization Variables}.
  15057. @node HTML Xref
  15058. @section HTML Cross-references
  15059. @cindex HTML cross-references
  15060. @cindex Cross-references, in HTML output
  15061. Cross-references between Texinfo manuals in HTML format become, in the
  15062. end, a standard HTML @code{<a>} link, but the details are
  15063. unfortunately complex. This section describes the algorithm used in
  15064. detail, so that Texinfo can cooperate with other programs, such as
  15065. @command{texi2html}, by writing mutually compatible HTML files.
  15066. This algorithm may or may not be used for links @emph{within} HTML
  15067. output for a Texinfo file. Since no issues of compatibility arise in
  15068. such cases, we do not need to specify this.
  15069. We try to support references to such ``external'' manuals in both
  15070. monolithic and split forms. A @dfn{monolithic} (mono) manual is
  15071. entirely contained in one file, and a @dfn{split} manual has a file
  15072. for each node. (@xref{HTML Splitting}.)
  15073. @cindex Dumas, Patrice
  15074. The algorithm was primarily devised by Patrice Dumas in 2003--04.
  15075. @menu
  15076. * Link Basics: HTML Xref Link Basics.
  15077. * Node Expansion: HTML Xref Node Name Expansion.
  15078. * Command Expansion: HTML Xref Command Expansion.
  15079. * 8-bit Expansion: HTML Xref 8-bit Character Expansion.
  15080. * Mismatch: HTML Xref Mismatch.
  15081. * Configuration: HTML Xref Configuration. htmlxref.cnf.
  15082. * Preserving links: HTML Xref Link Preservation. MANUAL-noderename.cnf.
  15083. @end menu
  15084. @node HTML Xref Link Basics
  15085. @subsection HTML Cross-reference Link Basics
  15086. @cindex HTML cross-reference link basics
  15087. For our purposes, an HTML link consists of four components: a host
  15088. name, a directory part, a file part, and a target part. We
  15089. always assume the @code{http} protocol. For example:
  15090. @example
  15091. http://@var{host}/@var{dir}/@var{file}.html#@var{target}
  15092. @end example
  15093. The information to construct a link comes from the node name and
  15094. manual name in the cross-reference command in the Texinfo source
  15095. (@pxref{Cross References}), and from @dfn{external information}
  15096. (@pxref{HTML Xref Configuration}).
  15097. We now consider each part in turn.
  15098. The @var{host} is hardwired to be the local host. This could either
  15099. be the literal string @samp{localhost}, or, according to the rules for
  15100. HTML links, the @samp{http://localhost/} could be omitted entirely.
  15101. The @var{dir} and @var{file} parts are more complicated, and depend on
  15102. the relative split/mono nature of both the manual being processed and
  15103. the manual that the cross-reference refers to. The underlying idea is
  15104. that there is one directory for Texinfo manuals in HTML, and a given
  15105. @var{manual} is either available as a monolithic file
  15106. @file{@var{manual}.html}, or a split subdirectory
  15107. @file{@var{manual}/*.html}. Here are the cases:
  15108. @itemize @bullet
  15109. @item
  15110. If the present manual is split, and the referent manual is also split,
  15111. the directory is @samp{../@var{referent/}} and the file is the
  15112. expanded node name (described later).
  15113. @item
  15114. If the present manual is split, and the referent manual is mono, the
  15115. directory is @samp{../} and the file is @file{@var{referent}.html}.
  15116. @item
  15117. If the present manual is mono, and the referent manual is split, the
  15118. directory is @file{@var{referent}/} and the file is the expanded node
  15119. name.
  15120. @item
  15121. If the present manual is mono, and the referent manual is also mono,
  15122. the directory is @file{./} (or just the empty string), and the file is
  15123. @file{@var{referent}.html}.
  15124. @end itemize
  15125. @vindex BASEFILENAME_LENGTH
  15126. Another rule, that only holds for filenames, is that base filenames
  15127. are truncated to 245 characters, to allow for an extension to be
  15128. appended and still comply with the 255-character limit which is common
  15129. to many filesystems. Although technically this can be changed with
  15130. the @code{BASEFILENAME_LENGTH} customization variable (@pxref{Other
  15131. Customization Variables}), doing so would make cross-manual references
  15132. to such nodes invalid.
  15133. Any directory part in the filename argument of the source cross
  15134. reference command is ignored. Thus, @code{@@xref@{,,,../foo@}} and
  15135. @code{@@xref@{,,,foo@}} both use @samp{foo} as the manual name. This
  15136. is because any such attempted hardwiring of the directory is very
  15137. unlikely to be useful for both Info and HTML output.
  15138. Finally, the @var{target} part is always the expanded node name.
  15139. Whether the present manual is split or mono is determined by user
  15140. option; @command{makeinfo} defaults to split, with the
  15141. @option{--no-split} option overriding this.
  15142. Whether the referent manual is split or mono, however, is another bit
  15143. of the external information (@pxref{HTML Xref Configuration}). By
  15144. default, @command{makeinfo} uses the same form of the referent manual
  15145. as the present manual.
  15146. Thus, there can be a mismatch between the format of the referent
  15147. manual that the generating software assumes, and the format it's
  15148. actually present in. @xref{HTML Xref Mismatch}.
  15149. @node HTML Xref Node Name Expansion
  15150. @subsection HTML Cross-reference Node Name Expansion
  15151. @cindex HTML cross-reference node name expansion
  15152. @cindex node name expansion, in HTML cross-references
  15153. @cindex expansion, of node names in HTML cross-references
  15154. As mentioned in the previous section, the key part of the HTML cross
  15155. reference algorithm is the conversion of node names in the Texinfo
  15156. source into strings suitable for XHTML identifiers and filenames. The
  15157. restrictions are similar for each: plain ASCII letters, numbers, and
  15158. the @samp{-} and @samp{_} characters are all that can be used.
  15159. (Although HTML anchors can contain most characters, XHTML is more
  15160. restrictive.)
  15161. Cross-references in Texinfo can refer either to nodes or anchors
  15162. (@pxref{@code{@@anchor}}). However, anchors are treated identically
  15163. to nodes in this context, so we'll continue to say ``node'' names for
  15164. simplicity.
  15165. A special exception: the Top node (@pxref{The Top Node}) is always
  15166. mapped to the file @file{index.html}, to match web server software.
  15167. However, the HTML @emph{target} is @samp{Top}. Thus (in the split case):
  15168. @example
  15169. @@xref@{Top,,, emacs, The GNU Emacs Manual@}.
  15170. @result{} <a href="emacs/index.html#Top">
  15171. @end example
  15172. @enumerate
  15173. @item
  15174. The standard ASCII letters (a-z and A-Z) are not modified. All other
  15175. characters may be changed as specified below.
  15176. @item
  15177. The standard ASCII numbers (0-9) are not modified except when a number
  15178. is the first character of the node name. In that case, see below.
  15179. @item
  15180. Multiple consecutive space, tab and newline characters are transformed
  15181. into just one space. (It's not possible to have newlines in node
  15182. names with the current implementation, but we specify it anyway, just
  15183. in case.)
  15184. @item
  15185. Leading and trailing spaces are removed.
  15186. @item
  15187. After the above has been applied, each remaining space character is
  15188. converted into a @samp{-} character.
  15189. @item
  15190. Other ASCII 7-bit characters are transformed into @samp{_00@var{xx}},
  15191. where @var{xx} is the ASCII character code in (lowercase) hexadecimal.
  15192. This includes @samp{_}, which is mapped to @samp{_005f}.
  15193. @item
  15194. If the node name does not begin with a letter, the literal string
  15195. @samp{g_t} is prefixed to the result. (Due to the rules above, that
  15196. string can never occur otherwise; it is an arbitrary choice, standing
  15197. for ``GNU Texinfo''.) This is necessary because XHTML requires that
  15198. identifiers begin with a letter.
  15199. @end enumerate
  15200. For example:
  15201. @example
  15202. @@node A node --- with _'%
  15203. @result{} A-node-_002d_002d_002d-with-_005f_0027_0025
  15204. @end example
  15205. Example translations of common characters:
  15206. @itemize @bullet
  15207. @item @samp{_} @result{} @samp{_005f}
  15208. @item @samp{-} @result{} @samp{_002d}
  15209. @item @samp{A node} @result{} @samp{A-node}
  15210. @end itemize
  15211. On case-folding computer systems, nodes differing only by case will be
  15212. mapped to the same file. In particular, as mentioned above, Top
  15213. always maps to the file @file{index.html}. Thus, on a case-folding
  15214. system, Top and a node named `Index' will both be written to
  15215. @file{index.html}. Fortunately, the targets serve to distinguish
  15216. these cases, since HTML target names are always case-sensitive,
  15217. independent of operating system.
  15218. @node HTML Xref Command Expansion
  15219. @subsection HTML Cross-reference Command Expansion
  15220. @cindex HTML cross-reference command expansion
  15221. Node names may contain @@-commands (@pxref{Node Line Requirements}).
  15222. This section describes how they are handled.
  15223. First, comments are removed.
  15224. Next, any @code{@@value} commands (@pxref{@code{@@set @@value}}) and
  15225. macro invocations (@pxref{Invoking Macros}) are fully expanded.
  15226. Then, for the following commands, the command name and braces are removed,
  15227. and the text of the argument is recursively transformed:
  15228. @example
  15229. @@asis @@b @@cite @@code @@command @@dfn @@dmn @@dotless
  15230. @@emph @@env @@file @@i @@indicateurl @@kbd @@key
  15231. @@samp @@sansserif @@sc @@slanted @@strong @@sub @@sup
  15232. @@t @@U @@var @@verb @@w
  15233. @end example
  15234. @noindent For @code{@@sc}, any letters are capitalized.
  15235. In addition, the following commands are replaced by constant text, as
  15236. shown below. If any of these commands have non-empty arguments, as in
  15237. @code{@@TeX@{bad@}}, it is an error, and the result is unspecified.
  15238. In this table, `(space)' means a space character and `(nothing)' means
  15239. the empty string. The notation `U+@var{hhhh}' means Unicode code
  15240. point @var{hhhh} (in hex, as usual).
  15241. There are further transformations of many of these expansions to yield
  15242. the final file or other target name, such as space characters to
  15243. @samp{-}, etc., according to the other rules.
  15244. @multitable @columnfractions .3 .5
  15245. @item @code{@@(newline)} @tab (space)
  15246. @item @code{@@(space)} @tab (space)
  15247. @item @code{@@(tab)} @tab (space)
  15248. @item @code{@@!} @tab @samp{!}
  15249. @item @code{@@*} @tab (space)
  15250. @item @code{@@-} @tab (nothing)
  15251. @item @code{@@.} @tab @samp{.}
  15252. @item @code{@@:} @tab (nothing)
  15253. @item @code{@@?} @tab @samp{?}
  15254. @item @code{@@@@} @tab @samp{@@}
  15255. @item @code{@@@{} @tab @samp{@{}
  15256. @item @code{@@@}} @tab @samp{@}}
  15257. @item @code{@@LaTeX} @tab @samp{LaTeX}
  15258. @item @code{@@TeX} @tab @samp{TeX}
  15259. @item @code{@@arrow} @tab U+2192
  15260. @item @code{@@bullet} @tab U+2022
  15261. @item @code{@@comma} @tab @samp{,}
  15262. @item @code{@@copyright} @tab U+00A9
  15263. @item @code{@@dots} @tab U+2026
  15264. @item @code{@@enddots} @tab @samp{...}
  15265. @item @code{@@equiv} @tab U+2261
  15266. @item @code{@@error} @tab @samp{error-->}
  15267. @item @code{@@euro} @tab U+20AC
  15268. @item @code{@@exclamdown} @tab U+00A1
  15269. @item @code{@@expansion} @tab U+21A6
  15270. @item @code{@@geq} @tab U+2265
  15271. @item @code{@@leq} @tab U+2264
  15272. @item @code{@@minus} @tab U+2212
  15273. @item @code{@@ordf} @tab U+00AA
  15274. @item @code{@@ordm} @tab U+00BA
  15275. @item @code{@@point} @tab U+2605
  15276. @item @code{@@pounds} @tab U+00A3
  15277. @item @code{@@print} @tab U+22A3
  15278. @item @code{@@questiondown} @tab U+00BF
  15279. @item @code{@@registeredsymbol} @tab U+00AE
  15280. @item @code{@@result} @tab U+21D2
  15281. @item @code{@@textdegree} @tab U+00B0
  15282. @item @code{@@tie} @tab (space)
  15283. @end multitable
  15284. Quotation mark @@-commands (@code{@@quotedblright@{@}} and the like),
  15285. are likewise replaced by their Unicode values. Normal quotation
  15286. @emph{characters} (e.g., ASCII ` and ') are not altered.
  15287. @xref{Inserting Quotation Marks}.
  15288. Any @code{@@acronym}, @code{@@abbr}, @code{@@email}, and
  15289. @code{@@image} commands are replaced by their first argument. (For
  15290. these commands, all subsequent arguments are optional, and ignored
  15291. here.) @xref{@code{@@acronym}}, and @ref{@code{@@email}}, and @ref{Images}.
  15292. Accents are handled according to the next section.
  15293. Any other command is an error, and the result is unspecified.
  15294. @node HTML Xref 8-bit Character Expansion
  15295. @subsection HTML Cross-reference 8-bit Character Expansion
  15296. @cindex HTML cross-reference 8-bit character expansion
  15297. @cindex 8-bit characters, in HTML cross-references
  15298. @cindex Expansion of 8-bit characters in HTML cross-references
  15299. @cindex Transliteration of 8-bit characters in HTML cross-references
  15300. Usually, characters other than plain 7-bit ASCII are transformed into
  15301. the corresponding Unicode code point(s) in Normalization Form@tie{}C,
  15302. which uses precomposed characters where available. (This is the
  15303. normalization form recommended by the W3C and other bodies.) This
  15304. holds when that code point is @code{0xffff} or less, as it almost
  15305. always is.
  15306. These will then be further transformed by the rules above into the
  15307. string @samp{_@var{hhhh}}, where @var{hhhh} is the code point in hex.
  15308. For example, combining this rule and the previous section:
  15309. @example
  15310. @@node @@b@{A@} @@TeX@{@} @@u@{B@} @@point@{@}@@enddots@{@}
  15311. @result{} A-TeX-B_0306-_2605_002e_002e_002e
  15312. @end example
  15313. Notice: 1)@tie{}@code{@@enddots} expands to three periods which in
  15314. turn expands to three @samp{_002e}'s; 2)@tie{}@code{@@u@{B@}} is a `B'
  15315. with a breve accent, which does not exist as a pre-accented Unicode
  15316. character, therefore expands to @samp{B_0306} (B with combining
  15317. breve).
  15318. When the Unicode code point is above @code{0xffff}, the transformation
  15319. is @samp{__@var{xxxxxx}}, that is, two leading underscores followed by
  15320. six hex digits. Since Unicode has declared that their highest code
  15321. point is @code{0x10ffff}, this is sufficient. (We felt it was better
  15322. to define this extra escape than to always use six hex digits, since
  15323. the first two would nearly always be zeros.)
  15324. This method works fine if the node name consists mostly of ASCII
  15325. characters and contains only few 8-bit ones. But if the document is
  15326. written in a language whose script is not based on the Latin alphabet
  15327. (for example, Ukrainian), it will create file names consisting almost
  15328. entirely of @samp{_@var{xxxx}} notations, which is inconvenient and
  15329. all but unreadable. To handle such cases, @command{makeinfo} offers
  15330. the @option{--transliterate-file-names} command line option. This
  15331. option enables @dfn{transliteration} of node names into ASCII
  15332. characters for the purposes of file name creation and referencing.
  15333. The transliteration is based on phonetic principles, which makes the
  15334. generated file names more easily understanable.
  15335. @cindex Normalization Form C, Unicode
  15336. For the definition of Unicode Normalization Form@tie{}C, see Unicode
  15337. report UAX#15, @uref{http://www.unicode.org/reports/tr15/}. Many
  15338. related documents and implementations are available elsewhere on the
  15339. web.
  15340. @node HTML Xref Mismatch
  15341. @subsection HTML Cross-reference Mismatch
  15342. @cindex HTML cross-reference mismatch
  15343. @cindex Mismatched HTML cross-reference source and target
  15344. As mentioned earlier (@pxref{HTML Xref Link Basics}), the generating
  15345. software may need to guess whether a given manual being cross
  15346. referenced is available in split or monolithic form---and, inevitably,
  15347. it might guess wrong. However, when the @emph{referent} manual is
  15348. generated, it is possible to handle at least some mismatches.
  15349. In the case where we assume the referent is split, but it is actually
  15350. available in mono, the only recourse would be to generate a
  15351. @file{manual/} subdirectory full of HTML files which redirect back to
  15352. the monolithic @file{manual.html}. Since this is essentially the same
  15353. as a split manual in the first place, it's not very appealing.
  15354. On the other hand, in the case where we assume the referent is mono,
  15355. but it is actually available in split, it is possible to use
  15356. JavaScript to redirect from the putatively monolithic
  15357. @file{manual.html} to the different @file{manual/node.html} files.
  15358. Here's an example:
  15359. @example
  15360. function redirect() @{
  15361. switch (location.hash) @{
  15362. case "#Node1":
  15363. location.replace("manual/Node1.html#Node1"); break;
  15364. case "#Node2" :
  15365. location.replace("manual/Node2.html#Node2"); break;
  15366. @dots{}
  15367. default:;
  15368. @}
  15369. @}
  15370. @end example
  15371. Then, in the @code{<body>} tag of @file{manual.html}:
  15372. @example
  15373. <body onLoad="redirect();">
  15374. @end example
  15375. Once again, this is something the software which generated the
  15376. @emph{referent} manual has to do in advance, it's not something the
  15377. software generating the cross-reference in the present manual can
  15378. control.
  15379. @node HTML Xref Configuration
  15380. @subsection HTML Cross-reference Configuration: @file{htmlxref.cnf}
  15381. @pindex htmlxref.cnf
  15382. @cindex HTML cross-reference configuration
  15383. @cindex Cross-reference configuration, for HTML
  15384. @cindex Configuration, for HTML cross-manual references
  15385. @command{makeinfo} reads a file named @file{htmlxref.cnf} to gather
  15386. information for cross-references to other manuals in HTML output. It
  15387. is looked for in the following directories:
  15388. @table @file
  15389. @item ./
  15390. (the current directory)
  15391. @item ./.texinfo/
  15392. (under the current directory)
  15393. @item ~/.texinfo/
  15394. (where @code{~} is the current user's home directory)
  15395. @item @var{sysconfdir}/texinfo/
  15396. (where @var{sysconfdir} is the system configuration directory
  15397. specified at compile-time, e.g., @file{/usr/local/etc})
  15398. @item @var{datadir}/texinfo/
  15399. (likewise specified at compile time, e.g., @file{/usr/local/share})
  15400. @end table
  15401. All files found are used, with earlier entries overriding later ones.
  15402. The Texinfo distribution includes a default file which handles many
  15403. GNU manuals; it is installed in the last of the above directories,
  15404. i.e., @file{@var{datadir}/texinfo/htmlxref.cnf}.
  15405. The file is line-oriented. Lines consisting only of whitespace are
  15406. ignored. Comments are indicated with a @samp{#} at the beginning of a
  15407. line, optionally preceded by whitespace. Since @samp{#} can occur in
  15408. urls (like almost any character), it does not otherwise start a
  15409. comment.
  15410. Each non-blank non-comment line must be either a @dfn{variable
  15411. assignment} or @dfn{manual information}.
  15412. A variable assignment line looks like this:
  15413. @example
  15414. @var{varname} = @var{varvalue}
  15415. @end example
  15416. Whitespace around the @samp{=} is optional and ignored. The
  15417. @var{varname} should consist of letters; case is significant. The
  15418. @var{varvalue} is an arbitrary string, continuing to the end of the
  15419. line. Variables are then referenced with @samp{$@{@var{varname}@}};
  15420. variable references can occur in the @var{varvalue}.
  15421. A manual information line looks like this:
  15422. @example
  15423. @var{manual} @var{keyword} @var{urlprefix}
  15424. @end example
  15425. @noindent
  15426. with @var{manual} the short identifier for a manual, @var{keyword}
  15427. being one of: @code{mono}, @code{node}, @code{section},
  15428. @code{chapter}, and @var{urlprefix} described below. Variable
  15429. references can occur only in the @var{urlprefix}. For example (used
  15430. in the canonical @file{htmlxref.cnf}):
  15431. @smallexample
  15432. G = http://www.gnu.org
  15433. GS = $@{G@}/software
  15434. hello mono $@{GS@}/hello/manual/hello.html
  15435. hello chapter $@{GS@}/hello/manual/html_chapter/
  15436. hello section $@{GS@}/hello/manual/html_section/
  15437. hello node $@{GS@}/hello/manual/html_node/
  15438. @end smallexample
  15439. @cindex monolithic manuals, for HTML cross-references
  15440. If the keyword is @code{mono}, @var{urlprefix} gives the host,
  15441. directory, and file name for @var{manual} as one monolithic file.
  15442. @cindex split manuals, for HTML cross-references
  15443. If the keyword is @code{node}, @code{section}, or @code{chapter},
  15444. @var{urlprefix} gives the host and directory for @var{manual} split
  15445. into nodes, sections, or chapters, respectively.
  15446. When available, @command{makeinfo} will use the ``corresponding''
  15447. value for cross-references between manuals. That is, when generating
  15448. monolithic output (@option{--no-split}), the @code{mono} url will be
  15449. used, when generating output that is split by node, the @code{node}
  15450. url will be used, etc. However, if a manual is not available in that
  15451. form, anything that is available can be used. Here is the search
  15452. order for each style:
  15453. @smallexample
  15454. node @result{} node, section, chapter, mono
  15455. section @result{} section, chapter, node, mono
  15456. chapter @result{} chapter, section, node, mono
  15457. mono @result{} mono, chapter, section, node
  15458. @end smallexample
  15459. @opindex --node-files@r{, and HTML cross-references}
  15460. These section- and chapter-level cross-manual references can succeed
  15461. only when the target manual was created using @option{--node-files};
  15462. this is the default for split output.
  15463. If you have additions or corrections to the @file{htmlxref.cnf}
  15464. distributed with Texinfo, please email @email{bug-texinfo@@gnu.org} as
  15465. usual. You can get the latest version from
  15466. @url{http://ftpmirror.gnu.org/@/texinfo/@/htmlxref.cnf}.
  15467. @node HTML Xref Link Preservation
  15468. @subsection HTML Cross-reference Link Preservation: @var{manual}@file{-noderename.cnf}
  15469. @pindex noderename.cnf
  15470. @pindex @var{manual}-noderename.cnf
  15471. @cindex HTML cross-reference link preservation
  15472. @cindex Preserving HTML links to old nodes
  15473. @cindex Old nodes, preserving links to
  15474. @cindex Renaming nodes, and preserving links
  15475. @cindex Links, preserving to renamed nodes
  15476. @cindex Node renaming, and preserving links
  15477. Occasionally changes in a program require removing (or renaming) nodes
  15478. in the manual in order to have the best documentation. Given the
  15479. nature of the web, however, links may exist anywhere to such a removed
  15480. node (renaming appears the same as removal for this purpose), and it's
  15481. not ideal for those links to simply break.
  15482. @vindex RENAMED_NODES_FILE
  15483. Therefore, Texinfo provides a way for manual authors to specify old
  15484. node names and the new nodes to which the old names should be
  15485. redirected, via the file @var{manual}@file{-noderename.cnf}, where
  15486. @var{manual} is the base name of the manual. For example, the manual
  15487. @file{texinfo.texi} would be supplemented by a file
  15488. @file{texinfo-noderename}.cnf. (This name can be overridden by
  15489. setting the @file{RENAMED_NODES_FILE} customization variable;
  15490. @pxref{Customization Variables}).
  15491. The file is read in pairs of lines, as follows:
  15492. @example
  15493. @var{old-node-name}
  15494. @@@@@{@} @var{new-node-name}
  15495. @end example
  15496. The usual conversion from Texinfo node names to HTML names is applied;
  15497. see this entire section for details (@pxref{HTML Xref}). The unusual
  15498. @samp{@@@@@{@}} separator is used because it is not a valid Texinfo
  15499. construct, so can't appear in the node names.
  15500. The effect is that @command{makeinfo} generates a redirect from
  15501. @var{old-node-name} to @var{new-node-name} when producing HTML output.
  15502. Thus, external links to the old node are preserved.
  15503. Lines consisting only of whitespace are ignored. Comments are
  15504. indicated with a @samp{@@c} at the beginning of a line, optionally
  15505. preceded by whitespace.
  15506. Another approach to preserving links to deleted or renamed nodes is to
  15507. use anchors (@pxref{@code{@@anchor}}). There is no effective
  15508. difference between the two approaches.
  15509. @node @@-Command Details
  15510. @appendix @@-Command Details
  15511. Here are the details of @@-commands: information about their syntax, a
  15512. list of commands, and information about where commands can appear.
  15513. @node Command Syntax
  15514. @section @@-Command Syntax
  15515. @cindex @@-command syntax
  15516. @cindex Syntax, of @@-commands
  15517. @cindex Command syntax
  15518. Texinfo has the following types of @@-command:
  15519. @table @asis
  15520. @item 1. Brace commands
  15521. These commands start with @@ followed by a letter or a word, followed by an
  15522. argument within braces. For example, the command @code{@@dfn} indicates
  15523. the introductory or defining use of a term; it is used as follows: @samp{In
  15524. Texinfo, @@@@-commands are @@dfn@{mark-up@} commands.}
  15525. @item 2. Line commands
  15526. These commands occupy an entire line. The line starts with @@,
  15527. followed by the name of the command (a word); for example, @code{@@center}
  15528. or @code{@@cindex}. If no argument is needed, the word is followed by
  15529. the end of the line. If there is an argument, it is separated from
  15530. the command name by a space. Braces are not used.
  15531. @item 3. Block commands
  15532. These commands are written at the start of a line, with general text on
  15533. following lines, terminated by a matching @code{@@end} command on a
  15534. line of its own. For example, @code{@@example}, then the lines of a
  15535. coding example, then @code{@@end example}. Some of these block commands
  15536. take arguments as line commands do; for example, @code{@@enumerate A}
  15537. opening an environment terminated by @code{@@end enumerate}. Here
  15538. @samp{A} is the argument.
  15539. @item 4. Symbol insertion commands with no arguments
  15540. These commands start with @@ followed by a word followed by a
  15541. left and right- brace. These commands insert special symbols in
  15542. the document; they do not take arguments. Some examples:
  15543. @code{@@dots@{@}} @result{} @samp{@dots{}}, @code{@@equiv@{@}}
  15544. @result{} @samp{@equiv{}}, @code{@@TeX@{@}} @result{} `@TeX{}', and
  15545. @code{@@bullet@{@}} @result{} @samp{@bullet{}}.
  15546. @item 5. Non-alphabetic commands
  15547. The names of commands in all of the above categories consist of
  15548. alphabetic characters, almost entirely in lower-case. Unlike those, the
  15549. non-alphabetic commands commands consist of an @@ followed by a
  15550. punctuation mark or other character that is not part of the Latin
  15551. alphabet. Non-alphabetic commands are almost always part of text
  15552. within a paragraph. The non-alphabetic commands include @code{@@@@},
  15553. @code{@@@{}, @code{@@@}}, @code{@@.}, @code{@@@kbd{SPACE}}, and most of
  15554. the accent commands.
  15555. @item 6. Miscellaneous commands
  15556. There are a handful of commands that don't fit into any of the above
  15557. categories; for example, the obsolete command @code{@@refill}, which is
  15558. always used at the end of a paragraph immediately following the final
  15559. period or other punctuation character. @code{@@refill} takes no
  15560. argument and does not require braces. Likewise, @code{@@tab} used in a
  15561. @code{@@multitable} block does not take arguments, and is not followed
  15562. by braces.
  15563. @end table
  15564. @cindex Braces and argument syntax
  15565. Thus, the alphabetic commands fall into classes that have
  15566. different argument syntaxes. You cannot tell to which class a command
  15567. belongs by the appearance of its name, but you can tell by the
  15568. command's meaning: if the command stands for a glyph, it is in
  15569. class 4 and does not require an argument; if it makes sense to use the
  15570. command among other text as part of a paragraph, the command
  15571. is in class 1 and must be followed by an argument in braces. The
  15572. non-alphabetic commands, such as @code{@@:}, are exceptions to the
  15573. rule; they do not need braces.
  15574. The purpose of having different syntax for commands is to make Texinfo
  15575. files easier to read, and also to help the GNU Emacs paragraph and
  15576. filling commands work properly.
  15577. @node Command List
  15578. @section @@-Command List
  15579. @cindex Alphabetical @@-command list
  15580. @cindex List of @@-commands
  15581. @cindex @@-command list
  15582. @cindex Reference to @@-commands
  15583. Here is an alphabetical list of the @@-commands in Texinfo. Square
  15584. brackets, @t{[}@w{ }@t{]}, indicate optional arguments; an ellipsis,
  15585. @samp{@dots{}}, indicates repeated text.
  15586. @table @code
  15587. @item @@@var{whitespace}
  15588. An @code{@@} followed by a space, tab, or newline produces a normal,
  15589. stretchable, interword space. @xref{Multiple Spaces}.
  15590. @item @@!
  15591. Produce an exclamation point that ends a sentence (usually after an
  15592. end-of-sentence capital letter). @xref{Ending a Sentence}.
  15593. @item @@"
  15594. @itemx @@'
  15595. Generate an umlaut or acute accent, respectively, over the next
  15596. character, as in @"o and @'o. @xref{Inserting Accents}.
  15597. @item @@*
  15598. Force a line break. @xref{Line Breaks}.
  15599. @item @@,@{@var{c}@}
  15600. Generate a cedilla accent under @var{c}, as in @,{c}. @xref{Inserting
  15601. Accents}.
  15602. @item @@-
  15603. Insert a discretionary hyphenation point. @xref{@code{@@- @@hyphenation}}.
  15604. @item @@.
  15605. Produce a period that ends a sentence (usually after an
  15606. end-of-sentence capital letter). @xref{Ending a Sentence}.
  15607. @item @@/
  15608. Produces no output, but allows a line break. @xref{Line Breaks}.
  15609. @item @@:
  15610. Tell @TeX{} to refrain from inserting extra whitespace after an
  15611. immediately preceding period, question mark, exclamation mark, or
  15612. colon, as @TeX{} normally would. @xref{Not Ending a Sentence}.
  15613. @item @@=
  15614. Generate a macron (bar) accent over the next character, as in @=o.
  15615. @xref{Inserting Accents}.
  15616. @item @@?
  15617. Produce a question mark that ends a sentence (usually after an
  15618. end-of-sentence capital letter). @xref{Ending a Sentence}.
  15619. @item @@@@
  15620. @itemx @@atchar@{@}
  15621. Insert an at sign, @samp{@@}. @xref{Inserting an Atsign}.
  15622. @item @@\
  15623. @itemx @@backslashchar@{@}
  15624. Insert a backslash, @samp{\}; @code{@@backslashchar@{@}} works
  15625. anywhere, while @code{@@\} works only inside @code{@@math}.
  15626. @xref{Inserting a Backslash}, and @ref{Inserting Math}.
  15627. @item @@^
  15628. @itemx @@`
  15629. Generate a circumflex (hat) or grave accent, respectively, over the next
  15630. character, as in @^o and @`e.
  15631. @xref{Inserting Accents}.
  15632. @item @@@{
  15633. @itemx @@lbracechar@{@}
  15634. Insert a left brace, @samp{@{}. @xref{Inserting Braces}.
  15635. @item @@@}
  15636. @itemx @@rbracechar@{@}
  15637. Insert a right brace, @samp{@}}. @xref{Inserting Braces}.
  15638. @item @@~
  15639. Generate a tilde accent over the next character, as in @~N.
  15640. @xref{Inserting Accents}.
  15641. @item @@AA@{@}
  15642. @itemx @@aa@{@}
  15643. Generate the uppercase and lowercase Scandinavian A-ring letters,
  15644. respectively: @AA{}, @aa{}. @xref{Inserting Accents}.
  15645. @item @@abbr@{@var{abbreviation}@}
  15646. Indicate a general abbreviation, such as `Comput.'.
  15647. @xref{@code{@@abbr}}.
  15648. @item @@acronym@{@var{acronym}@}
  15649. Indicate an acronym in all capital letters, such as `NASA'.
  15650. @xref{@code{@@acronym}}.
  15651. @item @@AE@{@}
  15652. @itemx @@ae@{@}
  15653. Generate the uppercase and lowercase AE ligatures, respectively:
  15654. @AE{}, @ae{}. @xref{Inserting Accents}.
  15655. @item @@afivepaper
  15656. Change page dimensions for the A5 paper size. @xref{A4 Paper}.
  15657. @item @@afourlatex
  15658. @itemx @@afourpaper
  15659. @itemx @@afourwide
  15660. Change page dimensions for the A4 paper size. @xref{A4 Paper}.
  15661. @item @@alias @var{new}=@var{existing}
  15662. Make the command @samp{@@@var{new}} a synonym for the existing command
  15663. @samp{@@@var{existing}}. @xref{@code{@@alias}}.
  15664. @item @@allowcodebreaks @var{true-false}
  15665. Control breaking at @samp{-} and @samp{_} in @TeX{}.
  15666. @xref{@code{@@allowcodebreaks}}.
  15667. @item @@anchor@{@var{name}@}
  15668. Define @var{name} as the current location for use as a cross-reference
  15669. target. @xref{@code{@@anchor}}.
  15670. @item @@appendix @var{title}
  15671. Begin an appendix. The title appears in the table of contents. In
  15672. Info, the title is underlined with asterisks.
  15673. @xref{@code{@@unnumbered @@appendix}}.
  15674. @item @@appendixsec @var{title}
  15675. @itemx @@appendixsection @var{title}
  15676. Begin an appendix section within an appendix. The section title
  15677. appears in the table of contents. In Info, the title is underlined
  15678. with equal signs. @code{@@appendixsection} is a longer spelling of
  15679. the @code{@@appendixsec} command. @xref{@code{@@unnumberedsec
  15680. @@appendixsec @@heading}}.
  15681. @item @@appendixsubsec @var{title}
  15682. Begin an appendix subsection. The title appears in the table of
  15683. contents. In Info, the title is underlined with hyphens.
  15684. @xref{@code{@@unnumberedsubsec @@appendixsubsec @@subheading}}.
  15685. @item @@appendixsubsubsec @var{title}
  15686. Begin an appendix subsubsection. The title appears in the table of
  15687. contents. In Info, the title is underlined with periods.
  15688. @xref{@code{@@subsubsection}}.
  15689. @item @@arrow@{@}
  15690. Generate a right arrow glyph: @samp{@arrow{}}. Used by default
  15691. for @code{@@click}. @xref{Click Sequences}.
  15692. @item @@asis
  15693. Used following @code{@@table}, @code{@@ftable}, and @code{@@vtable} to
  15694. print the table's first column without highlighting (``as is'').
  15695. @xref{@code{@@asis}}.
  15696. @item @@author @var{author}
  15697. Typeset @var{author} flushleft and underline it. @xref{@code{@@title
  15698. @@subtitle @@author}}.
  15699. @item @@b@{@var{text}@}
  15700. Set @var{text} in a @b{bold} font. No effect in Info. @xref{Fonts}.
  15701. @item @@bullet@{@}
  15702. Generate a large round dot, @bullet{} (@samp{*} in Info). Often used
  15703. with @code{@@table}. @xref{@code{@@bullet}}.
  15704. @item @@bye
  15705. Stop formatting a file. The formatters do not see anything in the
  15706. input file following @code{@@bye}. @xref{Ending a File}.
  15707. @item @@c @var{comment}
  15708. Begin a comment in Texinfo. The rest of the line does not appear in
  15709. any output. A synonym for @code{@@comment}. @kbd{DEL} also
  15710. starts a comment. @xref{Comments}.
  15711. @item @@caption
  15712. Define the full caption for a @code{@@float}. @xref{@code{@@caption
  15713. @@shortcaption}}.
  15714. @item @@cartouche
  15715. Highlight an example or quotation by drawing a box with rounded
  15716. corners around it. Pair with @code{@@end cartouche}. No effect in
  15717. Info. @xref{@code{@@cartouche}}.
  15718. @item @@center @var{line-of-text}
  15719. Center the line of text following the command.
  15720. @xref{@code{@@titlefont @@center @@sp}}.
  15721. @item @@centerchap @var{line-of-text}
  15722. Like @code{@@chapter}, but centers the chapter title. @xref{@code{@@chapter}}.
  15723. @item @@chapheading @var{title}
  15724. Print an unnumbered chapter-like heading, but omit from the table of
  15725. contents. In Info, the title is underlined with asterisks.
  15726. @xref{@code{@@majorheading @@chapheading}}.
  15727. @item @@chapter @var{title}
  15728. Begin a numbered chapter. The chapter title appears in the table of
  15729. contents. In Info, the title is underlined with asterisks.
  15730. @xref{@code{@@chapter}}.
  15731. @item @@cindex @var{entry}
  15732. Add @var{entry} to the index of concepts. @xref{Index Entries, ,
  15733. Defining the Entries of an Index}.
  15734. @item @@cite@{@var{reference}@}
  15735. Highlight the name of a book or other reference that has no companion
  15736. Info file. @xref{@code{@@cite}}.
  15737. @item @@clear @var{flag}
  15738. Unset @var{flag}, preventing the Texinfo formatting commands from
  15739. formatting text between subsequent pairs of @code{@@ifset @var{flag}}
  15740. and @code{@@end ifset} commands, and preventing
  15741. @code{@@value@{@var{flag}@}} from expanding to the value to which
  15742. @var{flag} is set. @xref{@code{@@set @@clear @@value}}.
  15743. @item @@click@{@}
  15744. Represent a single ``click'' in a GUI@. Used within
  15745. @code{@@clicksequence}. @xref{Click Sequences}.
  15746. @item @@clicksequence@{@var{action} @@click@{@} @var{action}@}
  15747. Represent a sequence of clicks in a GUI@. @xref{Click Sequences}.
  15748. @item @@clickstyle @@@var{cmd}
  15749. Execute @@@var{cmd} for each @code{@@click}; the default is
  15750. @code{@@arrow}. The usual following empty braces on @@@var{cmd} are
  15751. omitted. @xref{Click Sequences}.
  15752. @item @@code@{@var{sample-code}@}
  15753. Indicate an expression, a syntactically complete token of a program,
  15754. or a program name. Unquoted in Info output. @xref{@code{@@code}}.
  15755. @item @@codequotebacktick @var{on-off}
  15756. @itemx @@codequoteundirected @var{on-off}
  15757. Control output of @code{`} and @code{'} in code examples.
  15758. @xref{Inserting Quote Characters}.
  15759. @item @@comma@{@}
  15760. Insert a comma `,' character; only needed when a literal comma would
  15761. be taken as an argument separator. @xref{Inserting a Comma}.
  15762. @item @@command@{@var{command-name}@}
  15763. Indicate a command name, such as @command{ls}. @xref{@code{@@command}}.
  15764. @item @@comment @var{comment}
  15765. Begin a comment in Texinfo. The rest of the line does not appear in
  15766. any output. A synonym for @code{@@c}.
  15767. @xref{Comments}.
  15768. @item @@contents
  15769. Print a complete table of contents. Has no effect in Info, which uses
  15770. menus instead. @xref{Contents, , Generating a Table of Contents}.
  15771. @item @@copying
  15772. Specify copyright holders and copying conditions for the document. Pair
  15773. with @code{@@end copying}. @xref{@code{@@copying}}.
  15774. @item @@copyright@{@}
  15775. Generate the copyright symbol @copyright{}.
  15776. @xref{@code{@@copyright}}.
  15777. @item @@defcodeindex @var{index-name}
  15778. Define a new index and its indexing command. Print entries in an
  15779. @code{@@code} font. @xref{New Indices, , Defining New Indices}.
  15780. @item @@defcv @var{category} @var{class} @var{name}
  15781. @itemx @@defcvx @var{category} @var{class} @var{name}
  15782. Format a description for a variable associated with a class in
  15783. object-oriented programming. Takes three arguments: the category of
  15784. thing being defined, the class to which it belongs, and its name.
  15785. @xref{Definition Commands}.
  15786. @item @@deffn @var{category} @var{name} @var{arguments}@dots{}
  15787. @itemx @@deffnx @var{category} @var{name} @var{arguments}@dots{}
  15788. Format a description for a function, interactive command, or similar
  15789. entity that may take arguments. @code{@@deffn} takes as arguments the
  15790. category of entity being described, the name of this particular
  15791. entity, and its arguments, if any. @xref{Definition Commands}.
  15792. @item @@defindex @var{index-name}
  15793. Define a new index and its indexing command. Print entries in a roman
  15794. font. @xref{New Indices, , Defining New Indices}.
  15795. @item @@definfoenclose @var{newcmd}, @var{before}, @var{after}
  15796. Must be used within @code{@@ifinfo}; create a new command
  15797. @code{@@@var{newcmd}} for Info that marks text by enclosing it in
  15798. strings that precede and follow the text.
  15799. @xref{@code{@@definfoenclose}}.
  15800. @item @@defivar @var{class} @var{instance-variable-name}
  15801. @itemx @@defivarx @var{class} @var{instance-variable-name}
  15802. Format a description for an instance variable in object-oriented
  15803. programming. The command is equivalent to @samp{@@defcv @{Instance
  15804. Variable@} @dots{}}. @xref{Definition Commands}.
  15805. @item @@defmac @var{macroname} @var{arguments}@dots{}
  15806. @itemx @@defmacx @var{macroname} @var{arguments}@dots{}
  15807. Format a description for a macro; equivalent to @samp{@@deffn Macro
  15808. @dots{}}. @xref{Definition Commands}.
  15809. @item @@defmethod @var{class} @var{method-name} @var{arguments}@dots{}
  15810. @itemx @@defmethodx @var{class} @var{method-name} @var{arguments}@dots{}
  15811. Format a description for a method in object-oriented programming;
  15812. equivalent to @samp{@@defop Method @dots{}}. @xref{Definition
  15813. Commands}.
  15814. @item @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
  15815. @itemx @@defopx @var{category} @var{class} @var{name} @var{arguments}@dots{}
  15816. Format a description for an operation in object-oriented programming.
  15817. @code{@@defop} takes as arguments the name of the category of
  15818. operation, the name of the operation's class, the name of the
  15819. operation, and its arguments, if any. @xref{Definition Commands}, and
  15820. @ref{Abstract Objects}.
  15821. @item @@defopt @var{option-name}
  15822. @itemx @@defoptx @var{option-name}
  15823. Format a description for a user option; equivalent to @samp{@@defvr
  15824. @{User Option@} @dots{}}. @xref{Definition Commands}.
  15825. @item @@defspec @var{special-form-name} @var{arguments}@dots{}
  15826. @itemx @@defspecx @var{special-form-name} @var{arguments}@dots{}
  15827. Format a description for a special form; equivalent to @samp{@@deffn
  15828. @{Special Form@} @dots{}}. @xref{Definition Commands}.
  15829. @item @@deftp @var{category} @var{name-of-type} @var{attributes}@dots{}
  15830. @itemx @@deftpx @var{category} @var{name-of-type} @var{attributes}@dots{}
  15831. Format a description for a data type; its arguments are the category,
  15832. the name of the type (e.g., @samp{int}) , and then the names of
  15833. attributes of objects of that type. @xref{Definition Commands}, and
  15834. @ref{Data Types}.
  15835. @item @@deftypecv @var{category} @var{class} @var{data-type} @var{name}
  15836. @itemx @@deftypecvx @var{category} @var{class} @var{data-type} @var{name}
  15837. Format a description for a typed class variable in object-oriented programming.
  15838. @xref{Definition Commands}, and @ref{Abstract Objects}.
  15839. @item @@deftypefn @var{category} @var{data-type} @var{name} @var{arguments}@dots{}
  15840. @itemx @@deftypefnx @var{category} @var{data-type} @var{name} @var{arguments}@dots{}
  15841. Format a description for a function or similar entity that may take
  15842. arguments and that is typed. @code{@@deftypefn} takes as arguments the
  15843. category of entity being described, the type, the name of the
  15844. entity, and its arguments, if any. @xref{Definition Commands}.
  15845. @item @@deftypefnnewline @var{on-off}
  15846. Specifies whether return types for @code{@@deftypefn} and similar are
  15847. printed on lines by themselves; default is off. @xref{Typed
  15848. Functions,, Functions in Typed Languages}.
  15849. @item @@deftypefun @var{data-type} @var{function-name} @var{arguments}@dots{}
  15850. @itemx @@deftypefunx @var{data-type} @var{function-name} @var{arguments}@dots{}
  15851. Format a description for a function in a typed language.
  15852. The command is equivalent to @samp{@@deftypefn Function @dots{}}.
  15853. @xref{Definition Commands}.
  15854. @item @@deftypeivar @var{class} @var{data-type} @var{variable-name}
  15855. @itemx @@deftypeivarx @var{class} @var{data-type} @var{variable-name}
  15856. Format a description for a typed instance variable in object-oriented
  15857. programming. @xref{Definition Commands}, and @ref{Abstract Objects}.
  15858. @item @@deftypemethod @var{class} @var{data-type} @var{method-name} @var{arguments}@dots{}
  15859. @itemx @@deftypemethodx @var{class} @var{data-type} @var{method-name} @var{arguments}@dots{}
  15860. Format a description for a typed method in object-oriented programming.
  15861. @xref{Definition Commands}.
  15862. @item @@deftypeop @var{category} @var{class} @var{data-type} @var{name} @var{arguments}@dots{}
  15863. @itemx @@deftypeopx @var{category} @var{class} @var{data-type} @var{name} @var{arguments}@dots{}
  15864. Format a description for a typed operation in object-oriented programming.
  15865. @xref{Definition Commands}, and @ref{Abstract Objects}.
  15866. @item @@deftypevar @var{data-type} @var{variable-name}
  15867. @itemx @@deftypevarx @var{data-type} @var{variable-name}
  15868. Format a description for a variable in a typed language. The command is
  15869. equivalent to @samp{@@deftypevr Variable @dots{}}. @xref{Definition
  15870. Commands}.
  15871. @item @@deftypevr @var{category} @var{data-type} @var{name}
  15872. @itemx @@deftypevrx @var{category} @var{data-type} @var{name}
  15873. Format a description for something like a variable in a typed
  15874. language---an entity that records a value. Takes as arguments the
  15875. category of entity being described, the type, and the name of the
  15876. entity. @xref{Definition Commands}.
  15877. @item @@defun @var{function-name} @var{arguments}@dots{}
  15878. @itemx @@defunx @var{function-name} @var{arguments}@dots{}
  15879. Format a description for a function; equivalent to
  15880. @samp{@@deffn Function @dots{}}. @xref{Definition Commands}.
  15881. @item @@defvar @var{variable-name}
  15882. @itemx @@defvarx @var{variable-name}
  15883. Format a description for a variable; equivalent to @samp{@@defvr
  15884. Variable @dots{}}. @xref{Definition Commands}.
  15885. @item @@defvr @var{category} @var{name}
  15886. @itemx @@defvrx @var{category} @var{name}
  15887. Format a description for any kind of variable. @code{@@defvr} takes
  15888. as arguments the category of the entity and the name of the entity.
  15889. @xref{Definition Commands}.
  15890. @item @@detailmenu
  15891. Mark the (optional) detailed node listing in a master menu.
  15892. @xref{Master Menu Parts}.
  15893. @item @@dfn@{@var{term}@}
  15894. Indicate the introductory or defining use of a term. @xref{@code{@@dfn}}.
  15895. @item @@DH@{@}
  15896. @itemx @@dh@{@}
  15897. Generate the uppercase and lowercase Icelandic letter eth, respectively:
  15898. @DH{}, @dh{}. @xref{Inserting Accents}.
  15899. @item @@dircategory @var{dirpart}
  15900. Specify a part of the Info directory menu where this file's entry should
  15901. go. @xref{Installing Dir Entries}.
  15902. @item @@direntry
  15903. Begin the Info directory menu entry for this file. Pair with
  15904. @code{@@end direntry}. @xref{Installing Dir Entries}.
  15905. @item @@display
  15906. Begin a kind of example. Like @code{@@example} (indent text, do not
  15907. fill), but do not select a new font. Pair with @code{@@end display}.
  15908. @xref{@code{@@display}}.
  15909. @item @@dmn@{@var{dimension}@}
  15910. Format a unit of measure, as in 12@dmn{pt}. Causes @TeX{} to insert a
  15911. thin space before @var{dimension}. No effect in Info.
  15912. @xref{@code{@@dmn}}.
  15913. @item @@docbook
  15914. Enter Docbook completely. Pair with @code{@@end docbook}. @xref{Raw
  15915. Formatter Commands}.
  15916. @item @@documentdescription
  15917. Set the document description text, included in the HTML output. Pair
  15918. with @code{@@end documentdescription}. @xref{@code{@@documentdescription}}.
  15919. @item @@documentencoding @var{enc}
  15920. Declare the input encoding to be @var{enc}.
  15921. @xref{@code{@@documentencoding}}.
  15922. @item @@documentlanguage @var{CC}
  15923. Declare the document language as the two-character ISO-639 abbreviation
  15924. @var{CC}. @xref{@code{@@documentlanguage}}.
  15925. @item @@dotaccent@{@var{c}@}
  15926. Generate a dot accent over the character @var{c}, as in @dotaccent{o}.
  15927. @xref{Inserting Accents}.
  15928. @item @@dotless@{@var{i-or-j}@}
  15929. Generate dotless i (`@dotless{i}') and dotless j (`@dotless{j}').
  15930. @xref{Inserting Accents}.
  15931. @item @@dots@{@}
  15932. Generate an ellipsis, @samp{@dots{}}.
  15933. @xref{@code{@@dots}}.
  15934. @item @@email@{@var{address}[, @var{displayed-text}]@}
  15935. Indicate an electronic mail address. @xref{@code{@@email}}.
  15936. @item @@emph@{@var{text}@}
  15937. Emphasize @var{text}, by using @emph{italics} where possible, and
  15938. enclosing in asterisks in Info. @xref{Emphasis, , Emphasizing Text}.
  15939. @item @@end @var{environment}
  15940. Ends @var{environment}, as in @samp{@@end example}. @xref{Formatting
  15941. Commands,,@@-commands}.
  15942. @item @@enddots@{@}
  15943. Generate an end-of-sentence ellipsis, like this: @enddots{}
  15944. @xref{@code{@@dots}}.
  15945. @item @@enumerate [@var{number-or-letter}]
  15946. Begin a numbered list, using @code{@@item} for each entry.
  15947. Optionally, start list with @var{number-or-letter}. Pair with
  15948. @code{@@end enumerate}. @xref{@code{@@enumerate}}.
  15949. @item @@env@{@var{environment-variable}@}
  15950. Indicate an environment variable name, such as @env{PATH}.
  15951. @xref{@code{@@env}}.
  15952. @item @@equiv@{@}
  15953. Indicate to the reader the exact equivalence of two forms with a
  15954. glyph: @samp{@equiv{}}. @xref{@code{@@equiv}}.
  15955. @item @@error@{@}
  15956. Indicate to the reader with a glyph that the following text is
  15957. an error message: @samp{@error{}}. @xref{@code{@@error}}.
  15958. @item @@errormsg@{@var{msg}@}
  15959. Report @var{msg} as an error to standard error, and exit unsuccessfully.
  15960. Texinfo commands within @var{msg} are expanded to plain text.
  15961. @xref{Conditionals}, and @ref{External Macro Processors}.
  15962. @item @@euro@{@}
  15963. Generate the Euro currency sign. @xref{@code{@@euro}}.
  15964. @item @@evenfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
  15965. @itemx @@evenheading [@var{left}] @@| [@var{center}] @@| [@var{right}]
  15966. Specify page footings resp.@: headings for even-numbered (left-hand)
  15967. pages. @xref{Custom Headings, ,
  15968. How to Make Your Own Headings}.
  15969. @item @@everyfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
  15970. @itemx @@everyheading [@var{left}] @@| [@var{center}] @@| [@var{right}]
  15971. Specify page footings resp.@: headings for every page. Not relevant to
  15972. Info. @xref{Custom Headings, , How to Make Your Own Headings}.
  15973. @item @@example
  15974. Begin an example. Indent text, do not fill, and select fixed-width
  15975. font. Pair with @code{@@end example}. @xref{@code{@@example}}.
  15976. @item @@exampleindent @var{indent}
  15977. Indent example-like environments by @var{indent} number of spaces
  15978. (perhaps 0). @xref{@code{@@exampleindent}}.
  15979. @item @@exclamdown@{@}
  15980. Generate an upside-down exclamation point. @xref{Inserting Accents}.
  15981. @item @@exdent @var{line-of-text}
  15982. Remove any indentation a line might have. @xref{@code{@@exdent}}.
  15983. @item @@expansion@{@}
  15984. Indicate the result of a macro expansion to the reader with a special
  15985. glyph: @samp{@expansion{}}. @xref{@code{@@expansion}}.
  15986. @item @@file@{@var{filename}@}
  15987. Highlight the name of a file, buffer, node, directory, etc.
  15988. @xref{@code{@@file}}.
  15989. @item @@finalout
  15990. Prevent @TeX{} from printing large black warning rectangles beside
  15991. over-wide lines. @xref{Overfull hboxes}.
  15992. @item @@findex @var{entry}
  15993. Add @var{entry} to the index of functions. @xref{Index Entries, ,
  15994. Defining the Entries of an Index}.
  15995. @item @@firstparagraphindent @var{word}
  15996. Control indentation of the first paragraph after section headers
  15997. according to @var{word}, one of `none' or `insert'.
  15998. @xref{@code{@@firstparagraphindent}}.
  15999. @item @@float
  16000. Environment to define floating material. Pair with @code{@@end float}.
  16001. @xref{Floats}.
  16002. @item @@flushleft
  16003. @itemx @@flushright
  16004. Do not fill text; left (right) justify every line while leaving the
  16005. right (left) end ragged. Leave font as is. Pair with @code{@@end
  16006. flushleft} (@code{@@end flushright}). @xref{@code{@@flushleft
  16007. @@flushright}}.
  16008. @item @@fonttextsize @var{10-11}
  16009. Change the size of the main body font in the @TeX{} output.
  16010. @xref{Fonts}.
  16011. @item @@footnote@{@var{text-of-footnote}@}
  16012. Enter a footnote. Footnote text is printed at the bottom of the page
  16013. by @TeX{}; Info may format in either `End' node or `Separate' node style.
  16014. @xref{Footnotes}.
  16015. @item @@footnotestyle @var{style}
  16016. Specify an Info file's footnote style, either @samp{end} for the end
  16017. node style or @samp{separate} for the separate node style.
  16018. @xref{Footnotes}.
  16019. @item @@format
  16020. Begin a kind of example. Like @code{@@display}, but do not indent.
  16021. Pair with @code{@@end format}. @xref{@code{@@example}}.
  16022. @item @@frenchspacing @var{on-off}
  16023. Control spacing after punctuation. @xref{@code{@@frenchspacing}}.
  16024. @item @@ftable @var{formatting-command}
  16025. Begin a two-column table, using @code{@@item} for each entry.
  16026. Automatically enter each of the items in the first column into the
  16027. index of functions. Pair with @code{@@end ftable}. The same as
  16028. @code{@@table}, except for indexing. @xref{@code{@@ftable @@vtable}}.
  16029. @item @@geq@{@}
  16030. Generate a greater-than-or-equal sign, `@geq{}'. @xref{@code{@@geq @@leq}}.
  16031. @item @@group
  16032. Disallow page breaks within following text. Pair with @code{@@end
  16033. group}. Ignored in Info. @xref{@code{@@group}}.
  16034. @item @@guillemetleft@{@}
  16035. @itemx @@guillemetright@{@}
  16036. @item @@guillemotleft@{@}
  16037. @itemx @@guillemotright@{@}
  16038. @itemx @@guilsinglleft@{@}
  16039. @itemx @@guilsinglright@{@}
  16040. Double and single angle quotation marks: @guillemetleft{}
  16041. @guillemetright{} @guilsinglleft{} @guilsinglright{}.
  16042. @code{@@guillemotleft} and @code{@@guillemotright} are synonyms for
  16043. @code{@@guillemetleft} and @code{@@guillemetright}. @xref{Inserting
  16044. Quotation Marks}.
  16045. @item @@H@{@var{c}@}
  16046. Generate the long Hungarian umlaut accent over @var{c}, as in @H{o}.
  16047. @item @@hashchar@{@}
  16048. Insert a hash `#' character; only needed when a literal hash would
  16049. introduce @code{#line} directive. @xref{Inserting a Hashsign}, and
  16050. @ref{External Macro Processors}.
  16051. @item @@heading @var{title}
  16052. Print an unnumbered section-like heading, but omit from the table of
  16053. contents. In Info, the title is underlined with equal signs.
  16054. @xref{@code{@@unnumberedsec @@appendixsec @@heading}}.
  16055. @item @@headings @var{on-off-single-double}
  16056. Turn page headings on or off, and/or specify single-sided or double-sided
  16057. page headings for printing. @xref{@code{@@headings}}.
  16058. @item @@headitem
  16059. Begin a heading row in a multitable. @xref{Multitable Rows}.
  16060. @item @@headitemfont@{@var{text}@}
  16061. Set @var{text} in the font used for multitable heading rows; mostly
  16062. useful in multitable templates. @xref{Multitable Rows}.
  16063. @item @@html
  16064. Enter HTML completely. Pair with @code{@@end html}. @xref{Raw
  16065. Formatter Commands}.
  16066. @item @@hyphenation@{@var{hy-phen-a-ted words}@}
  16067. Explicitly define hyphenation points. @xref{@code{@@- @@hyphenation}}.
  16068. @item @@i@{@var{text}@}
  16069. Set @var{text} in an @i{italic} font. No effect in Info. @xref{Fonts}.
  16070. @item @@ifclear @var{txivar}
  16071. If the Texinfo variable @var{txivar} is not set, format the following
  16072. text. Pair with @code{@@end ifclear}. @xref{@code{@@set @@clear
  16073. @@value}}.
  16074. @item @@ifcommanddefined @var{txicmd}
  16075. @itemx @@ifcommandnotdefined @var{txicmd}
  16076. If the Texinfo code @samp{@@@var{txicmd}} is (not) defined, format the
  16077. follow text. Pair with the corresponding @code{@@end ifcommand...}.
  16078. @xref{Testing for Texinfo Commands}.
  16079. @item @@ifdocbook
  16080. @itemx @@ifhtml
  16081. @itemx @@ifinfo
  16082. Begin text that will appear only in the given output format.
  16083. @code{@@ifinfo} output appears in both Info and (for historical
  16084. compatibility) plain text output. Pair with @code{@@end ifdocbook}
  16085. resp.@: @code{@@end ifhtml} resp.@: @code{@@end ifinfo}.
  16086. @xref{Conditionals}.
  16087. @item @@ifnotdocbook
  16088. @itemx @@ifnothtml
  16089. @itemx @@ifnotplaintext
  16090. @itemx @@ifnottex
  16091. @itemx @@ifnotxml
  16092. Begin text to be ignored in one output format but not the others.
  16093. @code{@@ifnothtml} text is omitted from HTML output, etc. Pair with
  16094. the corresponding @code{@@end ifnot@var{format}}.
  16095. @xref{Conditionals}.
  16096. @item @@ifnotinfo
  16097. Begin text to appear in output other than Info and (for historical
  16098. compatibility) plain text. Pair with @code{@@end ifnotinfo}.
  16099. @xref{Conditionals}.
  16100. @item @@ifplaintext
  16101. Begin text that will appear only in the plain text output.
  16102. Pair with @code{@@end ifplaintext}. @xref{Conditionals}.
  16103. @item @@ifset @var{txivar}
  16104. If the Texinfo variable @var{txivar} is set, format the following
  16105. text. Pair with @code{@@end ifset}. @xref{@code{@@set @@clear
  16106. @@value}}.
  16107. @item @@iftex
  16108. Begin text to appear only in the @TeX{} output. Pair with @code{@@end
  16109. iftex}. @xref{Conditionals, , Conditionally Visible Text}.
  16110. @item @@ifxml
  16111. Begin text that will appear only in the XML output. Pair with
  16112. @code{@@end ifxml}. @xref{Conditionals}.
  16113. @item @@ignore
  16114. Begin text that will not appear in any output. Pair with @code{@@end
  16115. ignore}. @xref{Comments, , Comments and Ignored Text}.
  16116. @item @@image@{@var{filename}, [@var{width}], [@var{height}], [@var{alt}], [@var{ext}]@}
  16117. Include graphics image in external @var{filename} scaled to the given
  16118. @var{width} and/or @var{height}, using @var{alt} text and looking for
  16119. @samp{@var{filename}.@var{ext}} in HTML@. @xref{Images}.
  16120. @item @@include @var{filename}
  16121. Read the contents of Texinfo source file @var{filename}. @xref{Include Files}.
  16122. @item @@indent
  16123. Insert paragraph indentation. @xref{@code{@@indent}}.
  16124. @item @@indentedblock
  16125. Indent a block of arbitary text on the left. Pair with @code{@@end
  16126. indentedblock}. @xref{@code{@@indentedblock}}.
  16127. @item @@indicateurl@{@var{indicateurl}@}
  16128. Indicate text that is a uniform resource locator for the World Wide
  16129. Web. @xref{@code{@@indicateurl}}.
  16130. @item @@inforef@{@var{node-name}, [@var{entry-name}], @var{info-file-name}@}
  16131. Make a cross-reference to an Info file for which there is no printed
  16132. manual. @xref{@code{@@inforef}}.
  16133. @item @@inlinefmt@{@var{fmt}, @var{text}@}
  16134. Insert @var{text} only if the output format is @var{fmt}.
  16135. @xref{Inline Conditionals}.
  16136. @item @@inlinefmtifelse@{@var{fmt}, @var{text}, @var{else-text}@}
  16137. Insert @var{text} if the output format is @var{fmt}, else @var{else-text}.
  16138. @item @@inlineifclear@{@var{var}, @var{text}@}
  16139. @itemx @@inlineifset@{@var{var}, @var{text}@}
  16140. Insert @var{text} only if the Texinfo variable @var{var} is (not) set.
  16141. @item @@inlineraw@{@var{fmt}, @var{raw-text}@}
  16142. Insert @var{text} as in a raw conditional, only if the output format
  16143. is @var{fmt}.
  16144. @item \input @var{macro-definitions-file}
  16145. Use the specified macro definitions file. This command is used only
  16146. in the first line of a Texinfo file to cause @TeX{} to make use of the
  16147. @file{texinfo} macro definitions file. The @code{\} in @code{\input}
  16148. is used instead of an @code{@@} because @TeX{} does not recognize
  16149. @code{@@} until after it has read the definitions file. @xref{Texinfo
  16150. File Header}.
  16151. @item @@insertcopying
  16152. Insert the text previously defined with the @code{@@copying}
  16153. environment. @xref{@code{@@insertcopying}}.
  16154. @item @@item
  16155. Indicate the beginning of a marked paragraph for @code{@@itemize} and
  16156. @code{@@enumerate}; indicate the beginning of the text of a first column
  16157. entry for @code{@@table}, @code{@@ftable}, and @code{@@vtable}.
  16158. @xref{Lists and Tables}.
  16159. @item @@itemize @var{mark-generating-character-or-command}
  16160. Begin an unordered list: indented paragraphs with a mark, such as
  16161. @code{@@bullet}, inside the left margin at the beginning of each item.
  16162. Pair with @code{@@end itemize}. @xref{@code{@@itemize}}.
  16163. @item @@itemx
  16164. Like @code{@@item} but do not generate extra vertical space above the
  16165. item text. Thus, when several items have the same description, use
  16166. @code{@@item} for the first and @code{@@itemx} for the others.
  16167. @xref{@code{@@itemx}}.
  16168. @item @@kbd@{@var{keyboard-characters}@}
  16169. Indicate characters of input to be typed by users. @xref{@code{@@kbd}}.
  16170. @item @@kbdinputstyle @var{style}
  16171. Specify when @code{@@kbd} should use a font distinct from
  16172. @code{@@code} according to @var{style}: @code{code}, @code{distinct},
  16173. @code{example}. @xref{@code{@@kbd}}.
  16174. @item @@key@{@var{key-name}@}
  16175. Indicate the name of a key on a keyboard. @xref{@code{@@key}}.
  16176. @item @@kindex @var{entry}
  16177. Add @var{entry} to the index of keys.
  16178. @xref{Index Entries, , Defining the Entries of an Index}.
  16179. @item @@L@{@}
  16180. @itemx @@l@{@}
  16181. Generate the uppercase and lowercase Polish suppressed-L letters,
  16182. respectively: @L{}, @l{}.
  16183. @item @@LaTeX@{@}
  16184. Generate the @LaTeX{} logo. @xref{@code{@@TeX @@LaTeX}}.
  16185. @item @@leq@{@}
  16186. Generate a less-than-or-equal sign, `@leq{}'. @xref{@code{@@geq @@leq}}.
  16187. @item @@lisp
  16188. Begin an example of Lisp code. Indent text, do not fill, and select
  16189. fixed-width font. Pair with @code{@@end lisp}. @xref{@code{@@lisp}}.
  16190. @item @@listoffloats
  16191. Produce a table-of-contents-like listing of @code{@@float}s.
  16192. @xref{@code{@@listoffloats}}.
  16193. @item @@lowersections
  16194. Change subsequent chapters to sections, sections to subsections, and so
  16195. on. @xref{Raise/lower sections, , @code{@@raisesections} and
  16196. @code{@@lowersections}}.
  16197. @item @@macro @var{macroname} @{@var{params}@}
  16198. Define a new Texinfo command @code{@@@var{macroname}@{@var{params}@}}.
  16199. Pair with @code{@@end macro}. @xref{Defining Macros}.
  16200. @item @@majorheading @var{title}
  16201. Print an unnumbered chapter-like heading, but omit from the table of
  16202. contents. This generates more vertical whitespace before the heading
  16203. than the @code{@@chapheading} command. @xref{@code{@@majorheading
  16204. @@chapheading}}.
  16205. @item @@math@{@var{mathematical-expression}@}
  16206. Format a mathematical expression. @xref{Inserting Math}.
  16207. @item @@menu
  16208. Mark the beginning of a menu of nodes. No effect in a printed manual.
  16209. Pair with @code{@@end menu}. @xref{Menus}.
  16210. @item @@minus@{@}
  16211. Generate a minus sign, `@minus{}'. @xref{@code{@@minus}}.
  16212. @item @@multitable @var{column-width-spec}
  16213. Begin a multi-column table. Begin each row with @code{@@item} or
  16214. @code{@@headitem}, and separate columns with @code{@@tab}. Pair with
  16215. @code{@@end multitable}. @xref{Multitable Column Widths}.
  16216. @item @@need @var{n}
  16217. Start a new page in a printed manual if fewer than @var{n} mils
  16218. (thousandths of an inch) remain on the current page.
  16219. @xref{@code{@@need}}.
  16220. @item @@node @var{name}, @var{next}, @var{previous}, @var{up}
  16221. Begin a new node. @xref{Writing a Node}.
  16222. @item @@noindent
  16223. Prevent text from being indented as if it were a new paragraph.
  16224. @xref{@code{@@noindent}}.
  16225. @item @@novalidate
  16226. Suppress validation of node references and omit creation of auxiliary
  16227. files with @TeX{}. Use before any sectioning or cross-reference
  16228. commands. @xref{Pointer Validation}.
  16229. @item @@O@{@}
  16230. @itemx @@o@{@}
  16231. Generate the uppercase and lowercase O-with-slash letters, respectively:
  16232. @O{}, @o{}.
  16233. @item @@oddfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
  16234. @itemx @@oddheading [@var{left}] @@| [@var{center}] @@| [@var{right}]
  16235. Specify page footings resp.@: headings for odd-numbered (right-hand)
  16236. pages. @xref{Custom Headings, ,
  16237. How to Make Your Own Headings}.
  16238. @item @@OE@{@}
  16239. @itemx @@oe@{@}
  16240. Generate the uppercase and lowercase OE ligatures, respectively:
  16241. @OE{}, @oe{}. @xref{Inserting Accents}.
  16242. @item @@ogonek@{@var{c}@}
  16243. Generate an ogonek diacritic under the next character, as in
  16244. @ogonek{a}. @xref{Inserting Accents}.
  16245. @item @@option@{@var{option-name}@}
  16246. Indicate a command-line option, such as @option{-l} or
  16247. @option{--help}. @xref{@code{@@option}}.
  16248. @item @@ordf@{@}
  16249. @itemx @@ordm@{@}
  16250. Generate the feminine and masculine Spanish ordinals, respectively:
  16251. @ordf{}, @ordm{}. @xref{Inserting Accents}.
  16252. @item @@page
  16253. Start a new page in a printed manual. No effect in Info.
  16254. @xref{@code{@@page}}.
  16255. @item @@pagesizes [@var{width}][, @var{height}]
  16256. Change page dimensions. @xref{pagesizes}.
  16257. @item @@paragraphindent @var{indent}
  16258. Indent paragraphs by @var{indent} number of spaces (perhaps 0); preserve
  16259. source file indentation if @var{indent} is @code{asis}.
  16260. @xref{@code{@@paragraphindent}}.
  16261. @item @@part @var{title}
  16262. Begin a group of chapters or appendixes; included in the tables of
  16263. contents and produces a page of its own in printed output.
  16264. @xref{@code{@@part}}.
  16265. @item @@pindex @var{entry}
  16266. Add @var{entry} to the index of programs. @xref{Index Entries, , Defining
  16267. the Entries of an Index}.
  16268. @item @@point@{@}
  16269. Indicate the position of point in a buffer to the reader with a glyph:
  16270. @samp{@point{}}. @xref{@code{@@point}}.
  16271. @item @@pounds@{@}
  16272. Generate the pounds sterling currency sign.
  16273. @xref{@code{@@pounds}}.
  16274. @item @@print@{@}
  16275. Indicate printed output to the reader with a glyph: @samp{@print{}}.
  16276. @xref{@code{@@print}}.
  16277. @item @@printindex @var{index-name}
  16278. Generate the alphabetized index for @var{index-name} (using two
  16279. columns in a printed manual). @xref{Printing Indices & Menus}.
  16280. @item @@pxref@{@var{node}, [@var{entry}], [@var{node-title}], [@var{info-file}], [@var{manual}]@}
  16281. Make a reference that starts with a lowercase `see' in a printed
  16282. manual. Use within parentheses only. Only the first argument is
  16283. mandatory. @xref{@code{@@pxref}}.
  16284. @item @@questiondown@{@}
  16285. Generate an upside-down question mark. @xref{Inserting Accents}.
  16286. @item @@quotation
  16287. Narrow the margins to indicate text that is quoted from another work.
  16288. Takes optional argument specifying prefix text, e.g., an author name.
  16289. Pair with @code{@@end quotation}. @xref{@code{@@quotation}}.
  16290. @item @@quotedblleft@{@}
  16291. @itemx @@quotedblright@{@}
  16292. @itemx @@quoteleft@{@}
  16293. @itemx @@quoteright@{@}
  16294. @itemx @@quotedblbase@{@}
  16295. @itemx @@quotesinglbase@{@}
  16296. Produce various quotation marks: @quotedblleft{} @quotedblright{}
  16297. @quoteleft{} @quoteright{} @quotedblbase{} @quotesinglbase{}.
  16298. @xref{Inserting Quotation Marks}.
  16299. @item @@r@{@var{text}@}
  16300. Set @var{text} in the regular @r{roman} font. No effect in Info.
  16301. @xref{Fonts}.
  16302. @item @@raggedright
  16303. Fill text; left justify every line while leaving the right end ragged.
  16304. Leave font as is. Pair with @code{@@end raggedright}. No effect in
  16305. Info. @xref{@code{@@raggedright}}.
  16306. @item @@raisesections
  16307. Change subsequent sections to chapters, subsections to sections, and so
  16308. on. @xref{Raise/lower sections}.
  16309. @item @@ref@{@var{node}, [@var{entry}], [@var{node-title}], [@var{info-file}], [@var{manual}]@}
  16310. Make a plain reference that does not start with any special text.
  16311. Follow command with a punctuation mark. Only the first argument is
  16312. mandatory. @xref{@code{@@ref}}.
  16313. @item @@refill
  16314. @findex refill
  16315. This command used to refill and indent the paragraph after all the
  16316. other processing has been done. It is no longer needed, since all
  16317. formatters now automatically refill as needed, but you may still see
  16318. it in the source to some manuals, as it does no harm.
  16319. @item @@registeredsymbol@{@}
  16320. Generate the legal symbol @registeredsymbol{}.
  16321. @xref{@code{@@registeredsymbol}}.
  16322. @item @@result@{@}
  16323. Indicate the result of an expression to the reader with a special
  16324. glyph: @samp{@result{}}. @xref{@code{@@result}}.
  16325. @item @@ringaccent@{@var{c}@}
  16326. Generate a ring accent over the next character, as in @ringaccent{o}.
  16327. @xref{Inserting Accents}.
  16328. @item @@samp@{@var{text}@}
  16329. Indicate a literal example of a sequence of characters, in general.
  16330. Quoted in Info output. @xref{@code{@@samp}}.
  16331. @item @@sansserif@{@var{text}@}
  16332. Set @var{text} in a @sansserif{sans serif} font if possible. No
  16333. effect in Info. @xref{Fonts}.
  16334. @item @@sc@{@var{text}@}
  16335. Set @var{text} in a small caps font in printed output, and uppercase
  16336. in Info. @xref{Smallcaps}.
  16337. @item @@section @var{title}
  16338. Begin a section within a chapter. The section title appears in the
  16339. table of contents. In Info, the title is underlined with equal signs.
  16340. Within @code{@@chapter} and @code{@@appendix}, the section title is
  16341. numbered; within @code{@@unnumbered}, the section is unnumbered.
  16342. @xref{@code{@@section}}.
  16343. @item @@set @var{txivar} [@var{string}]
  16344. Define the Texinfo variable @var{txivar}, optionally to the value
  16345. @var{string}. @xref{@code{@@set @@clear @@value}}.
  16346. @item @@setchapternewpage @var{on-off-odd}
  16347. Specify whether chapters start on new pages, and if so, whether on
  16348. odd-numbered (right-hand) new pages. @xref{@code{@@setchapternewpage}}.
  16349. @item @@setfilename @var{info-file-name}
  16350. Provide a name to be used for the output files. This command is ignored
  16351. for @TeX{} formatting. @xref{@code{@@setfilename}}.
  16352. @item @@settitle @var{title}
  16353. Specify the title for page headers in a printed manual, and the
  16354. default document title for HTML @samp{<head>}.
  16355. @xref{@code{@@settitle}}.
  16356. @item @@shortcaption
  16357. Define the short caption for a @code{@@float}. @xref{@code{@@caption
  16358. @@shortcaption}}.
  16359. @item @@shortcontents
  16360. Print a short table of contents, with chapter-level entries only. Not
  16361. relevant to Info, which uses menus rather than tables of contents.
  16362. @xref{Contents, , Generating a Table of Contents}.
  16363. @item @@shorttitlepage @var{title}
  16364. Generate a minimal title page. @xref{@code{@@titlepage}}.
  16365. @item @@slanted@{@var{text}@}
  16366. Set @var{text} in a @slanted{slanted} font if possible. No effect
  16367. in Info. @xref{Fonts}.
  16368. @item @@smallbook
  16369. Cause @TeX{} to produce a printed manual in a 7 by 9.25 inch format
  16370. rather than the regular 8.5 by 11 inch format.
  16371. @xref{@code{@@smallbook}}. Also, see @ref{@code{@@small@dots{}}}.
  16372. @item @@smalldisplay
  16373. Begin a kind of example. Like @code{@@display}, but use a smaller
  16374. font size where possible. Pair with @code{@@end smalldisplay}.
  16375. @xref{@code{@@small@dots{}}}.
  16376. @item @@smallexample
  16377. Begin an example. Like @code{@@example}, but use a smaller font size
  16378. where possible. Pair with @code{@@end smallexample}.
  16379. @xref{@code{@@small@dots{}}}.
  16380. @item @@smallformat
  16381. Begin a kind of example. Like @code{@@format}, but use a smaller font
  16382. size where possible. Pair with @code{@@end smallformat}.
  16383. @xref{@code{@@small@dots{}}}.
  16384. @item @@smallindentedblock
  16385. Like @code{@@indentedblock}, but use a smaller font size where
  16386. possible. Pair with @code{@@end smallindentedblock}.
  16387. @xref{@code{@@small@dots{}}}.
  16388. @item @@smalllisp
  16389. Begin an example of Lisp code. Same as @code{@@smallexample}. Pair
  16390. with @code{@@end smalllisp}. @xref{@code{@@small@dots{}}}.
  16391. @item @@smallquotation
  16392. Like @code{@@quotation}, but use a smaller font size where possible.
  16393. Pair with @code{@@end smallquotation}. @xref{@code{@@small@dots{}}}.
  16394. @item @@sortas @{@var{key}@}
  16395. Used in the arguments to index commands to give a string by which the
  16396. index entry should be sorted. @xref{Indexing Commands}.
  16397. @item @@sp @var{n}
  16398. Skip @var{n} blank lines. @xref{@code{@@sp}}.
  16399. @item @@ss@{@}
  16400. Generate the German sharp-S es-zet letter, @ss{}. @xref{Inserting Accents}.
  16401. @item @@strong @{@var{text}@}
  16402. Emphasize @var{text} more strongly than @code{@@emph}, by using
  16403. @strong{boldface} where possible; enclosed in asterisks in Info.
  16404. @xref{emph & strong, , Emphasizing Text}.
  16405. @item @@sub @{@var{text}@}
  16406. Set @var{text} as a subscript. @xref{Inserting Subscripts and Superscripts}.
  16407. @item @@subheading @var{title}
  16408. Print an unnumbered subsection-like heading, but omit from the table
  16409. of contents of a printed manual. In Info, the title is underlined
  16410. with hyphens. @xref{@code{@@unnumberedsubsec @@appendixsubsec @@subheading}}.
  16411. @item @@subsection @var{title}
  16412. Begin a subsection within a section. The subsection title appears in
  16413. the table of contents. In Info, the title is underlined with hyphens.
  16414. Same context-dependent numbering as @code{@@section}.
  16415. @xref{@code{@@subsection}}.
  16416. @item @@subsubheading @var{title}
  16417. Print an unnumbered subsubsection-like heading, but omit from the
  16418. table of contents of a printed manual. In Info, the title is
  16419. underlined with periods. @xref{@code{@@subsubsection}}.
  16420. @item @@subsubsection @var{title}
  16421. Begin a subsubsection within a subsection. The subsubsection title
  16422. appears in the table of contents. In Info, the title is underlined
  16423. with periods. Same context-dependent numbering as @code{@@section}.
  16424. @xref{@code{@@subsubsection}}.
  16425. @item @@subtitle @var{title}
  16426. In a printed manual, set a subtitle in a normal sized font flush to
  16427. the right-hand side of the page. Not relevant to Info, which does not
  16428. have title pages. @xref{@code{@@title @@subtitle @@author}}.
  16429. @item @@summarycontents
  16430. Print a short table of contents. Synonym for @code{@@shortcontents}.
  16431. @xref{Contents, , Generating a Table of Contents}.
  16432. @item @@sup @{@var{text}@}
  16433. Set @var{text} as a superscript. @xref{Inserting Subscripts and Superscripts}.
  16434. @item @@syncodeindex @var{from-index} @var{to-index}
  16435. Merge the index named in the first argument into the index named in
  16436. the second argument, formatting the entries from the first index with
  16437. @code{@@code}. @xref{Combining Indices}.
  16438. @item @@synindex @var{from-index} @var{to-index}
  16439. Merge the index named in the first argument into the index named in
  16440. the second argument. Do not change the font of @var{from-index}
  16441. entries. @xref{Combining Indices}.
  16442. @item @@t@{@var{text}@}
  16443. Set @var{text} in a @t{fixed-width}, typewriter-like font. No effect
  16444. in Info. @xref{Fonts}.
  16445. @item @@tab
  16446. Separate columns in a row of a multitable. @xref{Multitable Rows}.
  16447. @item @@table @var{formatting-command}
  16448. Begin a two-column table (description list), using @code{@@item} for
  16449. each entry. Write each first column entry on the same line as
  16450. @code{@@item}. First column entries are printed in the font resulting
  16451. from @var{formatting-command}. Pair with @code{@@end table}.
  16452. @xref{Two-column Tables, , Making a Two-column Table}. Also see
  16453. @ref{@code{@@ftable @@vtable}}, and @ref{@code{@@itemx}}.
  16454. @item @@TeX@{@}
  16455. Generate the @TeX{} logo. @xref{@code{@@TeX @@LaTeX}}.
  16456. @item @@tex
  16457. Enter @TeX{} completely. Pair with @code{@@end tex}. @xref{Raw
  16458. Formatter Commands}.
  16459. @item @@textdegree@{@}
  16460. Generate the degree symbol. @xref{@code{@@textdegree}}.
  16461. @item @@thischapter
  16462. @itemx @@thischaptername
  16463. @itemx @@thischapternum
  16464. @itemx @@thisfile
  16465. @itemx @@thispage
  16466. @itemx @@thistitle
  16467. Only allowed in a heading or footing. Stands for, respectively, the
  16468. number and name of the current chapter (in the format `Chapter 1:
  16469. Title'), the current chapter name only, the current chapter number
  16470. only, the filename, the current page number, and the title of the
  16471. document, respectively. @xref{Custom Headings, , How to Make Your Own
  16472. Headings}.
  16473. @item @@TH@{@}
  16474. @itemx @@th@{@}
  16475. Generate the uppercase and lowercase Icelandic letter thorn, respectively:
  16476. @TH{}, @th{}. @xref{Inserting Accents}.
  16477. @item @@tie@{@}
  16478. Generate a normal interword space at which a line break is not
  16479. allowed. @xref{@code{@@tie}}.
  16480. @item @@tieaccent@{@var{cc}@}
  16481. Generate a tie-after accent over the next two characters @var{cc}, as in
  16482. `@tieaccent{oo}'. @xref{Inserting Accents}.
  16483. @item @@tindex @var{entry}
  16484. Add @var{entry} to the index of data types. @xref{Index Entries, ,
  16485. Defining the Entries of an Index}.
  16486. @item @@title @var{title}
  16487. In a printed manual, set a title flush to the left-hand side of the
  16488. page in a larger than normal font and underline it with a black rule.
  16489. Not relevant to Info, which does not have title pages.
  16490. @xref{@code{@@title @@subtitle @@author}}.
  16491. @item @@titlefont@{@var{text}@}
  16492. In a printed manual, print @var{text} in a larger than normal font.
  16493. @xref{@code{@@titlefont @@center @@sp}}.
  16494. @item @@titlepage
  16495. Begin the title page. Write the command on a line of its own, paired
  16496. with @code{@@end titlepage}. Nothing between @code{@@titlepage} and
  16497. @code{@@end titlepage} appears in Info. @xref{@code{@@titlepage}}.
  16498. @item @@today@{@}
  16499. Insert the current date, in `1 Jan 1900' style. @xref{Custom
  16500. Headings, , How to Make Your Own Headings}.
  16501. @item @@top @var{title}
  16502. Mark the topmost @code{@@node} in the file, which must be defined on
  16503. the line immediately preceding the @code{@@top} command. The title is
  16504. formatted as a chapter-level heading. The entire top node, including
  16505. the @code{@@node} and @code{@@top} lines, are normally enclosed with
  16506. @code{@@ifnottex ... @@end ifnottex}. In @TeX{} and
  16507. @code{texinfo-format-buffer}, the @code{@@top} command is merely a
  16508. synonym for @code{@@unnumbered}. @xref{@command{makeinfo} Pointer
  16509. Creation}.
  16510. @item @@U@{@var{hex}@}
  16511. Output a representation of Unicode character U+@var{hex}.
  16512. @xref{Inserting Unicode}.
  16513. @item @@u@{@var{c}@}
  16514. @itemx @@ubaraccent@{@var{c}@}
  16515. @itemx @@udotaccent@{@var{c}@}
  16516. Generate a breve, underbar, or underdot accent, respectively, over or
  16517. under the character @var{c}, as in @u{o}, @ubaraccent{o},
  16518. @udotaccent{o}. @xref{Inserting Accents}.
  16519. @item @@unmacro @var{macroname}
  16520. Undefine the macro @code{@@@var{macroname}} if it has been defined.
  16521. @xref{Defining Macros}.
  16522. @item @@unnumbered @var{title}
  16523. Begin a chapter that appears without chapter numbers of any kind. The
  16524. title appears in the table of contents. In Info, the title is
  16525. underlined with asterisks. @xref{@code{@@unnumbered @@appendix}}.
  16526. @item @@unnumberedsec @var{title}
  16527. Begin a section that appears without section numbers of any kind. The
  16528. title appears in the table of contents of a printed manual. In Info,
  16529. the title is underlined with equal signs. @xref{@code{@@unnumberedsec
  16530. @@appendixsec @@heading}}.
  16531. @item @@unnumberedsubsec @var{title}
  16532. Begin an unnumbered subsection. The title appears in the table of
  16533. contents. In Info, the title is underlined with hyphens.
  16534. @xref{@code{@@unnumberedsubsec @@appendixsubsec @@subheading}}.
  16535. @item @@unnumberedsubsubsec @var{title}
  16536. Begin an unnumbered subsubsection. The title appears in the table of
  16537. contents. In Info, the title is underlined with periods.
  16538. @xref{@code{@@subsubsection}}.
  16539. @item @@uref@{@var{url}[, @var{displayed-text}][, @var{replacement}@}
  16540. @itemx @@url@{@var{url}[, @var{displayed-text}][, @var{replacement}@}
  16541. Define a cross-reference to an external uniform resource locator,
  16542. e.g., for the World Wide Web. @xref{@code{@@url}}.
  16543. @item @@urefbreakstyle @var{style}
  16544. Specify how @code{@@uref}/@code{@@url} should break at special
  16545. characters: @code{after}, @code{before}, @code{none}.
  16546. @xref{@code{@@url}}.
  16547. @item @@v@{@var{c}@}
  16548. Generate check accent over the character @var{c}, as in @v{o}.
  16549. @xref{Inserting Accents}.
  16550. @item @@validatemenus @var{on-off}
  16551. Control whether menus can be automatically generated. @xref{Writing a
  16552. Menu}.
  16553. @item @@value@{@var{txivar}@}
  16554. Insert the value, if any, of the Texinfo variable @var{txivar},
  16555. previously defined by @code{@@set}. @xref{@code{@@set @@clear
  16556. @@value}}.
  16557. @item @@var@{@var{metasyntactic-variable}@}
  16558. Highlight a metasyntactic variable, which is something that stands for
  16559. another piece of text. @xref{@code{@@var}}.
  16560. @item @@verb@{@var{delim} @var{literal} @var{delim}@}
  16561. Output @var{literal}, delimited by the single character @var{delim},
  16562. exactly as is (in the fixed-width font), including any whitespace or
  16563. Texinfo special characters. @xref{@code{@@verb}}.
  16564. @item @@verbatim
  16565. Output the text of the environment exactly as is (in the fixed-width
  16566. font). Pair with @code{@@end verbatim}. @xref{@code{@@verbatim}}.
  16567. @item @@verbatiminclude @var{filename}
  16568. Output the contents of @var{filename} exactly as is (in the
  16569. fixed-width font). @xref{@code{@@verbatiminclude}}.
  16570. @item @@vindex @var{entry}
  16571. Add @var{entry} to the index of variables. @xref{Index Entries, ,
  16572. Defining the Entries of an Index}.
  16573. @item @@vskip @var{amount}
  16574. In a printed manual, insert whitespace so as to push text on the
  16575. remainder of the page towards the bottom of the page. Used in
  16576. formatting the copyright page with the argument @samp{0pt plus
  16577. 1filll}. (Note spelling of @samp{filll}.) @code{@@vskip} may be used
  16578. only in contexts ignored for Info. @xref{Copyright}.
  16579. @item @@vtable @var{formatting-command}
  16580. Begin a two-column table, using @code{@@item} for each entry.
  16581. Automatically enter each of the items in the first column into the
  16582. index of variables. Pair with @code{@@end vtable}. The same as
  16583. @code{@@table}, except for indexing. @xref{@code{@@ftable @@vtable}}.
  16584. @item @@w@{@var{text}@}
  16585. Disallow line breaks within @var{text}. @xref{@code{@@w}}.
  16586. @item @@xml
  16587. Enter XML completely. Pair with @code{@@end xml}. @xref{Raw
  16588. Formatter Commands}.
  16589. @item @@xref@{@var{node}, [@var{entry}], [@var{node-title}], [@var{info-file}], [@var{manual}]@}
  16590. Make a reference that starts with `See' in a printed manual. Follow
  16591. command with a punctuation mark. Only the first argument is
  16592. mandatory. @xref{@code{@@xref}}.
  16593. @item @@xrefautomaticsectiontitle @var{on-off}
  16594. By default, use the section title instead of the node name in cross
  16595. references. @xref{Three Arguments}.
  16596. @end table
  16597. @node Command Contexts
  16598. @section @@-Command Contexts
  16599. @cindex Contexts, of @@-commands
  16600. Here we describe approximately which @@-commands can be used in which
  16601. contexts. It not exhaustive or meant to be a complete reference.
  16602. Discrepancies between the information here and the @code{makeinfo} or
  16603. @TeX{} implementations are most likely to be resolved in favor of the
  16604. implementation.
  16605. By @dfn{general text} below, we mean anything except sectioning and
  16606. other such outer-level document commands, such as @code{@@section},
  16607. @code{@@node}, and @code{@@setfilename}.
  16608. @code{@@c}, @code{@@comment} and @code{@@if ... @@end if} conditional
  16609. commands may appear anywhere (except the conditionals must still be on
  16610. lines by themselves). @code{@@caption} may only appear in
  16611. @code{@@float} but may contain general text. @code{@@footnote}
  16612. content likewise.
  16613. @@-commands with braces marking text (such as @code{@@strong},
  16614. @code{@@sc}, @code{@@asis}) may contain raw formatter commands such as
  16615. @code{@@html} but no other block commands (other commands terminated
  16616. by @code{@@end}) and may not be split across paragraphs, but may
  16617. otherwise contain general text.
  16618. In addition to the block command restriction, on @code{@@center},
  16619. @code{@@exdent} and @code{@@item} in @code{@@table} lines, @@-commands
  16620. that makes only sense in a paragraph are not accepted, such as
  16621. @code{@@indent}.
  16622. In addition to the above, sectioning commands cannot contain
  16623. @code{@@anchor}, @code{@@footnote} or @code{@@verb}.
  16624. In addition to the above, remaining commands (@code{@@node},
  16625. @code{@@anchor}, @code{@@printindex}, @code{@@ref}, @code{@@math},
  16626. @code{@@cindex}, @code{@@url}, @code{@@image}, and so on) cannot
  16627. contain cross-reference commands (@code{@@ref}, @code{@@xref},
  16628. @code{@@pxref} and @code{@@inforef}). In one last addition,
  16629. @code{@@shortcaption} may only appear inside @code{@@float}.
  16630. For precise and complete information, we suggest looking into the
  16631. test suite in the sources, which exhaustively tries combinations.
  16632. @node Obsolete @@-Commands
  16633. @section Obsolete @@-Commands
  16634. Here are Texinfo @@-commands which are obsolete or have been removed
  16635. completely. This section is for historical purposes.
  16636. @ftable @code
  16637. @item @@setcontentsaftertitlepage
  16638. @cindex Contents, after title page
  16639. @cindex Table of contents, after title page
  16640. In the past, the contents commands were sometimes placed at the end of
  16641. the file, after any indices and just before the @code{@@bye}, but we
  16642. no longer recommend this.
  16643. This command could be used by a user printing a manual, to force the
  16644. contents to be printed after the title page
  16645. (after the @samp{@@end titlepage} line)
  16646. even if the @code{@@contents} command was at the end of the manual. It
  16647. now does nothing.
  16648. @item @@setshortcontentsaftertitlepage
  16649. This placed the short table of contents after the @samp{@@end titlepage}
  16650. command even if the @code{@@shortcontents} command was at the end. It
  16651. now does nothing.
  16652. @end ftable
  16653. @node Tips
  16654. @appendix Tips and Hints
  16655. Here are some tips for writing Texinfo documentation:
  16656. @cindex Tips
  16657. @cindex Usage tips
  16658. @cindex Hints
  16659. @itemize @bullet
  16660. @item
  16661. Write in the present tense, not in the past or the future.
  16662. @item
  16663. Write actively! For example, write ``We recommend that @dots{}'' rather
  16664. than ``It is recommended that @dots{}''.
  16665. @item
  16666. Use 70 or 72 as your fill column. Longer lines are hard to read.
  16667. @item
  16668. Include a copyright notice and copying permissions.
  16669. @end itemize
  16670. @subsubheading Index, Index, Index!
  16671. Write many index entries, in different ways.
  16672. Readers like indices; they are helpful and convenient.
  16673. Although it is easiest to write index entries as you write the body of
  16674. the text, some people prefer to write entries afterwards. In either
  16675. case, write an entry before the paragraph to which it applies. This
  16676. way, an index entry points to the first page of a paragraph that is
  16677. split across pages.
  16678. Here are more index-related hints we have found valuable:
  16679. @itemize @bullet
  16680. @item
  16681. Write each index entry differently, so each entry refers to a different
  16682. place in the document.
  16683. @item
  16684. Write index entries only where a topic is discussed significantly. For
  16685. example, it is not useful to index ``debugging information'' in a
  16686. chapter on reporting bugs. Someone who wants to know about debugging
  16687. information will certainly not find it in that chapter.
  16688. @item
  16689. Consistently capitalize the first word of every concept index entry,
  16690. or else consistently use lowercase. Terse entries often call for
  16691. lowercase; longer entries for capitalization. Whichever case
  16692. convention you use, please use one or the other consistently! Mixing
  16693. the two styles looks bad.
  16694. @item
  16695. Always capitalize or use uppercase for those words in an index for
  16696. which this is proper, such as names of countries or acronyms. Always
  16697. use the appropriate case for case-sensitive names, such as those in C or
  16698. Lisp.
  16699. @item
  16700. Write the indexing commands that refer to a whole section immediately
  16701. after the section command, and write the indexing commands that refer to
  16702. a paragraph before that paragraph.
  16703. In the example that follows, a blank line comes after the index
  16704. entry for ``Leaping'':
  16705. @example
  16706. @group
  16707. @@section The Dog and the Fox
  16708. @@cindex Jumping, in general
  16709. @@cindex Leaping
  16710. @@cindex Dog, lazy, jumped over
  16711. @@cindex Lazy dog jumped over
  16712. @@cindex Fox, jumps over dog
  16713. @@cindex Quick fox jumps over dog
  16714. The quick brown fox jumps over the lazy dog.
  16715. @end group
  16716. @end example
  16717. @noindent
  16718. (Note that the example shows entries for the same concept that are
  16719. written in different ways---@samp{Lazy dog}, and @samp{Dog, lazy}---so
  16720. readers can look up the concept in different ways.)
  16721. @end itemize
  16722. @subsubheading Blank Lines
  16723. @itemize @bullet
  16724. @item
  16725. Insert a blank line between a sectioning command and the first following
  16726. sentence or paragraph, or between the indexing commands associated with
  16727. the sectioning command and the first following sentence or paragraph, as
  16728. shown in the tip on indexing. It makes the source easier to read.
  16729. @item
  16730. Always insert a blank line before a @code{@@table} command and after an
  16731. @code{@@end table} command; but never insert a blank line after an
  16732. @code{@@table} command.
  16733. @need 1000
  16734. For example,
  16735. @example
  16736. @group
  16737. Types of fox:
  16738. @@table @@samp
  16739. @@item Quick
  16740. Jump over lazy dogs.
  16741. @end group
  16742. @group
  16743. @@item Brown
  16744. Also jump over lazy dogs.
  16745. @@end table
  16746. @end group
  16747. @group
  16748. @@noindent
  16749. On the other hand, @dots{}
  16750. @end group
  16751. @end example
  16752. Insert blank lines before and after @code{@@itemize} @dots{} @code{@@end
  16753. itemize} and @code{@@enumerate} @dots{} @code{@@end enumerate} in the
  16754. same way.
  16755. @end itemize
  16756. @subsubheading Complete Phrases
  16757. Complete phrases are easier to read than @dots{}
  16758. @itemize @bullet
  16759. @item
  16760. Write entries in an itemized list as complete sentences; or at least, as
  16761. complete phrases. Incomplete expressions @dots{} awkward @dots{} like
  16762. this.
  16763. @item
  16764. Write the prefatory sentence or phrase for a multi-item list or table as
  16765. a complete expression. Do not write ``You can set:''; instead, write
  16766. ``You can set these variables:''. The former expression sounds cut off.
  16767. @end itemize
  16768. @subsubheading Editions, Dates and Versions
  16769. Include edition numbers, version numbers, and dates in the
  16770. @code{@@copying} text (for people reading the Texinfo file, and for the
  16771. legal copyright in the output files). Then use @code{@@insertcopying}
  16772. in the @code{@@titlepage} section for people reading the printed
  16773. output (@pxref{Short Sample}).
  16774. It is easiest to handle such version information using @code{@@set}
  16775. and @code{@@value}. @xref{@code{@@value} Example}, and @ref{GNU
  16776. Sample Texts}.
  16777. @subsubheading Definition Commands
  16778. Definition commands are @code{@@deffn}, @code{@@defun},
  16779. @code{@@defmac}, and the like, and enable you to write descriptions in
  16780. a uniform format.
  16781. @itemize @bullet
  16782. @item
  16783. Write just one definition command for each entity you define with a
  16784. definition command. The automatic indexing feature creates an index
  16785. entry that leads the reader to the definition.
  16786. @item
  16787. Use @code{@@table} @dots{} @code{@@end table} in an appendix that
  16788. contains a summary of functions, not @code{@@deffn} or other definition
  16789. commands.
  16790. @end itemize
  16791. @subsubheading Capitalization
  16792. @itemize @bullet
  16793. @item
  16794. Capitalize ``Texinfo''; it is a name. Do not write the @samp{x} or
  16795. @samp{i} in uppercase.
  16796. @item
  16797. Capitalize ``Info''; it is a name.
  16798. @item
  16799. Write @TeX{} using the @code{@@TeX@{@}} command. Note the uppercase
  16800. @samp{T} and @samp{X}. This command causes the formatters to
  16801. typeset the name according to the wishes of Donald Knuth, who wrote
  16802. @TeX{}. (Likewise @code{@@LaTeX@{@}} for @LaTeX{}.)
  16803. @end itemize
  16804. @subsubheading Spaces
  16805. Do not use spaces to format a Texinfo file, except inside of
  16806. @code{@@example} @dots{} @code{@@end example} and other literal
  16807. environments and commands.
  16808. @need 700
  16809. For example, @TeX{} fills the following:
  16810. @example
  16811. @group
  16812. @@kbd@{C-x v@}
  16813. @@kbd@{M-x vc-next-action@}
  16814. Perform the next logical operation
  16815. on the version-controlled file
  16816. corresponding to the current buffer.
  16817. @end group
  16818. @end example
  16819. @need 950
  16820. @noindent
  16821. so it looks like this:
  16822. @iftex
  16823. @quotation
  16824. @kbd{C-x v}
  16825. @kbd{M-x vc-next-action}
  16826. Perform the next logical operation on the version-controlled file
  16827. corresponding to the current buffer.
  16828. @end quotation
  16829. @end iftex
  16830. @ifnottex
  16831. @quotation
  16832. `C-x v' `M-x vc-next-action' Perform the next logical operation on the
  16833. version-controlled file corresponding to the current buffer.
  16834. @end quotation
  16835. @end ifnottex
  16836. @noindent
  16837. In this case, the text should be formatted with
  16838. @code{@@table}, @code{@@item}, and @code{@@itemx}, to create a table.
  16839. @subsubheading @@code, @@samp, @@var, and @samp{---}
  16840. @itemize @bullet
  16841. @item
  16842. Use @code{@@code} around Lisp symbols, including command names.
  16843. For example,
  16844. @example
  16845. The main function is @@code@{vc-next-action@}, @dots{}
  16846. @end example
  16847. @item
  16848. Avoid putting letters such as @samp{s} immediately after an
  16849. @samp{@@code}. Such letters look bad.
  16850. @item
  16851. Use @code{@@var} around meta-variables. Do not write angle brackets
  16852. around them.
  16853. @item
  16854. Use three hyphens in a row, @samp{---}, to indicate a long dash. @TeX{}
  16855. typesets these as a long dash and the Info formatters reduce three
  16856. hyphens to two.
  16857. @end itemize
  16858. @subsubheading Periods Outside of Quotes
  16859. Place periods and other punctuation marks @emph{outside} of quotations,
  16860. unless the punctuation is part of the quotation. This practice goes
  16861. against some publishing conventions in the United States, but enables the
  16862. reader to distinguish between the contents of the quotation and the
  16863. whole passage.
  16864. For example, you should write the following sentence with the period
  16865. outside the end quotation marks:
  16866. @example
  16867. Evidently, @samp{au} is an abbreviation for ``author''.
  16868. @end example
  16869. @noindent
  16870. since @samp{au} does @emph{not} serve as an abbreviation for
  16871. @samp{author.} (with a period following the word).
  16872. @subsubheading Introducing New Terms
  16873. @itemize @bullet
  16874. @item
  16875. Introduce new terms so that a reader who does not know them can
  16876. understand them from context; or write a definition for the term.
  16877. For example, in the following, the terms ``check in'', ``register'' and
  16878. ``delta'' are all appearing for the first time; the example sentence should be
  16879. rewritten so they are understandable.
  16880. @quotation
  16881. The major function assists you in checking in a file to your
  16882. version control system and registering successive sets of changes to
  16883. it as deltas.
  16884. @end quotation
  16885. @item
  16886. Use the @code{@@dfn} command around a word being introduced, to indicate
  16887. that the reader should not expect to know the meaning already, and
  16888. should expect to learn the meaning from this passage.
  16889. @end itemize
  16890. @subsubheading Program Invocation Nodes
  16891. You can invoke programs such as Emacs, GCC, and @code{gawk} from a
  16892. shell. The documentation for each program should contain a section that
  16893. describes this. Unfortunately, if the node names and titles for these
  16894. sections are all different, they are difficult for users to find.
  16895. So, there is a convention to name such sections with a phrase beginning
  16896. with the word `Invoking', as in `Invoking Emacs'; this way, users can
  16897. find the section easily.
  16898. @subsubheading ANSI C Syntax
  16899. When you use @code{@@example} to describe a C function's calling
  16900. conventions, use the ANSI C syntax, like this:
  16901. @example
  16902. void dld_init (char *@@var@{path@});
  16903. @end example
  16904. @noindent
  16905. And in the subsequent discussion, refer to the argument values by
  16906. writing the same argument names, again highlighted with
  16907. @code{@@var}.
  16908. @need 800
  16909. Avoid the obsolete style that looks like this:
  16910. @example
  16911. #include <dld.h>
  16912. dld_init (path)
  16913. char *path;
  16914. @end example
  16915. Also, it is best to avoid writing @code{#include} above the
  16916. declaration just to indicate that the function is declared in a
  16917. header file. The practice may give the misimpression that the
  16918. @code{#include} belongs near the declaration of the function. Either
  16919. state explicitly which header file holds the declaration or, better
  16920. yet, name the header file used for a group of functions at the
  16921. beginning of the section that describes the functions.
  16922. @anchor{texi-elements-by-size}
  16923. @subsubheading Node Length
  16924. Keep nodes (sections) to a reasonable length, whatever reasonable
  16925. might be in the given context. Don't hesitate to break up long nodes
  16926. into subnodes and have an extensive tree structure; that's what it's
  16927. there for. Many times, readers will probably try to find a single
  16928. specific point in the manual, using search, indexing, or just plain
  16929. guessing, rather than reading the whole thing from beginning to end.
  16930. You can use the @command{texi-elements-by-size} utility to see a list
  16931. of all nodes (or sections) in the document, sorted by size (either
  16932. lines or words), to find candidates for splitting. It's in the
  16933. @file{util/} subdirectory of the Texinfo sources.
  16934. @subsubheading Bad Examples
  16935. Here are several examples of bad writing to avoid:
  16936. In this example, say, `` @dots{} you must @code{@@dfn}@{check
  16937. in@} the new version.'' That flows better.
  16938. @quotation
  16939. When you are done editing the file, you must perform a
  16940. @code{@@dfn}@{check in@}.
  16941. @end quotation
  16942. In the following example, say, ``@dots{} makes a unified interface such as VC
  16943. mode possible.''
  16944. @quotation
  16945. SCCS, RCS and other version-control systems all perform similar
  16946. functions in broadly similar ways (it is this resemblance which makes
  16947. a unified control mode like this possible).
  16948. @end quotation
  16949. And in this example, you should specify what `it' refers to:
  16950. @quotation
  16951. If you are working with other people, it assists in coordinating
  16952. everyone's changes so they do not step on each other.
  16953. @end quotation
  16954. @subsubheading And Finally @dots{}
  16955. @itemize @bullet
  16956. @item
  16957. Pronounce @TeX{} as if the @samp{X} were a Greek `chi', as the last
  16958. sound in the name `Bach'. But pronounce Texinfo as in `speck':
  16959. ``teckinfo''.
  16960. @item
  16961. Write notes for yourself at the very end of a Texinfo file after the
  16962. @code{@@bye}. None of the formatters process text after the
  16963. @code{@@bye}; it is as if the text were within @code{@@ignore} @dots{}
  16964. @code{@@end ignore}.
  16965. @end itemize
  16966. @node Sample Texinfo Files
  16967. @appendix Sample Texinfo Files
  16968. @cindex Sample Texinfo files
  16969. The first example from the first chapter (@pxref{Short Sample}) is
  16970. given here in its entirety, without commentary. The second example
  16971. includes the full texts to be used in GNU manuals.
  16972. @menu
  16973. * Short Sample Texinfo File::
  16974. * GNU Sample Texts::
  16975. * Verbatim Copying License::
  16976. * All-permissive Copying License::
  16977. @end menu
  16978. @node Short Sample Texinfo File
  16979. @section Short Sample
  16980. @cindex Sample Texinfo file, no comments
  16981. Here is a complete, short sample Texinfo file. You can see this file,
  16982. with comments, in the first chapter. @xref{Short Sample}.
  16983. In a nutshell: The @command{makeinfo} program transforms a Texinfo
  16984. source file such as this into an Info file or HTML; and @TeX{} typesets
  16985. it for a printed manual.
  16986. @sp 1
  16987. @example
  16988. \input texinfo
  16989. @@settitle Sample Manual 1.0
  16990. @@copying
  16991. This is a short example of a complete Texinfo file.
  16992. Copyright @@copyright@{@} 2016 Free Software Foundation, Inc.
  16993. @@end copying
  16994. @@titlepage
  16995. @@title Sample Title
  16996. @@page
  16997. @@vskip 0pt plus 1filll
  16998. @@insertcopying
  16999. @@end titlepage
  17000. @@c Output the table of the contents at the beginning.
  17001. @@contents
  17002. @@ifnottex
  17003. @@node Top
  17004. @@top GNU Sample
  17005. This manual is for GNU Sample
  17006. (version @@value@{VERSION@}, @@value@{UPDATED@}).
  17007. @@end ifnottex
  17008. @@menu
  17009. * First Chapter:: The first chapter is the
  17010. only chapter in this sample.
  17011. * Index:: Complete index.
  17012. @@end menu
  17013. @@node First Chapter
  17014. @@chapter First Chapter
  17015. @@cindex chapter, first
  17016. This is the first chapter.
  17017. @@cindex index entry, another
  17018. Here is a numbered list.
  17019. @@enumerate
  17020. @@item
  17021. This is the first item.
  17022. @@item
  17023. This is the second item.
  17024. @@end enumerate
  17025. @@node Index
  17026. @@unnumbered Index
  17027. @@printindex cp
  17028. @@bye
  17029. @end example
  17030. @node GNU Sample Texts
  17031. @section GNU Sample Texts
  17032. @cindex GNU sample texts
  17033. @cindex Sample texts, GNU
  17034. @cindex Full texts, GNU
  17035. Following is a sample Texinfo document with the full texts that should
  17036. be used (adapted as necessary) in GNU manuals.
  17037. As well as the legal texts, it also serves as a practical example of how
  17038. many elements in a GNU system can affect the manual. If you're not
  17039. familiar with all these different elements, don't worry. They're not
  17040. required and a perfectly good manual can be written without them.
  17041. They're included here nonetheless because many manuals do (or could)
  17042. benefit from them.
  17043. @xref{Short Sample}, for a minimal example of a Texinfo file.
  17044. @xref{Beginning and Ending a File}, for a full explanation of that
  17045. minimal example.
  17046. Here are some notes on the example:
  17047. @itemize @bullet
  17048. @item
  17049. @cindex $Id
  17050. @cindex CVS $Id
  17051. @cindex RCS $Id
  17052. @cindex Documentation identification
  17053. @cindex Identification of documentation
  17054. The @samp{$Id:} comment is for the CVS
  17055. (@url{http://www.nongnu.org/cvs/}), RCS (@pxref{Top,,, rcs, Revision
  17056. Control System}) and other version control systems, which expand it
  17057. into a string such as:
  17058. @example
  17059. $Id$
  17060. @end example
  17061. (This is potentially useful in all sources that use version control,
  17062. not just manuals.) You may wish to include the @samp{$Id:} comment in
  17063. the @code{@@copying} text, if you want a completely unambiguous
  17064. reference to the documentation source version.
  17065. If you want to literally write @t{@w{$}Id$}, use @code{@@w}:
  17066. @code{@@w@{$@}Id$}. Unfortunately, this technique does not work in
  17067. plain text output, where it's not clear what should be done.
  17068. @item
  17069. @pindex automake@r{, and version info}
  17070. @vindex UPDATED @r{Automake variable}
  17071. @vindex VERSION @r{Automake variable}
  17072. @pindex time-stamp.el
  17073. The @file{version.texi} in the @code{@@include} command is maintained
  17074. automatically by Automake (@pxref{Top,,, automake, GNU Automake}). It
  17075. sets the @samp{VERSION} and @samp{UPDATED} values used elsewhere. If
  17076. your distribution doesn't use Automake, but you do use Emacs, you may
  17077. find the time-stamp.el package helpful (@pxref{Time Stamps,,, emacs,
  17078. The GNU Emacs Manual}).
  17079. @item
  17080. The @code{@@syncodeindex} command reflects the recommendation to use
  17081. only one index where possible, to make it easier for readers to look up
  17082. index entries.
  17083. @item
  17084. The @code{@@dircategory} is for constructing the Info directory.
  17085. @xref{Installing Dir Entries}, which includes a variety of recommended
  17086. category names.
  17087. @item
  17088. The `Invoking' node is a GNU standard to help users find the basic
  17089. information about command-line usage of a given program. @xref{Manual
  17090. Structure Details,,, standards, GNU Coding Standards}.
  17091. @item
  17092. @cindex GNU Free Documentation License, including entire
  17093. @cindex Free Documentation License, including entire
  17094. It is best to include the entire GNU Free Documentation License in a GNU
  17095. manual, unless the manual is only a few pages long. Of course this
  17096. sample is even shorter than that, but it includes the FDL anyway in
  17097. order to show one conventional way to do so. The @file{fdl.texi} file
  17098. is available on the GNU machines and in the Texinfo and other GNU
  17099. source distributions.
  17100. The FDL provides for omitting itself under certain conditions, but in
  17101. that case the sample texts given here have to be modified. @xref{GNU
  17102. Free Documentation License}.
  17103. @item
  17104. If the FSF is not the copyright holder, then use the appropriate name.
  17105. @item
  17106. If your manual is published on paper by the FSF or is longer than 400
  17107. pages, you should include the standard FSF cover texts (@pxref{License
  17108. Notices for Documentation,,, maintain, GNU Maintainer Information}).
  17109. @item
  17110. For documents that express your personal views, feelings or
  17111. experiences, it is more appropriate to use a license permitting only
  17112. verbatim copying, rather than the FDL@. @xref{Verbatim Copying
  17113. License}.
  17114. @end itemize
  17115. Here is the sample document:
  17116. @verbatim
  17117. \input texinfo @c -*-texinfo-*-
  17118. @comment $Id@w{$}
  17119. @comment %**start of header
  17120. @include version.texi
  17121. @settitle GNU Sample @value{VERSION}
  17122. @syncodeindex pg cp
  17123. @comment %**end of header
  17124. @copying
  17125. This manual is for GNU Sample (version @value{VERSION}, @value{UPDATED}),
  17126. which is an example in the Texinfo documentation.
  17127. Copyright @copyright{} 2016 Free Software Foundation, Inc.
  17128. @quotation
  17129. Permission is granted to copy, distribute and/or modify this document
  17130. under the terms of the GNU Free Documentation License, Version 1.3 or
  17131. any later version published by the Free Software Foundation; with no
  17132. Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
  17133. Texts. A copy of the license is included in the section entitled
  17134. ``GNU Free Documentation License''.
  17135. @end quotation
  17136. @end copying
  17137. @dircategory Texinfo documentation system
  17138. @direntry
  17139. * sample: (sample)Invoking sample.
  17140. @end direntry
  17141. @titlepage
  17142. @title GNU Sample
  17143. @subtitle for version @value{VERSION}, @value{UPDATED}
  17144. @author A.U. Thor (@email{bug-sample@@gnu.org})
  17145. @page
  17146. @vskip 0pt plus 1filll
  17147. @insertcopying
  17148. @end titlepage
  17149. @contents
  17150. @ifnottex
  17151. @node Top
  17152. @top GNU Sample
  17153. This manual is for GNU Sample (version @value{VERSION}, @value{UPDATED}).
  17154. @end ifnottex
  17155. @menu
  17156. * Invoking sample::
  17157. * GNU Free Documentation License::
  17158. * Index::
  17159. @end menu
  17160. @node Invoking sample
  17161. @chapter Invoking sample
  17162. @pindex sample
  17163. @cindex invoking @command{sample}
  17164. This is a sample manual. There is no sample program to
  17165. invoke, but if there were, you could see its basic usage
  17166. and command line options here.
  17167. @node GNU Free Documentation License
  17168. @appendix GNU Free Documentation License
  17169. @include fdl.texi
  17170. @node Index
  17171. @unnumbered Index
  17172. @printindex cp
  17173. @bye
  17174. @end verbatim
  17175. @node Verbatim Copying License
  17176. @section Verbatim Copying License
  17177. @cindex Verbatim copying license
  17178. @cindex License for verbatim copying
  17179. For software manuals and other documentation, it is critical to use a
  17180. license permitting free redistribution and updating, so that when a free
  17181. program is changed, the documentation can be updated as well.
  17182. On the other hand, for documents that express your personal views,
  17183. feelings or experiences, it is more appropriate to use a license
  17184. permitting only verbatim copying.
  17185. Here is sample text for such a license permitting verbatim copying only.
  17186. This is just the license text itself. For a complete sample document,
  17187. see the previous sections.
  17188. @verbatim
  17189. @copying
  17190. This document is a sample for allowing verbatim copying only.
  17191. Copyright @copyright{} 2016 Free Software Foundation, Inc.
  17192. @quotation
  17193. Permission is granted to make and distribute verbatim copies
  17194. of this entire document without royalty provided the
  17195. copyright notice and this permission notice are preserved.
  17196. @end quotation
  17197. @end copying
  17198. @end verbatim
  17199. @node All-permissive Copying License
  17200. @section All-permissive Copying License
  17201. @cindex All-permissive copying license
  17202. @cindex License for all-permissive copying
  17203. For software manuals and other documentation, it is important to use a
  17204. license permitting free redistribution and updating, so that when a free
  17205. program is changed, the documentation can be updated as well.
  17206. On the other hand, for small supporting files, short manuals (under 300
  17207. lines long) and rough documentation (README files, INSTALL files, etc.),
  17208. the full FDL would be overkill. They can use a simple all-permissive
  17209. license.
  17210. Here is sample text for such an all-permissive license. This is just
  17211. the license text itself. For a complete sample document, see the
  17212. previous sections.
  17213. @example
  17214. Copyright @@copyright@{@} 2016 Free Software Foundation, Inc.
  17215. Copying and distribution of this file, with or without modification,
  17216. are permitted in any medium without royalty provided the copyright
  17217. notice and this notice are preserved.
  17218. @end example
  17219. @node Texinfo Mode
  17220. @appendix Using Texinfo Mode
  17221. @cindex Texinfo mode
  17222. @cindex Mode, using Texinfo
  17223. @cindex GNU Emacs
  17224. @cindex Emacs
  17225. You may edit a Texinfo file with any text editor you choose. A Texinfo
  17226. file is no different from any other ASCII file. However, GNU Emacs
  17227. comes with a special mode, called Texinfo mode, that provides Emacs
  17228. commands and tools to help ease your work.
  17229. @menu
  17230. * Texinfo Mode Overview:: How Texinfo mode can help you.
  17231. * Emacs Editing:: Texinfo mode adds to GNU Emacs' general
  17232. purpose editing features.
  17233. * Inserting:: How to insert frequently used @@-commands.
  17234. * Showing the Structure:: How to show the structure of a file.
  17235. * Updating Nodes and Menus:: How to update or create new nodes and menus.
  17236. * Info Formatting:: How to format for Info.
  17237. * Printing:: How to format and print part or all of a file.
  17238. * Texinfo Mode Summary:: Summary of all the Texinfo mode commands.
  17239. @end menu
  17240. @node Texinfo Mode Overview
  17241. @section Texinfo Mode Overview
  17242. Texinfo mode provides special features for working with Texinfo files.
  17243. You can:
  17244. @itemize @bullet
  17245. @item
  17246. Insert frequently used @@-commands.
  17247. @item
  17248. Automatically create @code{@@node} lines.
  17249. @item
  17250. Show the structure of a Texinfo source file.
  17251. @item
  17252. Automatically create or update the `Next',
  17253. `Previous', and `Up' pointers of a node.
  17254. @item
  17255. Automatically create or update menus.
  17256. @item
  17257. Automatically create a master menu.
  17258. @item
  17259. Format a part or all of a file for Info.
  17260. @item
  17261. Typeset and print part or all of a file.
  17262. @end itemize
  17263. Perhaps the two most helpful features are those for inserting frequently
  17264. used @@-commands and for creating node pointers and menus.
  17265. @node Emacs Editing
  17266. @section The Usual GNU Emacs Editing Commands
  17267. In most cases, the usual Text mode commands work the same in Texinfo
  17268. mode as they do in Text mode. Texinfo mode adds new editing commands
  17269. and tools to GNU Emacs' general purpose editing features. The major
  17270. difference concerns filling. In Texinfo mode, the paragraph
  17271. separation variable and syntax table are redefined so that Texinfo
  17272. commands that should be on lines of their own are not inadvertently
  17273. included in paragraphs. Thus, the @kbd{M-q} (@code{fill-paragraph})
  17274. command will refill a paragraph but not mix an indexing command on a
  17275. line adjacent to it into the paragraph.
  17276. In addition, Texinfo mode sets the @code{page-delimiter} variable to
  17277. the value of @code{texinfo-chapter-level-regexp}; by default, this is
  17278. a regular expression matching the commands for chapters and their
  17279. equivalents, such as appendices. With this value for the page
  17280. delimiter, you can jump from chapter title to chapter title with the
  17281. @kbd{C-x ]} (@code{forward-page}) and @kbd{C-x [}
  17282. (@code{backward-page}) commands and narrow to a chapter with the
  17283. @kbd{C-x n p} (@code{narrow-to-page}) command. (@xref{Pages, , ,emacs,
  17284. The GNU Emacs Manual}, for details about the page commands.)
  17285. You may name a Texinfo file however you wish, but the convention is to
  17286. end a Texinfo file name with one of the extensions
  17287. @file{.texinfo}, @file{.texi}, @file{.txi}, or @file{.tex}. A longer
  17288. extension is preferred, since it is explicit, but a shorter extension
  17289. may be necessary for operating systems that limit the length of file
  17290. names. GNU Emacs automatically enters Texinfo mode when you visit a
  17291. file with a @file{.texinfo}, @file{.texi} or @file{.txi}
  17292. extension. Also, Emacs switches to Texinfo mode
  17293. when you visit a
  17294. file that has @samp{-*-texinfo-*-} in its first line. If ever you are
  17295. in another mode and wish to switch to Texinfo mode, type @code{M-x
  17296. texinfo-mode}.
  17297. Like all other Emacs features, you can customize or enhance Texinfo
  17298. mode as you wish. In particular, the keybindings are very easy to
  17299. change. The keybindings described here are the default or standard
  17300. ones.
  17301. @node Inserting
  17302. @section Inserting Frequently Used Commands
  17303. @cindex Inserting frequently used commands
  17304. @cindex Frequently used commands, inserting
  17305. @cindex Commands, inserting them
  17306. Texinfo mode provides commands to insert various frequently used
  17307. @@-commands into the buffer. You can use these commands to save
  17308. keystrokes.
  17309. The insert commands are invoked by typing @kbd{C-c} twice and then the
  17310. first letter of the @@-command:
  17311. @table @kbd
  17312. @item C-c C-c c
  17313. @itemx M-x texinfo-insert-@@code
  17314. @findex texinfo-insert-@@code
  17315. Insert @code{@@code@{@}} and put the
  17316. cursor between the braces.
  17317. @item C-c C-c d
  17318. @itemx M-x texinfo-insert-@@dfn
  17319. @findex texinfo-insert-@@dfn
  17320. Insert @code{@@dfn@{@}} and put the
  17321. cursor between the braces.
  17322. @item C-c C-c e
  17323. @itemx M-x texinfo-insert-@@end
  17324. @findex texinfo-insert-@@end
  17325. Insert @code{@@end} and attempt to insert the correct following word,
  17326. such as @samp{example} or @samp{table}. (This command does not handle
  17327. nested lists correctly, but inserts the word appropriate to the
  17328. immediately preceding list.)
  17329. @item C-c C-c i
  17330. @itemx M-x texinfo-insert-@@item
  17331. @findex texinfo-insert-@@item
  17332. Insert @code{@@item} and put the
  17333. cursor at the beginning of the next line.
  17334. @item C-c C-c k
  17335. @itemx M-x texinfo-insert-@@kbd
  17336. @findex texinfo-insert-@@kbd
  17337. Insert @code{@@kbd@{@}} and put the
  17338. cursor between the braces.
  17339. @item C-c C-c n
  17340. @itemx M-x texinfo-insert-@@node
  17341. @findex texinfo-insert-@@node
  17342. Insert @code{@@node} and a comment line
  17343. listing the sequence for the `Next',
  17344. `Previous', and `Up' nodes.
  17345. Leave point after the @code{@@node}.
  17346. @item C-c C-c o
  17347. @itemx M-x texinfo-insert-@@noindent
  17348. @findex texinfo-insert-@@noindent
  17349. Insert @code{@@noindent} and put the
  17350. cursor at the beginning of the next line.
  17351. @item C-c C-c s
  17352. @itemx M-x texinfo-insert-@@samp
  17353. @findex texinfo-insert-@@samp
  17354. Insert @code{@@samp@{@}} and put the
  17355. cursor between the braces.
  17356. @item C-c C-c t
  17357. @itemx M-x texinfo-insert-@@table
  17358. @findex texinfo-insert-@@table
  17359. Insert @code{@@table} followed by a @key{SPC}
  17360. and leave the cursor after the @key{SPC}.
  17361. @item C-c C-c v
  17362. @itemx M-x texinfo-insert-@@var
  17363. @findex texinfo-insert-@@var
  17364. Insert @code{@@var@{@}} and put the
  17365. cursor between the braces.
  17366. @item C-c C-c x
  17367. @itemx M-x texinfo-insert-@@example
  17368. @findex texinfo-insert-@@example
  17369. Insert @code{@@example} and put the
  17370. cursor at the beginning of the next line.
  17371. @c M-@{ was the binding for texinfo-insert-braces;
  17372. @c in Emacs 19, backward-paragraph will take this binding.
  17373. @item C-c C-c @{
  17374. @itemx M-x texinfo-insert-braces
  17375. @findex texinfo-insert-braces
  17376. Insert @code{@{@}} and put the cursor between the braces.
  17377. @item C-c @}
  17378. @itemx C-c ]
  17379. @itemx M-x up-list
  17380. @findex up-list
  17381. Move from between a pair of braces forward past the closing brace.
  17382. Typing @kbd{C-c ]} is easier than typing @kbd{C-c @}}, which
  17383. is, however, more mnemonic; hence the two keybindings. (Also, you can
  17384. move out from between braces by typing @kbd{C-f}.)
  17385. @end table
  17386. To put a command such as @w{@code{@@code@{@dots{}@}}} around an
  17387. @emph{existing} word, position the cursor in front of the word and type
  17388. @kbd{C-u 1 C-c C-c c}. This makes it easy to edit existing plain text.
  17389. The value of the prefix argument tells Emacs how many words following
  17390. point to include between braces---@samp{1} for one word, @samp{2} for
  17391. two words, and so on. Use a negative argument to enclose the previous
  17392. word or words. If you do not specify a prefix argument, Emacs inserts
  17393. the @@-command string and positions the cursor between the braces. This
  17394. feature works only for those @@-commands that operate on a word or words
  17395. within one line, such as @code{@@kbd} and @code{@@var}.
  17396. This set of insert commands was created after analyzing the frequency
  17397. with which different @@-commands are used in the @cite{GNU Emacs
  17398. Manual} and the @cite{GDB Manual}. If you wish to add your own insert
  17399. commands, you can bind a keyboard macro to a key, use abbreviations,
  17400. or extend the code in @file{texinfo.el}.
  17401. @findex texinfo-start-menu-description
  17402. @cindex Menu description, start
  17403. @cindex Description for menu, start
  17404. @kbd{C-c C-c C-d} (@code{texinfo-start-menu-description}) is an insert
  17405. command that works differently from the other insert commands. It
  17406. inserts a node's section or chapter title in the space for the
  17407. description in a menu entry line. (A menu entry has three parts, the
  17408. entry name, the node name, and the description. Only the node name is
  17409. required, but a description helps explain what the node is about.
  17410. @xref{Menu Parts, , The Parts of a Menu}.)
  17411. To use @code{texinfo-start-menu-description}, position point in a menu
  17412. entry line and type @kbd{C-c C-c C-d}. The command looks for and copies
  17413. the title that goes with the node name, and inserts the title as a
  17414. description; it positions point at beginning of the inserted text so you
  17415. can edit it. The function does not insert the title if the menu entry
  17416. line already contains a description.
  17417. This command is only an aid to writing descriptions; it does not do the
  17418. whole job. You must edit the inserted text since a title tends to use
  17419. the same words as a node name but a useful description uses different
  17420. words.
  17421. @node Showing the Structure
  17422. @section Showing the Sectioning Structure of a File
  17423. @cindex Showing the sectioning structure of a file
  17424. @cindex Sectioning structure of a file, showing
  17425. @cindex Structure of a file, showing
  17426. @cindex Outline of file structure, showing
  17427. @cindex Contents-like outline of file structure
  17428. @cindex File sectioning structure, showing
  17429. @cindex Texinfo file sectioning structure, showing
  17430. You can show the sectioning structure of a Texinfo file by using the
  17431. @kbd{C-c C-s} command (@code{texinfo-show-structure}). This command
  17432. lists the lines that begin with the @@-commands for @code{@@chapter},
  17433. @code{@@section}, and the like. It constructs what amounts to a table
  17434. of contents. These lines are displayed in another buffer called the
  17435. @samp{*Occur*} buffer. In that buffer, you can position the cursor
  17436. over one of the lines and use the @kbd{C-c C-c} command
  17437. (@code{occur-mode-goto-occurrence}), to jump to the corresponding spot
  17438. in the Texinfo file.
  17439. @table @kbd
  17440. @item C-c C-s
  17441. @itemx M-x texinfo-show-structure
  17442. @findex texinfo-show-structure
  17443. Show the @code{@@chapter}, @code{@@section}, and such lines of a
  17444. Texinfo file.
  17445. @item C-c C-c
  17446. @itemx M-x occur-mode-goto-occurrence
  17447. @findex occur-mode-goto-occurrence
  17448. Go to the line in the Texinfo file corresponding to the line under the
  17449. cursor in the @file{*Occur*} buffer.
  17450. @end table
  17451. If you call @code{texinfo-show-structure} with a prefix argument by
  17452. typing @w{@kbd{C-u C-c C-s}}, it will list not only those lines with the
  17453. @@-commands for @code{@@chapter}, @code{@@section}, and the like, but
  17454. also the @code{@@node} lines. You can use @code{texinfo-show-structure}
  17455. with a prefix argument to check whether the `Next', `Previous', and `Up'
  17456. pointers of an @code{@@node} line are correct.
  17457. Often, when you are working on a manual, you will be interested only
  17458. in the structure of the current chapter. In this case, you can mark
  17459. off the region of the buffer that you are interested in by using the
  17460. @kbd{C-x n n} (@code{narrow-to-region}) command and
  17461. @code{texinfo-show-structure} will work on only that region. To see
  17462. the whole buffer again, use @w{@kbd{C-x n w}} (@code{widen}).
  17463. (@xref{Narrowing, , , emacs, The GNU Emacs Manual}, for more
  17464. information about the narrowing commands.)
  17465. @vindex page-delimiter
  17466. @cindex Page delimiter in Texinfo mode
  17467. In addition to providing the @code{texinfo-show-structure} command,
  17468. Texinfo mode sets the value of the page delimiter variable to match
  17469. the chapter-level @@-commands. This enables you to use the @kbd{C-x
  17470. ]} (@code{forward-page}) and @kbd{C-x [} (@code{backward-page})
  17471. commands to move forward and backward by chapter, and to use the
  17472. @kbd{C-x n p} (@code{narrow-to-page}) command to narrow to a chapter.
  17473. @xref{Pages, , , emacs, The GNU Emacs Manual}, for more information
  17474. about the page commands.
  17475. @node Updating Nodes and Menus
  17476. @section Updating Nodes and Menus
  17477. @cindex Updating nodes and menus
  17478. @cindex Create nodes, menus automatically
  17479. @cindex Insert nodes, menus automatically
  17480. @cindex Automatically insert nodes, menus
  17481. Texinfo mode provides commands for automatically creating or updating
  17482. menus and node pointers. The commands are called ``update'' commands
  17483. because their most frequent use is for updating a Texinfo file after you
  17484. have worked on it; but you can use them to insert the `Next',
  17485. `Previous', and `Up' pointers into an @code{@@node} line that has none
  17486. and to create menus in a file that has none.
  17487. If you do not use any updating commands, you need to write menus by
  17488. hand, which is a tedious task.
  17489. @menu
  17490. * Updating Commands:: Five major updating commands.
  17491. * Updating Requirements:: How to structure a Texinfo file for
  17492. using the updating command.
  17493. * Other Updating Commands:: How to indent descriptions, insert
  17494. missing nodes lines, and update
  17495. nodes in sequence.
  17496. @end menu
  17497. @node Updating Commands
  17498. @subsection The Updating Commands
  17499. You can use the updating commands to:
  17500. @itemize @bullet
  17501. @item
  17502. insert or update the `Next', `Previous', and `Up' pointers of a node,
  17503. @item
  17504. insert or update the menu for a section, and
  17505. @item
  17506. create a master menu for a Texinfo source file.
  17507. @end itemize
  17508. You can also use the commands to update all the nodes and menus in a
  17509. region or in a whole Texinfo file.
  17510. The updating commands work only with conventional Texinfo files, which
  17511. are structured hierarchically like books. In such files, a structuring
  17512. command line must follow closely after each @code{@@node} line, except
  17513. for the `Top' @code{@@node} line. (A @dfn{structuring command line} is
  17514. a line beginning with @code{@@chapter}, @code{@@section}, or other
  17515. similar command.)
  17516. You can write the structuring command line on the line that follows
  17517. immediately after an @code{@@node} line or else on the line that
  17518. follows after a single @code{@@comment} line or a single
  17519. @code{@@ifinfo} line. You cannot interpose more than one line between
  17520. the @code{@@node} line and the structuring command line; and you may
  17521. interpose only a @code{@@comment} line or an @code{@@ifinfo} line.
  17522. Commands which work on a whole buffer require that the `Top' node be
  17523. followed by a node with a @code{@@chapter} or equivalent-level command.
  17524. The menu updating commands will not create a main or master menu for a
  17525. Texinfo file that has only @code{@@chapter}-level nodes! The menu
  17526. updating commands only create menus @emph{within} nodes for lower level
  17527. nodes. To create a menu of chapters, you must provide a `Top'
  17528. node.
  17529. The menu updating commands remove menu entries that refer to other Info
  17530. files since they do not refer to nodes within the current buffer. This
  17531. is a deficiency. Rather than use menu entries, you can use cross
  17532. references to refer to other Info files. None of the updating commands
  17533. affect cross-references.
  17534. Texinfo mode has five updating commands that are used most often: two
  17535. are for updating the node pointers or menu of a single node (or a
  17536. region); two are for updating every node pointer and menu in a file;
  17537. and one, the @code{texinfo-master-menu} command, is for creating a
  17538. master menu for a complete file, and optionally, for updating every
  17539. node and menu in the whole Texinfo file.
  17540. The @code{texinfo-master-menu} command is the primary command:
  17541. @table @kbd
  17542. @item C-c C-u m
  17543. @itemx M-x texinfo-master-menu
  17544. @findex texinfo-master-menu
  17545. Create or update a master menu that includes all the other menus
  17546. (incorporating the descriptions from pre-existing menus, if
  17547. any).
  17548. With an argument (prefix argument, @kbd{C-u,} if interactive), first create or
  17549. update all the nodes and all the regular menus in the buffer before
  17550. constructing the master menu. (@xref{The Top Node, , The Top Node and
  17551. Master Menu}, for more about a master menu.)
  17552. For @code{texinfo-master-menu} to work, the Texinfo file must have a
  17553. `Top' node and at least one subsequent node.
  17554. After extensively editing a Texinfo file, you can type the following:
  17555. @example
  17556. C-u M-x texinfo-master-menu
  17557. @exdent or
  17558. C-u C-c C-u m
  17559. @end example
  17560. @noindent
  17561. This updates all the nodes and menus completely and all at once.
  17562. @end table
  17563. The other major updating commands do smaller jobs and are designed for
  17564. the person who updates nodes and menus as he or she writes a Texinfo
  17565. file.
  17566. @need 1000
  17567. The commands are:
  17568. @table @kbd
  17569. @item C-c C-u C-n
  17570. @itemx M-x texinfo-update-node
  17571. @findex texinfo-update-node
  17572. Insert the `Next', `Previous', and `Up' pointers for the node that point is
  17573. within (i.e., for the @code{@@node} line preceding point). If the
  17574. @code{@@node} line has pre-existing `Next', `Previous', or `Up'
  17575. pointers in it, the old pointers are removed and new ones inserted.
  17576. With an argument (prefix argument, @kbd{C-u}, if interactive), this command
  17577. updates all @code{@@node} lines in the region (which is the text
  17578. between point and mark).
  17579. @item C-c C-u C-m
  17580. @itemx M-x texinfo-make-menu
  17581. @findex texinfo-make-menu
  17582. Create or update the menu in the node that point is within.
  17583. With an argument (@kbd{C-u} as prefix argument, if
  17584. interactive), the command makes or updates menus for the
  17585. nodes which are either within or a part of the
  17586. region.
  17587. Whenever @code{texinfo-make-menu} updates an existing menu, the
  17588. descriptions from that menu are incorporated into the new menu. This
  17589. is done by copying descriptions from the existing menu to the entries
  17590. in the new menu that have the same node names. If the node names are
  17591. different, the descriptions are not copied to the new menu.
  17592. @item C-c C-u C-e
  17593. @itemx M-x texinfo-every-node-update
  17594. @findex texinfo-every-node-update
  17595. Insert or update the `Next', `Previous', and `Up' pointers for every
  17596. node in the buffer.
  17597. @item C-c C-u C-a
  17598. @itemx M-x texinfo-all-menus-update
  17599. @findex texinfo-all-menus-update
  17600. Create or update all the menus in the buffer. With an argument
  17601. (@kbd{C-u} as prefix argument, if interactive), first insert
  17602. or update all the node
  17603. pointers before working on the menus.
  17604. If a master menu exists, the @code{texinfo-all-menus-update} command
  17605. updates it; but the command does not create a new master menu if none
  17606. already exists. (Use the @code{texinfo-master-menu} command for
  17607. that.)
  17608. When working on a document that does not merit a master menu, you can
  17609. type the following:
  17610. @example
  17611. C-u C-c C-u C-a
  17612. @exdent or
  17613. C-u M-x texinfo-all-menus-update
  17614. @end example
  17615. @noindent
  17616. This updates all the nodes and menus.
  17617. @end table
  17618. The @code{texinfo-column-for-description} variable specifies the
  17619. column to which menu descriptions are indented. By default, the value
  17620. is 32 although it can be useful to reduce it to as low as 24. You
  17621. can set the variable via customization (@pxref{Customization,,,
  17622. emacs, The GNU Emacs Manual}) or with the @kbd{M-x set-variable}
  17623. command (@pxref{Examining, , Examining and Setting Variables, emacs,
  17624. The GNU Emacs Manual}).
  17625. Also, the @code{texinfo-indent-menu-description} command may be used to
  17626. indent existing menu descriptions to a specified column. Finally, if
  17627. you wish, you can use the @code{texinfo-insert-node-lines} command to
  17628. insert missing @code{@@node} lines into a file. (@xref{Other Updating
  17629. Commands}, for more information.)
  17630. @node Updating Requirements
  17631. @subsection Updating Requirements
  17632. @cindex Updating requirements
  17633. @cindex Requirements for updating commands
  17634. To use the updating commands, you must organize the Texinfo file
  17635. hierarchically with chapters, sections, subsections, and the like.
  17636. When you construct the hierarchy of the manual, do not `jump down'
  17637. more than one level at a time: you can follow the `Top' node with a
  17638. chapter, but not with a section; you can follow a chapter with a
  17639. section, but not with a subsection. However, you may `jump up' any
  17640. number of levels at one time---for example, from a subsection to a
  17641. chapter.
  17642. Each @code{@@node} line, with the exception of the line for the `Top'
  17643. node, must be followed by a line with a structuring command such as
  17644. @code{@@chapter}, @code{@@section}, or
  17645. @code{@@unnumberedsubsec}.
  17646. Each @code{@@node} line/structuring-command line combination
  17647. must look either like this:
  17648. @example
  17649. @group
  17650. @@node Comments, Minimum, Conventions, Overview
  17651. @@comment node-name, next, previous, up
  17652. @@section Comments
  17653. @end group
  17654. @end example
  17655. or like this (without the @code{@@comment} line):
  17656. @example
  17657. @group
  17658. @@node Comments, Minimum, Conventions, Overview
  17659. @@section Comments
  17660. @end group
  17661. @end example
  17662. or like this (without the explicit node pointers):
  17663. @example
  17664. @group
  17665. @@node Comments
  17666. @@section Comments
  17667. @end group
  17668. @end example
  17669. @noindent
  17670. In this example, `Comments' is the name of both the node and the
  17671. section. The next node is called `Minimum' and the previous node is
  17672. called `Conventions'. The `Comments' section is within the `Overview'
  17673. node, which is specified by the `Up' pointer. (Instead of an
  17674. @code{@@comment} line, you may also write an @code{@@ifinfo} line.)
  17675. If a file has a `Top' node, it must be called @samp{top} or @samp{Top}
  17676. and be the first node in the file.
  17677. The menu updating commands create a menu of sections within a chapter,
  17678. a menu of subsections within a section, and so on. This means that
  17679. you must have a `Top' node if you want a menu of chapters.
  17680. Incidentally, the @code{makeinfo} command will create an Info file for a
  17681. hierarchically organized Texinfo file that lacks `Next', `Previous' and
  17682. `Up' pointers. Thus, if you can be sure that your Texinfo file will be
  17683. formatted with @code{makeinfo}, you have no need for the update node
  17684. commands. (@xref{Creating an Info File}, for more information about
  17685. @code{makeinfo}.)
  17686. @node Other Updating Commands
  17687. @subsection Other Updating Commands
  17688. In addition to the five major updating commands, Texinfo mode
  17689. possesses several less frequently used updating commands:
  17690. @table @kbd
  17691. @item M-x texinfo-insert-node-lines
  17692. @findex texinfo-insert-node-lines
  17693. Insert @code{@@node} lines before the @code{@@chapter},
  17694. @code{@@section}, and other sectioning commands wherever they are
  17695. missing throughout a region in a Texinfo file.
  17696. With an argument (@kbd{C-u} as prefix argument, if interactive), the
  17697. command @code{texinfo-insert-node-lines} not only inserts
  17698. @code{@@node} lines but also inserts the chapter or section titles as
  17699. the names of the corresponding nodes. In addition, it inserts the
  17700. titles as node names in pre-existing @code{@@node} lines that lack
  17701. names. Since node names should be more concise than section or
  17702. chapter titles, you must manually edit node names so inserted.
  17703. For example, the following marks a whole buffer as a region and inserts
  17704. @code{@@node} lines and titles throughout:
  17705. @example
  17706. C-x h C-u M-x texinfo-insert-node-lines
  17707. @end example
  17708. This command inserts titles as node names in @code{@@node} lines; the
  17709. @code{texinfo-start-menu-description} command (@pxref{Inserting,
  17710. Inserting Frequently Used Commands}) inserts titles as descriptions in
  17711. menu entries, a different action. However, in both cases, you need to
  17712. edit the inserted text.
  17713. @item M-x texinfo-multiple-files-update
  17714. @findex texinfo-multiple-files-update @r{(in brief)}
  17715. Update nodes and menus in a document built from several separate files.
  17716. With @kbd{C-u} as a prefix argument, create and insert a master menu in
  17717. the outer file. With a numeric prefix argument, such as @kbd{C-u 2}, first
  17718. update all the menus and all the `Next', `Previous', and `Up' pointers
  17719. of all the included files before creating and inserting a master menu in
  17720. the outer file. The @code{texinfo-multiple-files-update} command is
  17721. described in the appendix on @code{@@include} files.
  17722. @xref{@code{texinfo-multiple-files-update}}.
  17723. @item M-x texinfo-indent-menu-description
  17724. @findex texinfo-indent-menu-description
  17725. Indent every description in the menu following point to the specified
  17726. column. You can use this command to give yourself more space for
  17727. descriptions. With an argument (@kbd{C-u} as prefix argument, if
  17728. interactive), the @code{texinfo-indent-menu-description} command indents
  17729. every description in every menu in the region. However, this command
  17730. does not indent the second and subsequent lines of a multi-line
  17731. description.
  17732. @item M-x texinfo-sequential-node-update
  17733. @findex texinfo-sequential-node-update
  17734. Insert the names of the nodes immediately following and preceding the
  17735. current node as the `Next' or `Previous' pointers regardless of those
  17736. nodes' hierarchical level. This means that the `Next' node of a
  17737. subsection may well be the next chapter. Sequentially ordered nodes are
  17738. useful for novels and other documents that you read through
  17739. sequentially. (However, in Info, the @kbd{g *} command lets
  17740. you look through the file sequentially, so sequentially ordered nodes
  17741. are not strictly necessary.) With an argument (prefix argument, if
  17742. interactive), the @code{texinfo-sequential-node-update} command
  17743. sequentially updates all the nodes in the region.
  17744. @end table
  17745. @node Info Formatting
  17746. @section Formatting for Info
  17747. @cindex Formatting for Info
  17748. @cindex Running an Info formatter
  17749. @cindex Info formatting
  17750. Texinfo mode provides several commands for formatting part or all of a
  17751. Texinfo file for Info. Often, when you are writing a document, you
  17752. want to format only part of a file---that is, a region.
  17753. You can use either the @code{texinfo-format-region} or the
  17754. @code{makeinfo-region} command to format a region:
  17755. @table @kbd
  17756. @findex texinfo-format-region
  17757. @item C-c C-e C-r
  17758. @itemx M-x texinfo-format-region
  17759. @itemx C-c C-m C-r
  17760. @itemx M-x makeinfo-region
  17761. Format the current region for Info.
  17762. @end table
  17763. You can use either the @code{texinfo-format-buffer} or the
  17764. @code{makeinfo-buffer} command to format a whole buffer:
  17765. @table @kbd
  17766. @findex texinfo-format-buffer
  17767. @item C-c C-e C-b
  17768. @itemx M-x texinfo-format-buffer
  17769. @itemx C-c C-m C-b
  17770. @itemx M-x makeinfo-buffer
  17771. Format the current buffer for Info.
  17772. @end table
  17773. @need 1000
  17774. For example, after writing a Texinfo file, you can type the following:
  17775. @example
  17776. C-u C-c C-u m
  17777. @exdent or
  17778. C-u M-x texinfo-master-menu
  17779. @end example
  17780. @noindent
  17781. This updates all the nodes and menus. Then type the following to create
  17782. an Info file:
  17783. @example
  17784. C-c C-m C-b
  17785. @exdent or
  17786. M-x makeinfo-buffer
  17787. @end example
  17788. @xref{Creating an Info File} for details about Info formatting.
  17789. @node Printing
  17790. @comment node-name, next, previous, up
  17791. @section Printing
  17792. @cindex Formatting for printing
  17793. @cindex Printing a region or buffer
  17794. @cindex Region formatting and printing
  17795. @cindex Buffer formatting and printing
  17796. @cindex Part of file formatting and printing
  17797. Typesetting and printing a Texinfo file is a multi-step process in
  17798. which you first create a file for printing (called a DVI file), and
  17799. then print the file. Optionally, you may also create indices. To do
  17800. this, you must run the @code{texindex} command after first running the
  17801. @code{tex} typesetting command; and then you must run the @code{tex}
  17802. command again. Or else run the @code{texi2dvi} command which
  17803. automatically creates indices as needed (@pxref{Format with
  17804. @command{texi2dvi}}).
  17805. Often, when you are writing a document, you want to typeset and print
  17806. only part of a file to see what it will look like. You can use the
  17807. @code{texinfo-tex-region} and related commands for this purpose. Use
  17808. the @code{texinfo-tex-buffer} command to format all of a
  17809. buffer.
  17810. @table @kbd
  17811. @item C-c C-t C-b
  17812. @itemx M-x texinfo-tex-buffer
  17813. @findex texinfo-tex-buffer
  17814. Run @code{texi2dvi} on the buffer. In addition to running @TeX{} on the
  17815. buffer, this command automatically creates or updates indices as
  17816. needed.
  17817. @item C-c C-t C-r
  17818. @itemx M-x texinfo-tex-region
  17819. @findex texinfo-tex-region
  17820. Run @TeX{} on the region.
  17821. @item C-c C-t C-i
  17822. @itemx M-x texinfo-texindex
  17823. Run @code{texindex} to sort the indices of a Texinfo file formatted with
  17824. @code{texinfo-tex-region}. The @code{texinfo-tex-region} command does
  17825. not run @code{texindex} automatically; it only runs the @code{tex}
  17826. typesetting command. You must run the @code{texinfo-tex-region} command
  17827. a second time after sorting the raw index files with the @code{texindex}
  17828. command. (Usually, you do not format an index when you format a region,
  17829. only when you format a buffer. Now that the @code{texi2dvi} command
  17830. exists, there is little or no need for this command.)
  17831. @item C-c C-t C-p
  17832. @itemx M-x texinfo-tex-print
  17833. @findex texinfo-tex-print
  17834. Print the file (or the part of the file) previously formatted with
  17835. @code{texinfo-tex-buffer} or @code{texinfo-tex-region}.
  17836. @end table
  17837. For @code{texinfo-tex-region} or @code{texinfo-tex-buffer} to work, the
  17838. file @emph{must} start with a @samp{\input texinfo} line and must
  17839. include a @code{@@settitle} line. The file must end with @code{@@bye}
  17840. on a line by itself. (When you use @code{texinfo-tex-region}, you must
  17841. surround the @code{@@settitle} line with start-of-header and
  17842. end-of-header lines.)
  17843. @xref{Hardcopy}, for a description of the other @TeX{} related
  17844. commands, such as @code{tex-show-print-queue}.
  17845. @node Texinfo Mode Summary
  17846. @section Texinfo Mode Summary
  17847. In Texinfo mode, each set of commands has default keybindings that
  17848. begin with the same keys. All the commands that are custom-created
  17849. for Texinfo mode begin with @kbd{C-c}. The keys are somewhat
  17850. mnemonic.
  17851. @subheading Insert Commands
  17852. The insert commands are invoked by typing @kbd{C-c} twice and then the
  17853. first letter of the @@-command to be inserted. (It might make more
  17854. sense mnemonically to use @kbd{C-c C-i}, for `custom insert', but
  17855. @kbd{C-c C-c} is quick to type.)
  17856. @example
  17857. C-c C-c c @r{Insert} @samp{@@code}.
  17858. C-c C-c d @r{Insert} @samp{@@dfn}.
  17859. C-c C-c e @r{Insert} @samp{@@end}.
  17860. C-c C-c i @r{Insert} @samp{@@item}.
  17861. C-c C-c n @r{Insert} @samp{@@node}.
  17862. C-c C-c s @r{Insert} @samp{@@samp}.
  17863. C-c C-c v @r{Insert} @samp{@@var}.
  17864. C-c @{ @r{Insert braces.}
  17865. C-c ]
  17866. C-c @} @r{Move out of enclosing braces.}
  17867. @group
  17868. C-c C-c C-d @r{Insert a node's section title}
  17869. @r{in the space for the description}
  17870. @r{in a menu entry line.}
  17871. @end group
  17872. @end example
  17873. @subheading Show Structure
  17874. The @code{texinfo-show-structure} command is often used within a
  17875. narrowed region.
  17876. @example
  17877. C-c C-s @r{List all the headings.}
  17878. @end example
  17879. @subheading The Master Update Command
  17880. The @code{texinfo-master-menu} command creates a master menu; and can
  17881. be used to update every node and menu in a file as well.
  17882. @c Probably should use @tables in this section.
  17883. @example
  17884. @group
  17885. C-c C-u m
  17886. M-x texinfo-master-menu
  17887. @r{Create or update a master menu.}
  17888. @end group
  17889. @group
  17890. C-u C-c C-u m @r{With @kbd{C-u} as a prefix argument, first}
  17891. @r{create or update all nodes and regular}
  17892. @r{menus, and then create a master menu.}
  17893. @end group
  17894. @end example
  17895. @subheading Update Pointers
  17896. The update pointer commands are invoked by typing @kbd{C-c C-u} and
  17897. then either @kbd{C-n} for @code{texinfo-update-node} or @kbd{C-e} for
  17898. @code{texinfo-every-node-update}.
  17899. @example
  17900. C-c C-u C-n @r{Update a node.}
  17901. C-c C-u C-e @r{Update every node in the buffer.}
  17902. @end example
  17903. @subheading Update Menus
  17904. Invoke the update menu commands by typing @kbd{C-c C-u}
  17905. and then either @kbd{C-m} for @code{texinfo-make-menu} or
  17906. @kbd{C-a} for @code{texinfo-all-menus-update}. To update
  17907. both nodes and menus at the same time, precede @kbd{C-c C-u
  17908. C-a} with @kbd{C-u}.
  17909. @example
  17910. C-c C-u C-m @r{Make or update a menu.}
  17911. @group
  17912. C-c C-u C-a @r{Make or update all}
  17913. @r{menus in a buffer.}
  17914. @end group
  17915. @group
  17916. C-u C-c C-u C-a @r{With @kbd{C-u} as a prefix argument,}
  17917. @r{first create or update all nodes and}
  17918. @r{then create or update all menus.}
  17919. @end group
  17920. @end example
  17921. @subheading Format for Info
  17922. The Info formatting commands that are written in Emacs Lisp are
  17923. invoked by typing @kbd{C-c C-e} and then either @kbd{C-r} for a region
  17924. or @kbd{C-b} for the whole buffer.
  17925. The Info formatting commands that are written in C and based on the
  17926. @code{makeinfo} program are invoked by typing @kbd{C-c C-m} and then
  17927. either @kbd{C-r} for a region or @kbd{C-b} for the whole buffer.
  17928. @need 800
  17929. @noindent
  17930. Use the @code{texinfo-format@dots{}} commands:
  17931. @example
  17932. @group
  17933. C-c C-e C-r @r{Format the region.}
  17934. C-c C-e C-b @r{Format the buffer.}
  17935. @end group
  17936. @end example
  17937. @need 750
  17938. @noindent
  17939. Use @code{makeinfo}:
  17940. @example
  17941. C-c C-m C-r @r{Format the region.}
  17942. C-c C-m C-b @r{Format the buffer.}
  17943. C-c C-m C-l @r{Recenter the @code{makeinfo} output buffer.}
  17944. C-c C-m C-k @r{Kill the @code{makeinfo} formatting job.}
  17945. @end example
  17946. @subheading Typeset and Print
  17947. The @TeX{} typesetting and printing commands are invoked by typing
  17948. @kbd{C-c C-t} and then another control command: @kbd{C-r} for
  17949. @code{texinfo-tex-region}, @kbd{C-b} for @code{texinfo-tex-buffer},
  17950. and so on.
  17951. @example
  17952. C-c C-t C-r @r{Run @TeX{} on the region.}
  17953. C-c C-t C-b @r{Run} @code{texi2dvi} @r{on the buffer.}
  17954. C-c C-t C-i @r{Run} @code{texindex}.
  17955. C-c C-t C-p @r{Print the DVI file.}
  17956. C-c C-t C-q @r{Show the print queue.}
  17957. C-c C-t C-d @r{Delete a job from the print queue.}
  17958. C-c C-t C-k @r{Kill the current @TeX{} formatting job.}
  17959. C-c C-t C-x @r{Quit a currently stopped @TeX{} formatting job.}
  17960. C-c C-t C-l @r{Recenter the output buffer.}
  17961. @end example
  17962. @subheading Other Updating Commands
  17963. The remaining updating commands do not have standard keybindings because
  17964. they are rarely used.
  17965. @example
  17966. @group
  17967. M-x texinfo-insert-node-lines
  17968. @r{Insert missing @code{@@node} lines in region.}
  17969. @r{With @kbd{C-u} as a prefix argument,}
  17970. @r{use section titles as node names.}
  17971. @end group
  17972. @group
  17973. M-x texinfo-multiple-files-update
  17974. @r{Update a multi-file document.}
  17975. @r{With @kbd{C-u 2} as a prefix argument,}
  17976. @r{create or update all nodes and menus}
  17977. @r{in all included files first.}
  17978. @end group
  17979. @group
  17980. M-x texinfo-indent-menu-description
  17981. @r{Indent descriptions.}
  17982. @end group
  17983. @group
  17984. M-x texinfo-sequential-node-update
  17985. @r{Insert node pointers in strict sequence.}
  17986. @end group
  17987. @end example
  17988. @node Headings
  17989. @appendix Page Headings
  17990. @cindex Headings
  17991. @cindex Footings
  17992. @cindex Page numbering
  17993. @cindex Page headings
  17994. @cindex Formatting headings and footings
  17995. Most printed manuals contain headings along the top of every page
  17996. except the title and copyright pages. Some manuals also contain
  17997. footings. @c HTML output also supports something like these, but in a
  17998. @c completely different way: @pxref{Customizing HTML Page Layout}.
  17999. Headings and footings have no meaning in Info or the other output
  18000. formats.
  18001. @menu
  18002. * Headings Introduced:: Conventions for using page headings.
  18003. * Heading Format:: Standard page heading formats.
  18004. * Heading Choice:: How to specify the type of page heading.
  18005. * Custom Headings:: How to create your own headings and footings.
  18006. @end menu
  18007. @node Headings Introduced
  18008. @section Headings Introduced
  18009. Texinfo provides standard page heading formats for manuals that are
  18010. printed on one side of each sheet of paper and for manuals that are
  18011. printed on both sides of the paper. Typically, you will use these
  18012. formats, but you can specify your own format if you wish.
  18013. In addition, you can specify whether chapters should begin on a new
  18014. page, or merely continue the same page as the previous chapter; and if
  18015. chapters begin on new pages, you can specify whether they must be
  18016. odd-numbered pages.
  18017. By convention, a book is printed on both sides of each sheet of paper.
  18018. When you open a book, the right-hand page is odd-numbered, and
  18019. chapters begin on right-hand pages---a preceding left-hand page is
  18020. left blank if necessary. Reports, however, are often printed on just
  18021. one side of paper, and chapters begin on a fresh page immediately
  18022. following the end of the preceding chapter. In short or informal
  18023. reports, chapters often do not begin on a new page at all, but are
  18024. separated from the preceding text by a small amount of whitespace.
  18025. The @code{@@setchapternewpage} command controls whether chapters begin
  18026. on new pages, and whether one of the standard heading formats is used.
  18027. In addition, Texinfo has several heading and footing commands that you
  18028. can use to generate your own heading and footing formats.
  18029. In Texinfo, headings and footings are single lines at the tops and
  18030. bottoms of pages; you cannot create multiline headings or footings.
  18031. Each header or footer line is divided into three parts: a left part, a
  18032. middle part, and a right part. Any part, or a whole line, may be left
  18033. blank. Text for the left part of a header or footer line is set
  18034. flushleft; text for the middle part is centered; and, text for the
  18035. right part is set flushright.
  18036. @node Heading Format
  18037. @section Standard Heading Formats
  18038. Texinfo provides two standard heading formats, one for manuals printed
  18039. on one side of each sheet of paper, and the other for manuals printed
  18040. on both sides of the paper.
  18041. By default, nothing is specified for the footing of a Texinfo file,
  18042. so the footing remains blank.
  18043. The standard format for single-sided printing consists of a header
  18044. line in which the left-hand part contains the name of the chapter, the
  18045. central part is blank, and the right-hand part contains the page
  18046. number.
  18047. @need 950
  18048. A single-sided page looks like this:
  18049. @example
  18050. @group
  18051. _______________________
  18052. | |
  18053. | chapter page number |
  18054. | |
  18055. | Start of text ... |
  18056. | ... |
  18057. | |
  18058. @end group
  18059. @end example
  18060. The standard format for two-sided printing depends on whether the page
  18061. number is even or odd. By convention, even-numbered pages are on the
  18062. left- and odd-numbered pages are on the right. (@TeX{} will adjust the
  18063. widths of the left- and right-hand margins. Usually, widths are
  18064. correct, but during double-sided printing, it is wise to check that
  18065. pages will bind properly---sometimes a printer will produce output in
  18066. which the even-numbered pages have a larger right-hand margin than the
  18067. odd-numbered pages.)
  18068. In the standard double-sided format, the left part of the left-hand
  18069. (even-numbered) page contains the page number, the central part is
  18070. blank, and the right part contains the title (specified by the
  18071. @code{@@settitle} command). The left part of the right-hand
  18072. (odd-numbered) page contains the name of the chapter, the central part
  18073. is blank, and the right part contains the page number.
  18074. @need 750
  18075. Two pages, side by side as in an open book, look like this:
  18076. @example
  18077. @group
  18078. _______________________ _______________________
  18079. | | | |
  18080. | page number title | | chapter page number |
  18081. | | | |
  18082. | Start of text ... | | More text ... |
  18083. | ... | | ... |
  18084. | | | |
  18085. @end group
  18086. @end example
  18087. @noindent
  18088. The chapter name is preceded by the word ``Chapter'', the chapter number
  18089. and a colon. This makes it easier to keep track of where you are in the
  18090. manual.
  18091. @node Heading Choice
  18092. @section Specifying the Type of Heading
  18093. @TeX{} does not begin to generate page headings for a standard Texinfo
  18094. file until it reaches the @code{@@end titlepage} command. Thus, the
  18095. title and copyright pages are not numbered. The @code{@@end
  18096. titlepage} command causes @TeX{} to begin to generate page headings
  18097. according to a standard format specified by the
  18098. @code{@@setchapternewpage} command that precedes the
  18099. @code{@@titlepage} section.
  18100. @need 1000
  18101. There are four possibilities:
  18102. @table @asis
  18103. @item No @code{@@setchapternewpage} command
  18104. Cause @TeX{} to specify the single-sided heading format, with chapters
  18105. on new pages. This is the same as @code{@@setchapternewpage on}.
  18106. @item @code{@@setchapternewpage on}
  18107. Specify the single-sided heading format, with chapters on new pages.
  18108. @item @code{@@setchapternewpage off}
  18109. Cause @TeX{} to start a new chapter on the same page as the last page
  18110. of the preceding chapter, after skipping some vertical whitespace.
  18111. Also cause @TeX{} to typeset for single-sided printing. (You can
  18112. override the headers format with the @code{@@headings double} command;
  18113. @pxref{@code{@@headings}}.)
  18114. @item @code{@@setchapternewpage odd}
  18115. Specify the double-sided heading format, with chapters on new pages.
  18116. @end table
  18117. @noindent
  18118. Texinfo lacks a @code{@@setchapternewpage even} command.
  18119. @node Custom Headings
  18120. @section How to Make Your Own Headings
  18121. You can use the standard headings provided with Texinfo or specify
  18122. your own. By default, Texinfo has no footers, so if you specify them,
  18123. the available page size for the main text will be slightly reduced.
  18124. Texinfo provides six commands for specifying headings and
  18125. footings:
  18126. @itemize @bullet
  18127. @item
  18128. @code{@@everyheading} and @code{@@everyfooting} generate page headers and
  18129. footers that are the same for both even- and odd-numbered pages.
  18130. @item
  18131. @code{@@evenheading} and @code{@@evenfooting} command generate headers
  18132. and footers for even-numbered (left-hand) pages.
  18133. @item
  18134. @code{@@oddheading} and @code{@@oddfooting} generate headers and footers
  18135. for odd-numbered (right-hand) pages.
  18136. @end itemize
  18137. Write custom heading specifications in the Texinfo file immediately
  18138. after the @code{@@end titlepage} command. You must cancel the
  18139. predefined heading commands with the @code{@@headings off} command
  18140. before defining your own specifications.
  18141. @need 1000
  18142. Here is how to tell @TeX{} to place the chapter name at the left, the
  18143. page number in the center, and the date at the right of every header
  18144. for both even- and odd-numbered pages:
  18145. @example
  18146. @group
  18147. @@headings off
  18148. @@everyheading @@thischapter @@| @@thispage @@| @@today@{@}
  18149. @end group
  18150. @end example
  18151. @noindent
  18152. You need to divide the left part from the central part and the central
  18153. part from the right part by inserting @samp{@@|} between parts.
  18154. Otherwise, the specification command will not be able to tell where
  18155. the text for one part ends and the next part begins.
  18156. Each part can contain text or @@-commands. The text is printed as if
  18157. the part were within an ordinary paragraph in the body of the page.
  18158. The @@-commands replace themselves with the page number, date, chapter
  18159. name, or whatever.
  18160. @need 950
  18161. Here are the six heading and footing commands:
  18162. @table @code
  18163. @item @@everyheading @var{left} @@| @var{center} @@| @var{right}
  18164. @itemx @@everyfooting @var{left} @@| @var{center} @@| @var{right}
  18165. @findex everyheading
  18166. @findex everyfooting
  18167. The `every' commands specify the format for both even- and odd-numbered
  18168. pages. These commands are for documents that are printed on one side
  18169. of each sheet of paper, or for documents in which you want symmetrical
  18170. headers or footers.
  18171. @item @@evenheading @var{left} @@| @var{center} @@| @var{right}
  18172. @itemx @@oddheading @var{left} @@| @var{center} @@| @var{right}
  18173. @itemx @@evenfooting @var{left} @@| @var{center} @@| @var{right}
  18174. @itemx @@oddfooting @var{left} @@| @var{center} @@| @var{right}
  18175. @findex evenheading
  18176. @findex evenfooting
  18177. @findex oddheading
  18178. @findex oddfooting
  18179. The `even' and `odd' commands specify the format for even-numbered
  18180. pages and odd-numbered pages. These commands are for books and
  18181. manuals that are printed on both sides of each sheet of paper.
  18182. @end table
  18183. Use the @samp{@@this@dots{}} series of @@-commands to
  18184. provide the names of chapters
  18185. and sections and the page number. You can use the
  18186. @samp{@@this@dots{}} commands in the left, center, or right portions
  18187. of headers and footers, or anywhere else in a Texinfo file so long as
  18188. they are between @code{@@iftex} and @code{@@end iftex} commands.
  18189. @need 1000
  18190. Here are the @samp{@@this@dots{}} commands:
  18191. @table @code
  18192. @item @@thispage
  18193. @findex thispage
  18194. Expands to the current page number.
  18195. @item @@thissectionname
  18196. @findex thissectionname
  18197. Expands to the name of the current section.
  18198. @item @@thissectionnum
  18199. @findex thissectionnum
  18200. Expands to the number of the current section.
  18201. @item @@thissection
  18202. @findex thissection
  18203. Expands to the number and name of the current section, in the format
  18204. `Section 1: Title'.
  18205. @item @@thischaptername
  18206. @findex thischaptername
  18207. Expands to the name of the current chapter.
  18208. @item @@thischapternum
  18209. @findex thischapternum
  18210. Expands to the number of the current chapter, or letter of the current
  18211. appendix.
  18212. @item @@thischapter
  18213. @findex thischapter
  18214. Expands to the number and name of the current
  18215. chapter, in the format `Chapter 1: Title'.
  18216. @item @@thistitle
  18217. @findex thistitle
  18218. Expands to the name of the document, as specified by the
  18219. @code{@@settitle} command.
  18220. @item @@thisfile
  18221. @findex thisfile
  18222. For @code{@@include} files only: expands to the name of the current
  18223. @code{@@include} file. If the current Texinfo source file is not an
  18224. @code{@@include} file, this command has no effect. This command does
  18225. @emph{not} provide the name of the current Texinfo source file unless
  18226. it is an @code{@@include} file. (@xref{Include Files}, for more
  18227. information about @code{@@include} files.)
  18228. @end table
  18229. @noindent
  18230. You can also use the @code{@@today@{@}} command, which expands to the
  18231. current date, in `1 Jan 1900' format.
  18232. @findex today
  18233. Other @@-commands and text are printed in a header or footer just as
  18234. if they were in the body of a page. It is useful to incorporate text,
  18235. particularly when you are writing drafts:
  18236. @example
  18237. @group
  18238. @@headings off
  18239. @@everyheading @@emph@{Draft!@} @@| @@thispage @@| @@thischapter
  18240. @@everyfooting @@| @@| Version: 0.27: @@today@{@}
  18241. @end group
  18242. @end example
  18243. Beware of overlong titles: they may overlap another part of the
  18244. header or footer and blot it out.
  18245. If you have very short chapters and/or sections, several of them can
  18246. appear on a single page. You can specify which chapters and sections
  18247. you want @code{@@thischapter}, @code{@@thissection} and other such
  18248. macros to refer to on such pages as follows:
  18249. @table @code
  18250. @item @@everyheadingmarks @var{ref}
  18251. @itemx @@everyfootingmarks @var{ref}
  18252. @findex everyheadingmarks
  18253. @findex everyfootingmarks
  18254. The @var{ref} argument can be either @code{top} (the @code{@@this...}
  18255. commands will refer to the chapter/section at the top of a page) or
  18256. @code{bottom} (the commands will reflect the situation at the bottom
  18257. of a page). These @samp{@@every...} commands specify what to do on
  18258. both even- and odd-numbered pages.
  18259. @item @@evenheadingmarks @var{ref}
  18260. @itemx @@oddheadingmarks @var{ref}
  18261. @itemx @@evenfootingmarks @var{ref}
  18262. @itemx @@oddfootingmarks @var{ref}
  18263. @findex evenheadingmarks
  18264. @findex oddheadingmarks
  18265. @findex evenfootingmarks
  18266. @findex oddfootingmarks
  18267. These @samp{@@even...} and @samp{@@odd...} commands specify what to do
  18268. on only even- or odd-numbered pages, respectively. The @var{ref}
  18269. argument is the same as with the @samp{@@every...} commands.
  18270. @end table
  18271. Write these commands immediately after the @code{@@...contents}
  18272. commands, or after the @code{@@end titlepage} command if you don't
  18273. have a table of contents or if it is printed at the end of your
  18274. manual.
  18275. By default the @code{@@this...} commands reflect the situation at the
  18276. bottom of a page both in headings and in footings.
  18277. @node Catching Mistakes
  18278. @appendix Catching Mistakes
  18279. @cindex Structure, catching mistakes in
  18280. @cindex Nodes, catching mistakes
  18281. @cindex Catching mistakes
  18282. @cindex Correcting mistakes
  18283. @cindex Mistakes, catching
  18284. @cindex Problems, catching
  18285. @cindex Debugging the Texinfo structure
  18286. Besides mistakes in the content of your documentation, there are two
  18287. kinds of mistake you can make with Texinfo: you can make mistakes with
  18288. @@-commands, and you can make mistakes with the structure of the nodes
  18289. and chapters.
  18290. Emacs has two tools for catching the @@-command mistakes and two for
  18291. catching structuring mistakes.
  18292. For finding problems with @@-commands, you can run @TeX{} or a region
  18293. formatting command on the region that has a problem; indeed, you can
  18294. run these commands on each region as you write it.
  18295. For finding problems with the structure of nodes and chapters, you can use
  18296. @kbd{C-c C-s} (@code{texinfo-show-structure}) and the related @code{occur}
  18297. command and you can use the @kbd{M-x Info-validate} command.
  18298. @menu
  18299. * @command{makeinfo} Preferred:: @code{makeinfo} finds errors.
  18300. * Debugging with Info:: How to catch errors with Info formatting.
  18301. * Debugging with @TeX{}:: How to catch errors with @TeX{} formatting.
  18302. * Using @code{texinfo-show-structure}:: How to use @code{texinfo-show-structure}.
  18303. * Using @code{occur}:: How to list all lines containing a pattern.
  18304. * Running @code{Info-validate}:: How to find badly referenced nodes.
  18305. @end menu
  18306. @node @command{makeinfo} Preferred
  18307. @section @command{makeinfo} Preferred
  18308. @c anchor{makeinfo Preferred}@c prev name
  18309. The @code{makeinfo} program does an excellent job of catching errors
  18310. and reporting them---far better than @code{texinfo-format-region} or
  18311. @code{texinfo-format-buffer}. In addition, the various functions for
  18312. automatically creating and updating node pointers and menus remove
  18313. many opportunities for human error.
  18314. If you can, use the updating commands to create and insert pointers
  18315. and menus. These prevent many errors. Then use @code{makeinfo} (or
  18316. its Texinfo mode manifestations, @code{makeinfo-region} and
  18317. @code{makeinfo-buffer}) to format your file and check for other
  18318. errors. This is the best way to work with Texinfo. But if you
  18319. cannot use @code{makeinfo}, or your problem is very puzzling, then you
  18320. may want to use the tools described in this appendix.
  18321. @node Debugging with Info
  18322. @section Catching Errors with Info Formatting
  18323. @cindex Catching errors with Info formatting
  18324. @cindex Debugging with Info formatting
  18325. After you have written part of a Texinfo file, you can use the
  18326. @code{texinfo-format-region} or the @code{makeinfo-region} command to
  18327. see whether the region formats properly.
  18328. Most likely, however, you are reading this section because for some
  18329. reason you cannot use the @code{makeinfo-region} command; therefore, the
  18330. rest of this section presumes that you are using
  18331. @code{texinfo-format-region}.
  18332. If you have made a mistake with an @@-command,
  18333. @code{texinfo-format-region} will stop processing at or after the
  18334. error and display an error message. To see where in the buffer the
  18335. error occurred, switch to the @samp{*Info Region*} buffer; the cursor
  18336. will be in a position that is after the location of the error. Also,
  18337. the text will not be formatted after the place where the error
  18338. occurred (or more precisely, where it was detected).
  18339. For example, if you accidentally end a menu with the command @code{@@end
  18340. menus} with an `s' on the end, instead of with @code{@@end menu}, you
  18341. will see an error message that says:
  18342. @example
  18343. @@end menus is not handled by texinfo
  18344. @end example
  18345. @noindent
  18346. The cursor will stop at the point in the buffer where the error
  18347. occurs, or not long after it. The buffer will look like this:
  18348. @example
  18349. @group
  18350. ---------- Buffer: *Info Region* ----------
  18351. * Menu:
  18352. * Using texinfo-show-structure:: How to use
  18353. `texinfo-show-structure'
  18354. to catch mistakes.
  18355. * Running Info-validate:: How to check for
  18356. unreferenced nodes.
  18357. @@end menus
  18358. @point{}
  18359. ---------- Buffer: *Info Region* ----------
  18360. @end group
  18361. @end example
  18362. The @code{texinfo-format-region} command sometimes provides slightly
  18363. odd error messages. For example, the following cross-reference fails
  18364. to format:
  18365. @example
  18366. (@@xref@{Catching Mistakes, for more info.)
  18367. @end example
  18368. @noindent
  18369. In this case, @code{texinfo-format-region} detects the missing closing
  18370. brace but displays a message that says @samp{Unbalanced parentheses}
  18371. rather than @samp{Unbalanced braces}. This is because the formatting
  18372. command looks for mismatches between braces as if they were
  18373. parentheses.
  18374. Sometimes @code{texinfo-format-region} fails to detect mistakes. For
  18375. example, in the following, the closing brace is swapped with the
  18376. closing parenthesis:
  18377. @example
  18378. (@@xref@{Catching Mistakes), for more info.@}
  18379. @end example
  18380. @noindent
  18381. Formatting produces:
  18382. @example
  18383. (*Note for more info.: Catching Mistakes)
  18384. @end example
  18385. The only way for you to detect this error is to realize that the
  18386. reference should have looked like this:
  18387. @example
  18388. (*Note Catching Mistakes::, for more info.)
  18389. @end example
  18390. Incidentally, if you are reading this node in Info and type @kbd{f
  18391. @key{RET}} (@code{Info-follow-reference}), you will generate an error
  18392. message that says:
  18393. @example
  18394. No such node: "Catching Mistakes) The only way @dots{}
  18395. @end example
  18396. @noindent
  18397. This is because Info perceives the example of the error as the first
  18398. cross-reference in this node and if you type a @key{RET} immediately
  18399. after typing the Info @kbd{f} command, Info will attempt to go to the
  18400. referenced node. If you type @kbd{f catch @key{TAB} @key{RET}}, Info
  18401. will complete the node name of the correctly written example and take
  18402. you to the `Catching Mistakes' node. (If you try this, you can return
  18403. from the `Catching Mistakes' node by typing @kbd{l}
  18404. (@code{Info-last}).)
  18405. @node Debugging with @TeX{}
  18406. @section Debugging with @TeX{}
  18407. @cindex Catching errors with @TeX{} formatting
  18408. @cindex Debugging with @TeX{} formatting
  18409. You can also catch mistakes when you format a file with @TeX{}.
  18410. Usually, you will want to do this after you have run
  18411. @code{texinfo-format-buffer} (or, better, @code{makeinfo-buffer}) on
  18412. the same file, because @code{texinfo-format-buffer} sometimes displays
  18413. error messages that make more sense than @TeX{}. (@xref{Debugging
  18414. with Info}, for more information.)
  18415. For example, @TeX{} was run on a Texinfo file, part of which is shown
  18416. here:
  18417. @example
  18418. ---------- Buffer: texinfo.texi ----------
  18419. name of the Texinfo file as an extension. The
  18420. @@samp@{??@} are `wildcards' that cause the shell to
  18421. substitute all the raw index files. (@@xref@{sorting
  18422. indices, for more information about sorting
  18423. indices.)@@refill
  18424. ---------- Buffer: texinfo.texi ----------
  18425. @end example
  18426. @noindent
  18427. (The cross-reference lacks a closing brace.)
  18428. @TeX{} produced the following output, after which it stopped:
  18429. @example
  18430. ---------- Buffer: *tex-shell* ----------
  18431. Runaway argument?
  18432. @{sorting indices, for more information about sorting
  18433. indices.) @@refill @@ETC.
  18434. ! Paragraph ended before @@xref was complete.
  18435. <to be read again>
  18436. @@par
  18437. l.27
  18438. ?
  18439. ---------- Buffer: *tex-shell* ----------
  18440. @end example
  18441. In this case, @TeX{} produced an accurate and
  18442. understandable error message:
  18443. @example
  18444. Paragraph ended before @@xref was complete.
  18445. @end example
  18446. @noindent
  18447. @samp{@@par} is an internal @TeX{} command of no relevance to Texinfo.
  18448. @samp{l.27} means that @TeX{} detected the problem on line 27 of the
  18449. Texinfo file. The @samp{?} is the prompt @TeX{} uses in this
  18450. circumstance.
  18451. Unfortunately, @TeX{} is not always so helpful, and sometimes you must
  18452. truly be a Sherlock Holmes to discover what went wrong.
  18453. In any case, if you run into a problem like this, you can do one of three
  18454. things.
  18455. @enumerate
  18456. @item
  18457. You can tell @TeX{} to continue running and ignore just this error by
  18458. typing @key{RET} at the @samp{?} prompt.
  18459. @item
  18460. You can tell @TeX{} to continue running and to ignore all errors as best
  18461. it can by typing @kbd{r @key{RET}} at the @samp{?} prompt.
  18462. This is often the best thing to do. However, beware: the one error
  18463. may produce a cascade of additional error messages as its consequences
  18464. are felt through the rest of the file. To stop @TeX{} when it is
  18465. producing such an avalanche of error messages, type @kbd{C-c} (or
  18466. @kbd{C-c C-c}, if you are running a shell inside Emacs).
  18467. @item
  18468. You can tell @TeX{} to stop this run by typing @kbd{x @key{RET}}
  18469. at the @samp{?} prompt.
  18470. @end enumerate
  18471. If you are running @TeX{} inside Emacs, you need to switch to the shell
  18472. buffer and line at which @TeX{} offers the @samp{?} prompt.
  18473. Sometimes @TeX{} will format a file without producing error messages even
  18474. though there is a problem. This usually occurs if a command is not ended
  18475. but @TeX{} is able to continue processing anyhow. For example, if you fail
  18476. to end an itemized list with the @code{@@end itemize} command, @TeX{} will
  18477. write a DVI file that you can print out. The only error message that
  18478. @TeX{} will give you is the somewhat mysterious comment:
  18479. @example
  18480. (@@end occurred inside a group at level 1)
  18481. @end example
  18482. @noindent
  18483. However, if you print the DVI file, you will find that the text
  18484. of the file that follows the itemized list is entirely indented as if
  18485. it were part of the last item in the itemized list. The error message
  18486. is the way @TeX{} says that it expected to find an @code{@@end}
  18487. command somewhere in the file; but that it could not determine where
  18488. it was needed.
  18489. Another source of notoriously hard-to-find errors is a missing
  18490. @code{@@end group} command. If you ever are stumped by
  18491. incomprehensible errors, look for a missing @code{@@end group} command
  18492. first.
  18493. If the Texinfo file lacks header lines,
  18494. @TeX{} may stop in the
  18495. beginning of its run and display output that looks like the following.
  18496. The @samp{*} indicates that @TeX{} is waiting for input.
  18497. @example
  18498. This is TeX, Version 3.14159 (Web2c 7.0)
  18499. (test.texinfo [1])
  18500. *
  18501. @end example
  18502. @noindent
  18503. In this case, simply type @kbd{\end @key{RET}} after the asterisk. Then
  18504. write the header lines in the Texinfo file and run the @TeX{} command
  18505. again. (Note the use of the backslash, @samp{\}. @TeX{} uses @samp{\}
  18506. instead of @samp{@@}; and in this circumstance, you are working
  18507. directly with @TeX{}, not with Texinfo.)
  18508. @node Using @code{texinfo-show-structure}
  18509. @section Using @code{texinfo-show-structure}
  18510. @cindex Showing the structure of a file
  18511. @findex texinfo-show-structure
  18512. It is not always easy to keep track of the nodes, chapters, sections, and
  18513. subsections of a Texinfo file. This is especially true if you are revising
  18514. or adding to a Texinfo file that someone else has written.
  18515. In GNU Emacs, in Texinfo mode, the @code{texinfo-show-structure}
  18516. command lists all the lines that begin with the @@-commands that
  18517. specify the structure: @code{@@chapter}, @code{@@section},
  18518. @code{@@appendix}, and so on. With an argument (@w{@kbd{C-u}}
  18519. as prefix argument, if interactive),
  18520. the command also shows the @code{@@node} lines. The
  18521. @code{texinfo-show-structure} command is bound to @kbd{C-c C-s} in
  18522. Texinfo mode, by default.
  18523. The lines are displayed in a buffer called the @samp{*Occur*} buffer,
  18524. indented by hierarchical level. For example, here is a part of what was
  18525. produced by running @code{texinfo-show-structure} on this manual:
  18526. @example
  18527. @group
  18528. Lines matching "^@@\\(chapter \\|sect\\|subs\\|subh\\|
  18529. unnum\\|major\\|chapheading \\|heading \\|appendix\\)"
  18530. in buffer texinfo.texi.
  18531. @dots{}
  18532. 4177:@@chapter Nodes
  18533. 4198: @@heading Two Paths
  18534. 4231: @@section Node and Menu Illustration
  18535. 4337: @@section The @@code@{@@@@node@} Command
  18536. 4393: @@subheading Choosing Node and Pointer Names
  18537. 4417: @@subsection How to Write a @@code@{@@@@node@} Line
  18538. 4469: @@subsection @@code@{@@@@node@} Line Tips
  18539. @dots{}
  18540. @end group
  18541. @end example
  18542. This says that lines 4337, 4393, and 4417 of @file{texinfo.texi} begin
  18543. with the @code{@@section}, @code{@@subheading}, and @code{@@subsection}
  18544. commands respectively. If you move your cursor into the @samp{*Occur*}
  18545. window, you can position the cursor over one of the lines and use the
  18546. @kbd{C-c C-c} command (@code{occur-mode-goto-occurrence}), to jump to
  18547. the corresponding spot in the Texinfo file. @xref{Other Repeating
  18548. Search, , Using Occur, emacs, The GNU Emacs Manual}, for more
  18549. information about @code{occur-mode-goto-occurrence}.
  18550. The first line in the @samp{*Occur*} window describes the @dfn{regular
  18551. expression} specified by @var{texinfo-heading-pattern}. This regular
  18552. expression is the pattern that @code{texinfo-show-structure} looks for.
  18553. @xref{Regexps, , Using Regular Expressions, emacs, The GNU Emacs Manual},
  18554. for more information.
  18555. When you invoke the @code{texinfo-show-structure} command, Emacs will
  18556. display the structure of the whole buffer. If you want to see the
  18557. structure of just a part of the buffer, of one chapter, for example,
  18558. use the @kbd{C-x n n} (@code{narrow-to-region}) command to mark the
  18559. region. (@xref{Narrowing, , , emacs, The GNU Emacs Manual}.) This is
  18560. how the example used above was generated. (To see the whole buffer
  18561. again, use @kbd{C-x n w} (@code{widen}).)
  18562. If you call @code{texinfo-show-structure} with a prefix argument by
  18563. typing @w{@kbd{C-u C-c C-s}}, it will list lines beginning with
  18564. @code{@@node} as well as the lines beginning with the @@-sign commands
  18565. for @code{@@chapter}, @code{@@section}, and the like.
  18566. You can remind yourself of the structure of a Texinfo file by looking at
  18567. the list in the @samp{*Occur*} window; and if you have mis-named a node
  18568. or left out a section, you can correct the mistake.
  18569. @node Using @code{occur}
  18570. @section Using @code{occur}
  18571. @cindex Occurrences, listing with @code{@@occur}
  18572. @findex occur
  18573. Sometimes the @code{texinfo-show-structure} command produces too much
  18574. information. Perhaps you want to remind yourself of the overall structure
  18575. of a Texinfo file, and are overwhelmed by the detailed list produced by
  18576. @code{texinfo-show-structure}. In this case, you can use the @code{occur}
  18577. command directly. To do this, type:
  18578. @example
  18579. @kbd{M-x occur}
  18580. @end example
  18581. @noindent
  18582. and then, when prompted, type a @dfn{regexp}, a regular expression for
  18583. the pattern you want to match. (@xref{Regexps, , Regular Expressions,
  18584. emacs, The GNU Emacs Manual}.) The @code{occur} command works from
  18585. the current location of the cursor in the buffer to the end of the
  18586. buffer. If you want to run @code{occur} on the whole buffer, place
  18587. the cursor at the beginning of the buffer.
  18588. For example, to see all the lines that contain the word
  18589. @samp{@@chapter} in them, just type @samp{@@chapter}. This will
  18590. produce a list of the chapters. It will also list all the sentences
  18591. with @samp{@@chapter} in the middle of the line.
  18592. If you want to see only those lines that start with the word
  18593. @samp{@@chapter}, type @samp{^@@chapter} when prompted by
  18594. @code{occur}. If you want to see all the lines that end with a word
  18595. or phrase, end the last word with a @samp{$}; for example,
  18596. @samp{catching mistakes$}. This can be helpful when you want to see
  18597. all the nodes that are part of the same chapter or section and
  18598. therefore have the same `Up' pointer.
  18599. @xref{Other Repeating Search, , Using Occur, emacs , The GNU Emacs Manual},
  18600. for more information.
  18601. @node Running @code{Info-validate}
  18602. @section Finding Badly Referenced Nodes
  18603. @anchor{Running Info-Validate}@c old name
  18604. @findex Info-validate
  18605. @cindex Nodes, checking for badly referenced
  18606. @cindex Checking for badly referenced nodes
  18607. @cindex Looking for badly referenced nodes
  18608. @cindex Finding badly referenced nodes
  18609. @cindex Badly referenced nodes
  18610. You can use the @code{Info-validate} command to check whether any of
  18611. the `Next', `Previous', `Up' or other node pointers fail to point to a
  18612. node. This command checks that every node pointer points to an
  18613. existing node. The @code{Info-validate} command works only on Info
  18614. files, not on Texinfo files.
  18615. The @code{makeinfo} program validates pointers automatically, so you
  18616. do not need to use the @code{Info-validate} command if you are using
  18617. @code{makeinfo}. You only may need to use @code{Info-validate} if you
  18618. are unable to run @code{makeinfo} and instead must create an Info file
  18619. using @code{texinfo-format-region} or @code{texinfo-format-buffer}, or
  18620. if you write an Info file from scratch.
  18621. @menu
  18622. * Using @code{Info-validate}:: How to run @code{Info-validate}.
  18623. * Unsplit:: How to create an unsplit file.
  18624. * Tagifying:: How to tagify a file.
  18625. * Splitting:: How to split a file manually.
  18626. @end menu
  18627. @node Using @code{Info-validate}
  18628. @subsection Using @code{Info-validate}
  18629. @cindex Using @code{Info-validate}
  18630. @cindex Info validating a large file
  18631. @cindex Validating a large file
  18632. To use @code{Info-validate}, visit the Info file you wish to check and
  18633. type:
  18634. @example
  18635. M-x Info-validate
  18636. @end example
  18637. @noindent
  18638. Note that the @code{Info-validate} command requires an uppercase
  18639. `I'@. You may also need to create a tag table before running
  18640. @code{Info-validate}. @xref{Tagifying}.
  18641. If your file is valid, you will receive a message that says ``File appears
  18642. valid''. However, if you have a pointer that does not point to a node,
  18643. error messages will be displayed in a buffer called @samp{*problems in
  18644. info file*}.
  18645. For example, @code{Info-validate} was run on a test file that contained
  18646. only the first node of this manual. One of the messages said:
  18647. @example
  18648. In node "Overview", invalid Next: Texinfo Mode
  18649. @end example
  18650. @noindent
  18651. This meant that the node called @samp{Overview} had a `Next' pointer that
  18652. did not point to anything (which was true in this case, since the test file
  18653. had only one node in it).
  18654. Now suppose we add a node named @samp{Texinfo Mode} to our test case
  18655. but we do not specify a `Previous' for this node. Then we will get
  18656. the following error message:
  18657. @example
  18658. In node "Texinfo Mode", should have Previous: Overview
  18659. @end example
  18660. @noindent
  18661. This is because every `Next' pointer should be matched by a
  18662. `Previous' (in the node where the `Next' points) which points back.
  18663. @code{Info-validate} also checks that all menu entries and cross-references
  18664. point to actual nodes.
  18665. @code{Info-validate} requires a tag table and does not work with files
  18666. that have been split. (The @code{texinfo-format-buffer} command
  18667. automatically splits large files.) In order to use @code{Info-validate}
  18668. on a large file, you must run @code{texinfo-format-buffer} with an
  18669. argument so that it does not split the Info file; and you must create a
  18670. tag table for the unsplit file.
  18671. @node Unsplit
  18672. @subsection Creating an Unsplit File
  18673. @cindex Creating an unsplit file
  18674. @cindex Unsplit file creation
  18675. You can run @code{Info-validate} only on a single Info file that has a
  18676. tag table. The command will not work on the indirect subfiles that
  18677. are generated when a master file is split. If you have a large file
  18678. (longer than 300,000 bytes or so), you need to run the
  18679. @code{texinfo-format-buffer} or @code{makeinfo-buffer} command in such
  18680. a way that it does not create indirect subfiles. You will also need
  18681. to create a tag table for the Info file. After you have done this,
  18682. you can run @code{Info-validate} and look for badly referenced
  18683. nodes.
  18684. The first step is to create an unsplit Info file. To prevent
  18685. @code{texinfo-format-buffer} from splitting a Texinfo file into
  18686. smaller Info files, give a prefix to the @kbd{M-x
  18687. texinfo-format-buffer} command:
  18688. @example
  18689. C-u M-x texinfo-format-buffer
  18690. @end example
  18691. @noindent
  18692. or else
  18693. @example
  18694. C-u C-c C-e C-b
  18695. @end example
  18696. @noindent
  18697. When you do this, Texinfo will not split the file and will not create
  18698. a tag table for it.
  18699. @cindex Making a tag table manually
  18700. @cindex Tag table, making manually
  18701. @node Tagifying
  18702. @subsection Tagifying a File
  18703. After creating an unsplit Info file, you must create a tag table for
  18704. it. Visit the Info file you wish to tagify and type:
  18705. @example
  18706. M-x Info-tagify
  18707. @end example
  18708. @noindent
  18709. (Note the uppercase @samp{I} in @code{Info-tagify}.) This creates an
  18710. Info file with a tag table that you can validate.
  18711. The third step is to validate the Info file:
  18712. @example
  18713. M-x Info-validate
  18714. @end example
  18715. @noindent
  18716. (Note the uppercase @samp{I} in @code{Info-validate}.)
  18717. In brief, the steps are:
  18718. @example
  18719. @group
  18720. C-u M-x texinfo-format-buffer
  18721. M-x Info-tagify
  18722. M-x Info-validate
  18723. @end group
  18724. @end example
  18725. After you have validated the node structure, you can rerun
  18726. @code{texinfo-format-buffer} in the normal way so it will construct a
  18727. tag table and split the file automatically, or you can make the tag
  18728. table and split the file manually.
  18729. @node Splitting
  18730. @subsection Splitting a File Manually
  18731. @cindex Splitting an Info file manually
  18732. @cindex Info file, splitting manually
  18733. You should split a large file or else let the
  18734. @code{texinfo-format-buffer} or @code{makeinfo-buffer} command do it
  18735. for you automatically. (Generally you will let one of the formatting
  18736. commands do this job for you. @xref{Creating an Info File}.)
  18737. The split-off files are called the indirect subfiles.
  18738. Info files are split to save memory. With smaller files, Emacs does not
  18739. have make such a large buffer to hold the information.
  18740. If an Info file has more than 30 nodes, you should also make a tag
  18741. table for it. @xref{Using @code{Info-validate}}, for information
  18742. about creating a tag table. (Again, tag tables are usually created
  18743. automatically by the formatting command; you only need to create a tag
  18744. table yourself if you are doing the job manually. Most likely, you
  18745. will do this for a large, unsplit file on which you have run
  18746. @code{Info-validate}.)
  18747. Visit the Info file you wish to tagify and split and type the two
  18748. commands:
  18749. @example
  18750. M-x Info-tagify
  18751. M-x Info-split
  18752. @end example
  18753. @noindent
  18754. (Note that the @samp{I} in @samp{Info} is uppercase.)
  18755. When you use the @code{Info-split} command, the buffer is modified into a
  18756. (small) Info file which lists the indirect subfiles. This file should be
  18757. saved in place of the original visited file. The indirect subfiles are
  18758. written in the same directory the original file is in, with names generated
  18759. by appending @samp{-} and a number to the original file name.
  18760. The primary file still functions as an Info file, but it contains just
  18761. the tag table and a directory of subfiles.
  18762. @node Info Format Specification
  18763. @appendix Info Format Specification
  18764. @cindex Info format specification
  18765. @cindex Specification of Info format
  18766. @cindex Definition of Info format
  18767. Here we describe the technical details of the Info format.
  18768. In this formal description, the characters @code{<>*()|=#} are used
  18769. for the language of the description itself. Other characters are
  18770. literal. The formal constructs used are typical: @code{<...>}
  18771. indicates a metavariable name, @samp{=} means definition, @samp{*}
  18772. repetition, @samp{?} optional, @samp{()} grouping, @samp{|}
  18773. alternation, @samp{#} comment. Exception: @samp{*} at the beginning
  18774. of a line is literal.
  18775. In general, programs that read Info files should try to be
  18776. case-insensitive to keywords that occur in the file (for example,
  18777. @samp{Tag Table} and @samp{Tag table} should be equivalent) in order to
  18778. support Info-generating programs that use different capitalization.
  18779. The sections in an Info file (such as nodes or tag tables) are separated
  18780. with a sequence:
  18781. @example
  18782. (^L)?^_(^L)?^J
  18783. @end example
  18784. @noindent
  18785. That is, a @samp{CTRL-_} character followed by a newline, with optional
  18786. formfeed characters. We refer to such sequences as @t{<separator>}.
  18787. We specify literal parentheses (those that are part of the Info
  18788. format) with @t{<lparen>} and @t{<rparen>}, meaning the single
  18789. characters @samp{(} and @samp{)} respectively. We specify the
  18790. @samp{CTRL-?} character (character number 127) @t{<del>}. Finally,
  18791. the two-character sequence @samp{^@var{x}} means the single
  18792. character @samp{CTRL-@var{x}}, for any @var{x}.
  18793. This format definition was written some 25 years after the Info format
  18794. was first devised. So in the event of conflicts between this
  18795. definition and actual practice, practice wins. It also assumes some
  18796. general knowledge of Texinfo; it is meant to be a guide for
  18797. implementors rather than a rigid technical standard. We often refer
  18798. back to other parts of this manual for examples and definitions,
  18799. rather than redundantly spelling out every detail.
  18800. @menu
  18801. * General: Info Format General Layout.
  18802. * Text: Info Format Text Constructs.
  18803. @end menu
  18804. @node Info Format General Layout
  18805. @section Info Format General Layout
  18806. This section describes the overall layout of Info manuals.
  18807. @menu
  18808. * Whole: Info Format Whole Manual. Split vs.@: nonsplit manuals.
  18809. * Preamble: Info Format Preamble.
  18810. * Indirect: Info Format Indirect Table.
  18811. * Tag table: Info Format Tag Table.
  18812. * Local variables: Info Format Local Variables.
  18813. * Regular nodes: Info Format Regular Nodes.
  18814. @end menu
  18815. @node Info Format Whole Manual
  18816. @subheading Info Format: A Whole Manual
  18817. @cindex Nonsplit manuals, Info format of
  18818. @cindex Split manuals, Info format of
  18819. @cindex Whole manual, in Info format
  18820. To begin, an Info manual is either @dfn{nonsplit} (contained wholly
  18821. within a single file) or @dfn{split} (across several files).
  18822. The syntax for a nonsplit manual is:
  18823. @example
  18824. <nonsplit info file> =
  18825. <preamble>
  18826. <node>*
  18827. <tag table>?
  18828. <local variables>?
  18829. @end example
  18830. When split, there is a @dfn{main file}, which contains only pointers
  18831. to the nodes given in other @dfn{subfiles}. The main file looks
  18832. like this:
  18833. @example
  18834. <split info main file> =
  18835. <preamble>
  18836. <indirect table>
  18837. <tag table>
  18838. <local variables>?
  18839. @end example
  18840. The subfiles in a split manual have the following syntax:
  18841. @example
  18842. <split info subfile> =
  18843. <preamble>
  18844. <node>*
  18845. @end example
  18846. Note that the tag table is not optional for split files, as it is used
  18847. with the indirect table to deduce which subfile a particular node is in.
  18848. @node Info Format Preamble
  18849. @subheading Info Format: Preamble
  18850. @cindex Preamble, in Info format
  18851. The @t{<preamble>} is text at the beginning of all output files.
  18852. It is not intended to be visible by default in an Info viewer, but
  18853. may be displayed upon user request.
  18854. @example
  18855. <preamble> =
  18856. <identification> # "This is FILENAME, produced by ..."
  18857. <copying text> # Expansion of @@copying text.
  18858. <dir entries> # Derived from @@dircategory and @@direntry.
  18859. @end example
  18860. @noindent
  18861. These pieces are:
  18862. @table @t
  18863. @item <identification line>
  18864. An arbitrary string beginning the output file, followed by a blank
  18865. line.
  18866. @item <copying text>
  18867. The expansion of a @code{@@copying} environment, if the manual has
  18868. one (@pxref{@code{@@copying}}).
  18869. @item <dir entries>
  18870. The result of any @code{@@dircategory} and @code{@@direntry}
  18871. commands present in the manual (@pxref{Installing Dir Entries}).
  18872. @end table
  18873. @node Info Format Indirect Table
  18874. @subheading Info Format: Indirect Table
  18875. @cindex Indirect table, in Info format
  18876. @example
  18877. <indirect table> =
  18878. <separator>
  18879. Indirect:
  18880. (<filename>: <bytepos>)*
  18881. @end example
  18882. The indirect table is written to the main file in the case of split
  18883. output only. It specifies, as a decimal integer, the starting byte
  18884. position (zero-based) that the first node of each subfile would have if
  18885. the subfiles were concatenated together in order, not including the
  18886. top-level file. The first node of actual content is pointed to by the
  18887. first entry.
  18888. As an example, suppose split output is generated for the GDB manual.
  18889. The top-level file @file{gdb.info} will contain something like this:
  18890. @example
  18891. <separator>
  18892. Indirect:
  18893. gdb.info-1: 1878
  18894. gdb.info-2: 295733
  18895. ...
  18896. @end example
  18897. This tells Info viewers that the first node of the manual occurs at
  18898. byte 1878 of the file @file{gdb.info-1} (which would be after that file's
  18899. preamble.) The first node in the @file{gdb.info-2} subfile would start at
  18900. byte 295733 if @file{gdb.info-2} were appended to @file{gdb.info-1},
  18901. including any preamble sections in both files.
  18902. Unfortunately, Info-creating programs such as @code{makeinfo} have not
  18903. always implemented these rules perfectly, due to various bugs and
  18904. oversights. Therefore, robust Info viewers should fall back to
  18905. searching ``nearby'' the given position for a node, instead of
  18906. giving up immediately if the position is not exactly at a node beginning.
  18907. @node Info Format Tag Table
  18908. @subheading Info Format: Tag Table
  18909. @cindex Tag table, in Info format
  18910. @example
  18911. <tag table> =
  18912. <separator>
  18913. Tag Table:
  18914. (<lparen>Indirect<rparen>)?
  18915. (Node|Ref): <nodeid>^?<bytepos>
  18916. <separator>
  18917. End Tag Table
  18918. @end example
  18919. The @samp{(Indirect)} line appears in the case of split output only.
  18920. The tag table specifies the starting byte position of each node and anchor
  18921. in the file. In the case of split output, it is only written in the main
  18922. output file.
  18923. Each line defines an identifier as either an anchor or a node, as
  18924. specified. For example, @samp{Node: Top^?1647} says that the node named
  18925. @samp{Top} starts at byte 1647 while @samp{Ref: Overview-Footnote-1^?30045}
  18926. says that the anchor named @samp{Overview-Footnote-1} starts at byte 30045.
  18927. It is an error to define the same identifier both ways.
  18928. In the case of nonsplit output, the byte positions simply refer to the
  18929. location in the output file. In the case of split output, the byte
  18930. positions refer to an imaginary file created by concatenating all the
  18931. split files (but not the top-level file). See the previous section.
  18932. Here is an example:
  18933. @example
  18934. ^_
  18935. Tag Table:
  18936. Node: Top^?89
  18937. Node: Ch1^?292
  18938. ^_
  18939. End Tag Table
  18940. @end example
  18941. @noindent
  18942. This specifies a manual with two nodes, `Top' and `Ch1', at byte
  18943. positions 89 and 292 respectively. Because the @samp{(Indirect)} line
  18944. is not present, the manual is not split.
  18945. Preamble sections or other non-node sections of files do not have a tag
  18946. table entry.
  18947. @node Info Format Local Variables
  18948. @subheading Info Format: Local Variables
  18949. @cindex Local variable section, in Info format
  18950. The local variables section is optional and is currently used to give the
  18951. encoding information. It may be augmented in the future.
  18952. @example
  18953. <local variables> =
  18954. <separator>
  18955. Local Variables:
  18956. coding: <encoding>
  18957. End:
  18958. @end example
  18959. @xref{@code{@@documentencoding}}.
  18960. @node Info Format Regular Nodes
  18961. @subheading Info Format: Regular Nodes
  18962. @cindex Info nodes, in Info format
  18963. Regular nodes look like this:
  18964. @example
  18965. <node> =
  18966. <separator>
  18967. File: <fn>, Node: <id1>, (Next: <id2>, )? (Prev: <id3>, )? Up: <id4>
  18968. <general text, until the next ^_ or end-of-file>
  18969. @end example
  18970. @noindent
  18971. At least one space or tab must be present after each colon and comma,
  18972. but any number of spaces are ignored. The @t{<id>} node identifiers have
  18973. following format:
  18974. @example
  18975. <id> = (<lparen><infofile><rparen>)?(<del>?<nodename><del>?)?
  18976. | <id> = (<lparen><infofile><rparen>)?(<nodename>)?
  18977. @end example
  18978. This @t{<node>} defines @t{<id1>} in file @t{<fn>}, which is typically
  18979. either @samp{manualname} or @samp{manualname.info}. No parenthesized
  18980. @t{<infofile>} component may appear within @t{<id1>}.
  18981. Each of the identifiers after @code{Next}, @code{Prev} and @code{Up}
  18982. refer to nodes or anchors within a file. These pointers normally
  18983. refer within the same file, but @samp{(dir)} is often used to point to
  18984. the top-level dir file. If an @t{<infofile>} component is used then
  18985. the node name may be omitted, in which case the node identifier refers
  18986. to the @samp{Top} node within the referenced file.
  18987. The @code{Next} and @code{Prev} pointers are optional. The @code{Up}
  18988. pointer is technically also optional, although most likely this
  18989. indicates a mistake in the node structuring. Conventionally, the
  18990. nodes are arranged to form a tree, but this is not a requirement of
  18991. the format.
  18992. Node names containing periods, commas, colons or parentheses
  18993. (including @@-commands which produce any of these) can confuse
  18994. Info readers.
  18995. If it is necessary to refer to a node whose name contains any of
  18996. these, the @t{<nodename>} should be surrounded by a pair of @t{<del>}
  18997. characters. There is support in @command{makeinfo} for adding these
  18998. characters (@pxref{INFO_SPECIAL_CHARS_QUOTE}); however, we don't
  18999. recommend you make use of this support until such time as Info-reading
  19000. programs that recognize this syntax are common. @xref{Node Line
  19001. Requirements}.
  19002. The use of non-ASCII characters in the names of nodes is permitted,
  19003. but can cause problems in cross-references between nodes in Info files
  19004. with different character encodings, and also when node names from many
  19005. different files are listed (for example, with the @option{--apropos}
  19006. option to the standalone Info browser), so we recommend avoiding them
  19007. whenever feasible. For example, prefer the use of the ASCII
  19008. apostrophe character (@t{'}) to Unicode directional quotes.
  19009. The @t{<general text>} of the node can include the special constructs
  19010. described next.
  19011. @node Info Format Text Constructs
  19012. @section Info Format Text Constructs
  19013. @cindex Info format text constructs
  19014. @cindex text constructs, Info format
  19015. These special Info constructs can appear within the text of a node.
  19016. @node Info Format Menu
  19017. @subsection Info Format: Menu
  19018. @cindex Menus, in Info format
  19019. Conventionally menus appear at the end of nodes, but the Info format
  19020. places no restrictions on their location.
  19021. @example
  19022. <menu> =
  19023. * Menu:
  19024. (<menu entry> | <menu comment>)*
  19025. @end example
  19026. The parts of a @t{<menu entry>} are also described in @ref{Menu
  19027. Parts}. They have the same syntax as cross-references (@pxref{Info
  19028. Format Cross Reference}). Indices extend the menu format to specify the
  19029. destination line; @pxref{Info Format Printindex}.
  19030. A @t{<menu comment>} is any line not beginning with @samp{*} that
  19031. appears either at the beginning of the menu or is separated from a
  19032. menu entry by one or more blank lines. These comments are intended to
  19033. be displayed as part of the menu, as-is (@pxref{Writing a Menu}).
  19034. @node Info Format Image
  19035. @subsection Info Format: Image
  19036. @cindex Images, in Info format
  19037. The @code{@@image} command results in the following special directive
  19038. within the Info file (@pxref{Images}):
  19039. @example
  19040. <image> =
  19041. ^@@^H[image src="<image file>"
  19042. (text="<txt file contents>")?
  19043. (alt="<alt text>")?
  19044. ^@@^H]
  19045. @end example
  19046. The line breaks and indentation in this description are editorial; the
  19047. whitespace between the different parts of the directive in Info files
  19048. is arbitrary.
  19049. In the strings @t{<image file>}, @t{<txt file contents>} and @t{<alt
  19050. text>}, @samp{"} is quoted as @samp{\"} and @samp{\} is quoted as
  19051. @samp{\\}. The txt and alt specifications are optional.
  19052. The @t{alt} value serves the same purpose as in HTML: A prose
  19053. description of the image. In text-only displays or speech systems,
  19054. for example, the @t{alt} value may be used instead of displaying the
  19055. (typically graphical) @t{<image file>}.
  19056. The @t{<txt file contents>}, if present, should be taken as an ASCII
  19057. representation of the image, for possible use on a text-only display.
  19058. The format does not prescribe the choice between displaying the
  19059. @t{<image file>}, the @t{<alt text>} or the @t{<txt file contents>}.
  19060. @node Info Format Printindex
  19061. @subsection Info Format: Printindex
  19062. @cindex Indices, in Info format
  19063. Indices in Info format are generally written as a menu
  19064. (@pxref{Indices}), but with an additional directive at the beginning
  19065. marking this as an index node:
  19066. @example
  19067. <printindex> =
  19068. ^@@^H[index^@@^H]
  19069. * Menu:
  19070. <index entry>*
  19071. @end example
  19072. The @t{<index entry>} items are similar to normal menu entries, but
  19073. the free-format description is replaced by the line number of where
  19074. the entries occurs in the text:
  19075. @example
  19076. <index entry> =
  19077. * <entry text>: <entry node>. <lparen>line <lineno><rparen>
  19078. @end example
  19079. @noindent
  19080. The @t{<entry text>} is the index term. The @t{<lineno>} is an
  19081. unsigned integer, given relative to the start of the @t{<entry node>}.
  19082. There may be arbitrary whitespace after the colon and period, as usual
  19083. in menus, and may be broken across lines. Here is an example:
  19084. @example
  19085. ^@@^H[index^@@^H]
  19086. * Menu:
  19087. * thunder: Weather Phenomena. (line 5)
  19088. @end example
  19089. This means that an index entry for `thunder' appears at line 5 of the
  19090. node `Weather Phenomena'.
  19091. @node Info Format Cross Reference
  19092. @subsection Info Format: Cross-reference
  19093. @cindex Cross-references, in Info format
  19094. A general cross-reference in Info format has one of the following two forms:
  19095. @example
  19096. <cross-reference> =
  19097. * (N|n)ote <id>::
  19098. @c| * (N|n)ote <label>:<id>(.|,)?
  19099. | * (N|n)ote <label>:<id>(.|,)
  19100. <id> = (<lparen><infofile><rparen>)?(<del>?<nodename><del>?)?
  19101. | <id> = (<lparen><infofile><rparen>)?(<nodename>)?
  19102. <label> = <del>?<label text><del>?
  19103. @end example
  19104. No space should occur between the @samp{*} character and the following
  19105. @samp{N} or @samp{n}. @samp{*Note} should be used at the start of a
  19106. sentence, otherwise @samp{*note} should be used. (Some Info readers,
  19107. such as the one in Emacs, can display @samp{*Note} and @samp{*note} as
  19108. @samp{See} and @samp{see} respectively.) In both cases, @t{<label
  19109. text>} is descriptive text.
  19110. In both forms the @t{<id>} refers to a node or anchor, in the same way
  19111. as a reference in the node information line does (@pxref{Info Format
  19112. Regular Nodes}). The optional parenthesized @samp{<infofile>} is the
  19113. filename of the manual being referenced, and the @t{<nodename>} is the
  19114. node or anchor within that manual,
  19115. The second form has a descriptive label. A cross-reference in this form
  19116. should usually be terminated with a comma or period, to make it
  19117. feasible to find the end of the @t{<id>}.
  19118. If @t{<label>} contains a colon character (@t{:}), it should be
  19119. surrounded with a pair of @t{<del>} characters. Likewise, if
  19120. @t{<nodename>} contains problematic characters (such as commas or
  19121. periods), it should be surrounded by a pair of @t{<del>} characters;
  19122. then a terminating comma or period is not needed.
  19123. As with node names, this quoting mechanism has as of the time of
  19124. writing limited support in Info-reading programs; hence we do not
  19125. recommend using it until this changes.
  19126. The format does not prescribe how to find other manuals to resolve
  19127. such references.
  19128. Here are some examples:
  19129. @example
  19130. *note GNU Free Documentation License::
  19131. *note Tag table: Info Format Tag Table, for details.
  19132. *Note Overview: (make)Top.
  19133. *Note ^?:^?: (bash)Bourne Shell Builtins.
  19134. *Note alloca.h: (gnulib)^?alloca.h^?.
  19135. @end example
  19136. The first shows a reference to a node in the current manual using the
  19137. short form.
  19138. The second also refers to a node in the current manual, namely `Info
  19139. Format Tag Table'; the `Tag table' before the @samp{:} is only a label
  19140. on this particular reference, and the @samp{for details.} is text
  19141. belonging to the sentence, not part of the reference.
  19142. The third example refers to the node `Top' in another manual, namely
  19143. @samp{make}, with `Overview' being the label for this cross-reference.
  19144. The fourth example shows a colon character being quoted in a label,
  19145. and the fifth example shows a period being quoted in a node name.
  19146. @xref{Cross References}.
  19147. @node GNU Free Documentation License
  19148. @appendix GNU Free Documentation License
  19149. @include fdl.texi
  19150. @node Command and Variable Index
  19151. @unnumbered Command and Variable Index
  19152. This is an alphabetical list of all the @@-commands, assorted Emacs Lisp
  19153. functions, and several variables. To make the list easier to use, the
  19154. commands are listed without their preceding @samp{@@}.
  19155. @printindex fn
  19156. @node General Index
  19157. @unnumbered General Index
  19158. @printindex cp
  19159. @bye