TEX(1) TEX(1) NAME tex,virtex−textformattingandtypesetting SYNOPSIS tex[firstline] initex[firstline] virtex[firstline] DESCRIPTION TEXformatstheinterspersedtextandcommandscontainedinthenamedfilesandoutputsa typesetterindependentfile(calledDVIwhichisshortforDeViceIndependent).TEXcapabilitiesandlanguagearedescribedinTheTEXbookbyDonaldE.Knuth,publishedbyAddison-Wesley. TEXisnormallyusedwithalargebodyofprecompiledmacros,andthereareseveralspecificformattingsystems,suchasLaTeX,whichrequirethesupportofseveralmacrofiles.Thebasicprogramsascompiledarecalledinitexandvirtex,andaredistinguishedbythefactthatinitexcanbe usedtoprecompilemacrosintoa.fmtfile,whichisusedbyvirtex.Ontheotherhand,virtex startsmorequicklyandcanreadaprecompiled.fmtfile,butitcannotcreateone.ItistheversionofTEXwhichisusuallyinvokedinproduction,asopposedtoinstallation. AnyargumentsgivenonthecommandlinetotheTEXprogramsarepassedtothemasthefirst inputline.(Butitisofteneasiertotypeextendedargumentsasthefirstinputline,sinceshells tendtogobbleupormisinterpretTEX’sfavoritesymbols,likebackslashes,unlessyouquote them.)AsdescribedinTheTEXbook,thatfirstlineshouldbeginwithafilenameora\controlsequence.Thenormalusageistosay‘‘texpaper’’tostartprocessingpaper.tex.Thename ‘‘paper’’willbethe‘‘jobname’’,andisusedinformingoutputfilenames.IfTEXdoesn’tgeta filenameinthefirstline,thejobnameis‘‘texput’’.Thedefaultextension,.tex,canbeoverridden byspecifyinganextensionexplicitly. Ifthereisnopaper.texinthecurrentdirectory,TEXwilllookthroughasearchpathofdirectoriestotrytofindit.If‘‘paper’’isthe‘‘jobname’’alogoferrormessages,withrathermoredetail thannormallyappearsonthescreen,willappearinpaper.log,andtheoutputfilewillbein paper.dvi.Thesystemlibrary/usr/TeX/lib/tex/macroscontainsthebasicmacropackage plain.tex,describedinTheTEXbook,aswellasseveralothers.Exceptwhen.fmtfilesarebeing prepareditishardlyevernecessaryto\inputplain,sincealmostallinstancesofTEXbeginby loadingplain.fmt.ThismeansthatallofthecontrolsequencesdiscussedinTheTEXbookare knownwhenyouinvoketex.Foradiscussionof.fmtfiles,seebelow. SeveralenvironmentvariablescanbeusedtosetupdirectorypathstosearchwhenTEXopensa fileforinput.Forexample,thecshcommand setenvTEXINPUTS.:/usr/me/mylib:/usr/TeX/lib/tex/macros ortheshcommandsequence TEXINPUTS=.:/usr/me/mylib: exportTEXINPUTS wouldcauseallinvocationsofTEXanditsderivativestolookfor\inputfilesfirstinthecurrent directory,theninahypotheticaluser’s‘‘mylib’’,andfinallyinthesystemlibrary.(TEXexpands atrailingorleadingcolonintothesystemdirectories.)Normally,youwouldplacethevariable assignmentwhichsetsuptheTEXINPUTSenvironmentvariableinyour.loginor.profilefile.The environmentvariablessectionbelowliststherelevantenvironmentvariables,andtheirdefaults. TheeresponsetoTEX’serrorpromptcausesthesystemdefaulteditortostartupatthecurrent lineofthecurrentfile.Thereisanenvironmentvariable,TEXEDIT,thatcanbeusedtochange theeditorused.Itshouldcontainastringwith"%s"indicatingwherethefilenamegoesand "%d"indicatingwherethedecimallinenumber(ifany)goes.Forexample,aTEXEDITstringforvi canbesetwiththecshcommand setenvTEXEDIT"/usr/ucb/vi+%d%s" Aconvenientfileinthelibraryisnull.tex,containingnothing.WhenTEXcan’tfindafileit 13May92 1 TEX(1) TEX(1) thinksyouwanttoinput,itkeepsaskingyouforanotherfilename;responding‘null’getsyouout oftheloopifyoudon’twanttoinputanything.YoucanalsotypeyourEOFcharacter(usually control-D). Theinitexandvirtexprogramscanbeusedtocreatefast-loadingversionsofTEXbasedonmacro sourcefiles.Theinitexprogramisusedtocreateaformat(.fmt)filethatpermitsfastloadingof fontsandmacropackages.Afterprocessingthefontsanddefinitionsdesired,a\dumpcommand willcreatetheformatfile.Theformatfileisusedbyvirtex.Itneedstobegivenaformatfile nameasthefirstthingitreads.Aformatfilenameisprecededbyan&,whichneedstobe escapedwith\topreventmisinterpretationbyyourshellifgivenonthecommandline. Fortunately,itisnolongernecessarytomakeexplicitreferencestotheformatfile.Thepresent versionofTEX,whencompiledfromthisdistribution,looksatitsowncommandlinetodeterminewhatnameitwascalledunder.Itthenusesthatname,withthe‘‘.fmt’’suffixappended,to searchfortheappropriateformatfile.Duringinstallation,oneformatfilewiththename tex.fmt,withonlytheplain.texmacrosdefined,shouldhavebeencreated.Thiswillbeyourformatfilewhenyouinvokevirtexwiththenametex.Youcanalsocreateafilemytex.fmtusinginitex,sothatthiswillbeloadedwhenyouinvokevirtexwiththenamemytex.Tomakethewhole thingwork,itisnecessarytolinkvirtextoallthenamesofformatfilesthatyouhaveprepared. Hardlinkswilldoforsystem-wideequivalencesandUnixsystemswhichdonotusesymbolic links.Symboliclinkscanbeusedforaccesstoformatsforindividualprojects.Forexample:virtexcanbehardlinkedtotexinthegeneralsystemdirectoryforexecutableprograms,butanindividualversionofTEXwillmorelikelybelinkedbyasymboliclinkinaprivatelymaintainedpath ln−s/usr/TeX/bin/virtexmytex inadirectorysuchas/home/me/bin. Anotherapproachistosetupaaliasusing,forexample,theCshell: aliasmytexvirtex\&myfmt Besidesbeingmorecumbersome,however,thisapproachisnotavailabletosystemswhichdonot acceptaliases.Finally,thereisthesystemknownas‘‘undump’’whichtakestheheadersfroman a.outfile(e.g.virtex)andappliesthemtoacoreimagewhichhasbeendumpedbytheUnixQUIT signal.Thisisverysystem-dependent,andproducesextremelylargefileswhenusedwithalarge-memoryversionofTEX.Thiscanproduceexecutableswhichloadfaster,buttheexecutablesalso consumeenormousamountsofdiskspace. ENVIRONMENT Thedefaultsforallenvironmentvariablesaresetatthetimeofcompilationinafilenamedsite.h intheweb2cdistribution.Allpathsarecolon-separated.Ifyousetanenvironmentvariabletoa valuethathasaleadingcolon,thesystemdefaultshownhereisprepended.Likewiseforatrailingcolon.Forexample,ifyousay setenvTEXFONTS/u/karl/myfonts: TEXwillsearch /u/karl/myfonts:/usr/TeX/lib/tex/fonts//:.. Ifoneofthecomponentsinasearchpathendswithtwoslashes,e.g., :/u/karl/myfonts//. thenallsubdirectoriesofthegivenpatharesearched,insteadofthedirectoryitself.Forefficiency reasons,however,ifadirectorybeingsearchedforsubdirectoriescontainsonlysymboliclinks(to directories),andnorealsubdirectories,thesymboliclinksarenotfollowed.Youcanworkaround thisbysimplycreatingadummysubdirectory.Perhapsthislimitationwillberemovedinthe future. A˜ characteratthebeginningofapathcomponent,asin ˜ :/system/dir// expandsintothecurrenthomedirectory.˜ userexpandsintouser’shomedirectory.InmostTEX formats,however,youcannotuse˜ inafilenameyougivedirectlytoTEX,because˜ isanactive character,andhenceisexpanded,nottakenaspartofthefilename.Otherprograms,suchas Metafont,donothavethisproblem. 13May92 2 TEX(1) TEX(1) AlltheprogramsinthebaseTEXdistributionusethissamesearchmethod. Normally,TEXputsitsoutputfilesinthecurrentdirectory.Ifanyoutputfilecannotbeopened there,ittriestoopenitinthedirectoryspecifiedintheenvironmentvariableTEXMFOUTPUT. Thereisnodefaultvalueforthatvariable.Forexample,ifyousaytexpaperandthecurrent directoryisnotwritable,andTEXMFOUTPUThasthevalue/tmp,TEXattemptstocreate /tmp/paper.log(and/tmp/paper.dvi,ifanyoutputisproduced.) TEXINPUTS Searchpathfor\inputand\openinfiles.Thisshouldprobablystartwith‘‘.’’.Default: .:/usr/TeX/lib/tex/macros//. TEXFONTS Searchpathforfontmetric(.tfm)files.Default:/usr/TeX/lib/tex/fonts//:.. TEXFORMATS Searchpathforformatfiles.Default:/usr/TeX/lib/tex/formats. TEXPOOL SearchpathforINITEXinternalstrings.Default:/usr/TeX/lib/tex. TEXEDIT Commandtemplateforswitchingtoeditor.Default:/usr/bin/TeXeditor+%d%s. FILES /usr/TeX/lib/texTEX’slibraryareas /usr/TeX/lib/tex/tex.poolEncodedtextofTEX’smessages. /usr/TeX/lib/tex/fonts/*.tfmMetricfilesforTEX’sfonts. /usr/TeX/lib/tex/fonts/*nnn{gf,pk} Bitmapsforvariousdevices.ThesefilesarenotusedbyTEX. /usr/TeX/lib/tex/formats/*.fmt TEX.fmtfiles. /usr/TeX/lib/tex/macros/plain.tex The‘‘default’’macropackage. SEEALSO DonaldE.Knuth,TheTEXbook LeslieLamport,TheLaTeXDocumentPreparationSystem MichaelSpivak,TheJoyofTEX TUGBOAT(thepublicationoftheTEXUsersGroup) TRIVIA TEX,pronouncedproperly,rhymeswith‘‘blecchhh.’’Notethattheproperspellingintypewriterlikemediais‘‘TeX’’andnot‘‘TEX’’or‘‘tex.’’ AUTHORS TEXwasdesignedbyDonaldE.Knuth,whoimplementeditusinghisWEBsystemforPascal programs.ItwasportedtoUnixatStanfordbyHowardTrickey,andatCornellbyPavelCurtis. TheversionnowofferedwiththeUnixTEXdistributionisthatgeneratedbytheWEBtoCsystem,writtenbyTomRokickiandTimMorgan. 13May92 3