MPOST(1) MPOST(1) NAME mpost,inimpost,virmpost−MetaPost,asystemfordrawingpictures SYNOPSIS mpost[options][commands] DESCRIPTION Thismanualpageisnotmeanttobeexhaustive.Thecompletedocumentationforthisversionof TEXcanbefoundintheinfofileormanualWeb2C:ATeXimplementation. MetaPostinterpretstheMetaPostlanguageandproducesPostScriptpictures.TheMetaPostlanguageissimilartoKnuth’sMETAFONTwithadditionalfeaturesforincludingtex(1)ortroff(1) commandsandaccessingfeaturesofPostScriptnotfoundinMETAFONT. LikeTEXandMETAFONT,MetaPostisnormallyusedwithalargebodyofprecompiledmacros. ThisversionofMetaPostlooksatitscommandlinetoseewhatnameitwascalledunder.Both inimpostandvirmpostaresymlinkstothempostexecutable.Whencalledasinimpost(or whenthe--inioptionisgiven)itcanbeusedtoprecompilemacrosintoa.memfile.Whencalled asvirmpostitwillusetheplainmem.Whencalledunderanyothername,MetaPostwilluse thatnameasthenameofthememtouse.Forexample,whencalledasmpostthempostmem isused,whichisidenticaltotheplainmem.Othermemsthanplainarerarelyused. Thecommandsgivenonthecommandlinetotheprogramarepassedtoitasthefirstinputline. (Butitisofteneasiertotypeextendedargumentsasthefirstinputline,sinceUNIXshellstend togobbleupormisinterpretMetaPost’sfavoritesymbols,likesemicolons,unlessyouquotethem.) Thefirstlineshouldbeginwithafilename,a\controlsequence,ora&memname. Thenormalusageistosaympfigstoprocessthefilefigs.mp.Thebasenameoffigsbecomesthe ‘‘jobname’’,andisusedinformingoutputfilenames.Ifnofileisnamed,thejobnamebecomes mpout.Thedefaultextension,.mp,canbeoverriddenbyspecifyinganextensionexplicitly. Thereisnormallyoneoutputfileforeachpicturegenerated,andtheoutputfilesarenamed jobname.nnn,wherennnisanumberpassedtothebeginfigmacro.Theoutputfilenamecanalso bejobname.psifthisnumberisnegative. TheoutputfilescanbeusedasfiguresinaTEXdocumentbyincluding \special{psfile=jobname.nnn} intheTEXdocument.Alternatively,onecan\inputepsf.texandthenusethemacro \epsfbox{jobname.nnn} toproduceaboxoftheappropriatesizecontainingthefigure. btexTeXcommandsetex ThiscausesmptogenerateaMetaPostpictureexpressionthatcorrespondstotheTEX commands.IftheTEXcommandsgeneratemorethanonelineoftext,itmustbeina \vboxoraminipageenvironment. verbatimtexTeXcommandsetex ThisisignoredbympexceptthattheTEXcommandsarepassedontoTEX.Whenusing LATEXinsteadofTEXtheinputfilemuststartwithaverbatimtexblockthatgivesthe \documentstyleand\begin{document}commands.Youcanusethe‘%&’constructinthe firstverbatimtexblocktoensurethatthecorrectTEXformatisusedtoprocessthecommands. SincemostTEXfontshavetobedownloadedasbitmaps,thebtexfeatureworksbestwhenthe outputofmpistobeincludedinaTEXdocumentsothatdvips(1)candownloadthefonts.For self-containedPostScriptoutputthatcanbeuseddirectlyorincludedinatroffdocument,start yourMetaPostinputfilewiththecommandprologues:=1andsticktostandardPostScriptfonts. TEXandMetaPostusethenamesinthethirdcolumnofthefiletrfonts.map,whichcanbefound inthedirectorieswithsupportfilesforMetaPost. MetaPostoutputcanbeincludedinatroffdocumentviathe-mpicturesmacropackage.Inthis casempshouldbeinvokedwiththe-Tflagsothatthecommandsbetweenbtexandetexor Web2C7.32x 29March1999 1 MPOST(1) MPOST(1) betweenverbatimtexandetexareinterpretedastroffinsteadofTEX.(Thisautomaticallysets prologues:=1). OPTIONS ThisversionofMetaPostunderstandsthefollowingcommandlineoptions. --memmem Usememasthenameofthememtobeused,insteadofthenamebywhichMetaPost wascalledora%&line. --helpPrinthelpmessageandexit. --iniBeinimpost,fordumpingbases;thisisimplicitlytrueiftheprogramiscalledasinim-post. --interactionmode Setstheinteractionmode.Themodecanbeoneofbatchmode,nonstopmode,scrollmode, anderrorstopmode.Themeaningofthesemodesisthesameasthatofthecorresponding commands. --kpathsea-debugbitmask Setspathsearchingdebuggingflagsaccordingtothebitmask.SeetheKpathseamanual fordetails. --prognamename Pretendtobeprogramname.Thisaffectsboththeformatusedandthesearchpaths. -TProduceTROFFoutput. --translate-filetcxname Usethetcxnametranslationtable. --troffAs-T. --version Printversioninformationandexit. ENVIRONMENT SeetheKpathsearchlibrarydocumentation(the‘Pathspecifications’node)forthedetailsofhow theenvironmentvariablesareusewhensearching.Thekpsewhichutilitycanbeusedtoquery thevaluesofthevariables. IftheenvironmentvariableTEXMFOUTPUTisset,MetaPostattemptstoputitsoutputfilesin it,iftheycannotbeputinthecurrentdirectory. Hereisalistoftheenvironmentvariablesaffectthebehaviorofmp: MPINPUTS Searchpathforinputfiles. MFINPUTS Auxiliarysearchpathforinputfileswith.mfextensions. MPSUPPORT Directoryforvarioustablesforhandlingincludedtexandtroff. MPXCOMMAND Thenameofashellscriptthatconvertsembeddedtypesettingcommandstoaformthat MetaPostunderstands.Defaults:makempxfortexandtroffmpxfortroff. TEXTheversionofTEX−orLATEX−tousewhenprocessingbtexandverbatimtexcommands.Defaulttex.ThisversionofMetaPostallowsyoutousea‘%&format’line instead. Web2C7.32x 29March1999 2 MPOST(1) MPOST(1) TROFF Thetroffpipelineforbtexandverbatimtexcommands.Defaulteqn-d\$\$|troff MPEDIT Acommandtemplateforinvokinganeditor. A.memfileisabinaryfilethatpermitsfastloadingofmacropackages.mpostreadsthedefault plain.memunlessanother.memfileisspecifiedatthestartofthefirstlinewithan&justbefore it.ThereisalsoanthatsimulatesplainMETAFONTsothatmpostcanread.mffonts.(Plain METAFONTisdescribedinTheMETAFONTbook). Expertscancreate.memfilesbeinvokinginimpostandgivingmacrodefinitionsfollowedbya dumpcommand. TheMetaPostlanguageissimilartoMETAFONT,butthemanualAUser’sManualforMetaPost assumesnoknowledgeofMETAFONT.MetaPostdoesnothavebitmapoutputcommandsor METAFONT’sonlinedisplaymechanism. FILES mpost.pool EncodedtextofMetaPost’smessages. *.memPredigestedMetaPostmemfiles. plain.mp Thestandardmemfile. mfplain.mp TheMETAFONT-compatiblememfile.Thisisloadedwhenvirmpisinvokedviaasym-boliclinkasmfmp. $TEXMFMAIN/metapost/base/*.mp ThestandardMetaPostmacrosincludedintheoriginaldistribution. $TEXMFMAIN/metapost/support/* Varioustablesforhandlingincludedtexandtroff. $TEXMFMAIN/metapost/support/trfonts.map TableofcorrespondingfontnamesfortroffandPostScript. psfonts.map TableofcorrespondingfontnamesfortexandPostScript. $TEXMFMAIN/doc/metapost/examples.mp ThesourcefileforafewsamplefiguresthatarepartofaLATEXdocument$TEXMF-MAIN/doc/metapost/mpintro.texthatdescribestheMetaPostsysteminalittlemore detail. SUGGESTEDREADING DonaldE.Knuth,TheMETAFONTbook(VolumeCofComputersandTypesetting),Addison-Wes-ley,1986,ISBN0-201-13445-4. JohnD.Hobby,AUser’sManualforMetaPost,CSTR162,AT&TBellLabs, JohnD.Hobby,DrawingGraphswithMetaPost,CSTR164,AT&TBellLabs, TUGboat(thejournaloftheTEXUsersGroup). SEEALSO tex(1),mf(1),dvips(1). AUTHORS MetaPostwasdesignedbyJohnD.Hobby,incorporatingalgorithmsfromMETAFONTbyDonald E.Knuth.ItwasoriginallyimplementedonUnix,incorporatingsystem-dependentroutinesfrom web2c,whilenotrelyingonitexceptfortheactualWEB-to-Ctranslator. UlrikViethadaptedMetaPosttotakeadvantageoftheadvancedpathsearchingfeaturesinmore recentversionsofweb2candworkedtowardsfullyintegratingMetaPostintothecanonicalUnix Web2C7.32x 29March1999 3 MPOST(1) MPOST(1) TEXdistribution.Healsoupdatedandextendedthismanualpage. TRIVIA UnlikeTEXandMETAFONT,MetaPostoriginallydidn’tuseanyfancylogo.JohnHobbysayshe prefersthespelling‘‘MetaPost’’,yetDonKnuthhasupdatedtheMETAFONTlogo.mffonttobe abletotypesetaproperMetaPostlogosimilartotheMETAFONTlogo.Feelfreetousewhatever youthinkismoreappropriate! Web2C7.32x 29March1999 4