; TeX output 1995.06.21:1413HT':p cmti10Tmma2ltx"+XQ cmr12VVersion1.23#􍍍‹4K`yff cmr10GiuseppfgeGhibo=6!",ff cmsy10hU':ff cmti10UghibCo@galileo.polito.it]i-k3/June21,1995{.@ cmti12Mma2ltxWisaprogramwhicrhallowstoa/}h! cmsl12Mathematicausertoincludethegraphicspro-ducedbryMathematicainaL"s3V- cmcsc10Va^T E!XdoScumentusingownL"s3Va^T E!XfontsandsymbSolsforlabels.*HQkAHG cmssbx10Q1Intro+ductionb#MathematicaThaspSerhapsthebestdataplottingtoolcurrenrtlyavXailable,?butitscontrolorvermathematicalsymrbSolsandformulinsidegraphicsisverypSoor2 |{Ycmr81:"itislimitedtothecrharactersavXailableinthefont`SymbSol'.T UE!X^Iinstead^gisvrerypSowerfulinthissubjectbuthasnodataplottingcapability: ^itcanonlyincludeexternalgraphics.mma2ltxfisthe\bridge"acrossthetrwofworlds:]itallowstouseanyL"s3Va^T E!X8symbSolandfonrtaslabSelsingraphicscreatedbyMathematica.(VQ2WhatVdo+esW':G cmti10Wmma2ltxQdo?Mma2ltxreadsaProstScriptgraphic legeneratedbytheMathematicacommand`1߆T cmtt12Display'22and4/writestrwo4/output les;Xthe rstoneisaL"s3Va^T E!X4 leandconrtainseverystringoftextofthe0originalgraphics leinL"s3Va^T E!X%form;XthesecondisanEPSF le:#itsubstanrtiallycontainsthesamethingsoftheoriginalProstScript le,exceptithasbSeenstrippedofanrystringoftext.(VQ3RequirementsIngordertoincludeMathematicagraphicsproScessedbrymma2ltxintoL"s3Va^T E!X[doScumentsyouneedL"s3Va^T E!X(obrvious)andtheRokicki'sdvips23dviproScessor.FilessproScessedbrymma2ltxweretestedunderL"s3Va^T E!Xsv2.09(25March1992)anddvipsv5.55(andnewrer).8Thegraphics lesusedwerecreatedwithMathematica24v2.2.(VQ4Distribution/Disclaimermma2ltx=issharewrare.1Ifyou ndituseful(orcontinueusingitlongerthanaweek)pleaseconsiderAparyingthefee(theeasiestwayissimplytosendthecashinanenvelopSe)ofUS.$15(USDollars),or20DM(GermanMarks)totheauthor(see-!", cmsy10x ?14fortheauthor'saddress).mma2ltxisCopryrightN9hc R1994byGiuseppSeGhib o.This5%softrwareisprovided\asis"withnoexplicitorimplicitwarrantyofanykind.WYVouareusingitatyrourownrisk.Theauthordisclaimsanryliabilityfordamages,includinganydirect,indirect,incidental,spSecial,exemplaryV,orconsequenrtialdamagesarisinginanywayoutoftheuseofthissoftware,evrenifadvisedofthepSossibilityofsuchdamage. ff ^ٓRcmr71p0J cmsl10Mathematica{fK`y cmr10suppGortsoutputinTU>'ExX{\form,butthisfeatureisonlyforformulanddoesn'tregardthe graphics.  ^2TheUU`,mma2ltxmypic.pswheremypic.psistheoutputoftheMathematica'sprimitivre`Display'.x][]Where,isoneormoreof:ٚ-? YShow,thesemessagesٚ-d YDon't,keeptheaspectratioٚ-n YDeactivate,automatic$...$enclosingٚ-b YEnclose,everystringintoawhitebox(default=transpar.box)ٚ-p[],IncludetheMathematicaPostScriptprologueinthe.EPSfileٚ-h[],Setpictureheightto(default=100bp)ٚ-w[],Setpicturewidth Yto(default=161bp)ٚ-f[],Addan\fboxtothepicture(\fboxsep=)ٚ-u,Setalldimensionsintheunitߐ2Hٚ-s YSet,thefontsizewiththeTeXcommandٚ-o YOutput,filenameٚ-e YChange,onlyMMAlabelswhichbeginwithٚ-c(sx,sy)=(newsx,newsy)(,),(changealignment)ٚ-a[::],Drawarrowsonxandyaxesٚ,=anumberfollowedbyoneofTeX'sunit(e.g.10.3cm)ٚg=,anumber(e.g.0.0125)ٚ Y=,aTeX'sunit(e.g.cm)ٚg=,aTeXcommandwithoutthebackslash'\'ٚg=,atextstringExample:.5mma2ltx,-sfootnotesize-w5inpic1.pspic2.psprocesses,thefiles`pic1.ps'and`pic2.ps'.Thewidthofthepictureswill,be5inchand\footnotesizewillbeusedasLaTeXcommandtoset,thefontsize."ʫP6.2OptionsGX-wPandX-h@Template:8-whdimeni5-hhdimeniOptions;N-wand-hmrustbSeusedtospecifyrespectivrelythewidthandtheheightofthepicture.KThetvargumenrthdimeniisanumbSerfollowedbyoneofT UE!X'sunit(i.e.Koneofmm,cm,Spt,bp,pc,in,dd,cc,sp).FVordexample,`-w10.3cm'spSeci esa10:3cmwidepicture.Note4?that`-w,10.3cm',X`-w=10.3cm'and`-w:10.3cm'areacceptedtoSo,but`-w10.3,cm'isn'tacceptedK(notethespaceafterthenrumbSerK10).NotealsothatwremayspSecifyonlyoneof'-w'orp8'-h':theotherdimensioniscalculatedtokreeptheMathematicaaspSectratio.Ifeitherthewidth8andtheheighrtarespSeci ed,K]thepicturewillhave(approximately)thosedimensions,buttheinsidegraphicwillharvedimensionssucrhto toneofheightorwidth,1accordingtotheaspSectratio.8FVorinstance, specifyingonthecommandline`-w10cm,-h10cm'andtheaspectratio25 is0:62thenthepicturewillbSe10cmGxC10cmUlarge(thisisthedimension\visible"to4L"s3Va^T E!X),buttheinsidegraphicwillbSe10cmwideand6:2cmhigh.4Ifwrehaveinstead`-w10cm,-h3cm',thepicturewillbSe10cmD!@3cmmlargebuttheinsidegraphicwillbejust4:84cmwide^and3cmhigh.Ifwredon'twanttokeeptheMathematicaaspSectratiowemustusethe-doption.8Defaultwidthis161bp.;defaultheighrtis100bp.P6.3OptionGX-d@SuppresstheaspSectratiokreeping. ff ^5TheUUaspGectratioisheight b> cmmi10=widthinscaledcoordinates(i.e.,from0to1).ߐ3rHP6.4OptionGX-n@Bydefaultmma2ltxenclosesevrerystringgrabbSedfromtheMathematicaPostScript leintoa$:::ʞ$pair.SpSecifyingthe-noptiononthecommandline,thisbeharviourwillbedisabled."ʫP6.5OptionGX-bByldefaultevrerystringisplacedonthegraphicasifitwasenclosedinatransparentbSox.UsingithisoptionevrerystringwillbSenolonger\transparent",{butratherenclosedinawhitebSorxhavingthesamesize(seethestring\sometext"showninFig.4forthebSehaviourofthisoption)."ʫP6.6OptionGX-oTemplate:8-oh lenameiSpSecifytheoutput lename.MBydefaultmma2ltxusesasoutputnamesthenamesoftheinputU lesstrippSedoftheextensiontowhicrhappendtheproper leextension(i.e.,s`.tex'forthejL"s3Va^T E!Xi leand`.eps'fortheEPSF le).G'The-ooptionallorwsyoutospSecifyadi erentnamefortheEPSFProstScriptoutput le.aInthiscasethenameoftheL"s3Va^T E!X lewillbSeh lenamei.texanrywayV."ʫP6.7OptionGX-fTemplate:8-f[hdimeni]The-foptiontellsmma2ltxtoenclosethewholepictureinrtoan\fbox. Theoptionalargumenrtistheamountof\fboxsep;Xbydefaultmma2ltxassumes\fboxsep=0pt. AFVorinstancethecommand'hmma2ltx,-f5pt-w8cmmypic.psproSduces+apicture8cm/wide,Qenclosedinrto\fbox;k;fromeachedgeofthebSoxanditscontentsthereare5pt ."ʫP6.8OptionGX-s@Template:8-shcffontrol35sequenceiThisFoptionspSeci esaL"s3Va^T E!XF'fonrt-sizecontrolsequencetochangethesizeofthepicturelabSels.wNotemthatmma2ltxdoesn'tcrheckmifthehcffontrolsequenceimisavXalidL"s3Va^T E!XXcommand.SobSecareful.GenerallyuaL"s3Va^T E!Xhfonrt-sizecommandmaybSeoneoftiny,+iscriptsize,footnotesize,normalsize,large,Large,LARGE,Jhuge,Huge.Noleadingbacrkslashisneeded(youmustuse-sfootnotesizeinsteadof-s\footnotesize).BydefaultthepictureusestheL"s3Va^T E!Xcurrenrtfontsize.K[Notethatthiscommandwilla ectsizetheofallthestringsconrtainedinthepicture.ߐ4'9HP6.9OptionGX-u@Template:8-uhTUEuX's35unit$DiThezI-uoptionspSeci estheunitofmeasureofquanrtitiescontainedinthe.tex legeneratedbrymma2ltx.AlsothemessagesshownduringL"s3Va^T E!Xandmma2ltxproScessingwillusethatunit."P6.10" OptionGX-pTemplate:8-p[hprffologue35 lei]BydefaulttheEPSF leproSducedbrymma2ltxdoesn'tconrtaintheMathematicaPost-Script?prologue(i.e.7itcannotbSeprinrtedasis).Infactthisprologueisincludedonlyonceinthe nalProstScript leproSducedbydvips.Thehprffologue? leiisanoptionalargumenrtandallowstospSecifyanalternateMathe-maticagprologue le(e.g.'anewrerprologue le).TVoobatinaprologue leyroucanusetheprogramextpro.8Seex ?10forfurtherdetails.Using;thisoptiontheEPSF leproSducedbrymma2ltxwillcontaintheMathematicaprologue] le.4ThismarybSeveryusefulforsomedvipreviewerwithcapabilitytoshowPost-ScriptspSecials."P6.11" OptionGX-cTemplate:8-ch(s2cmmi8xH;s̹y )UR=(s2K cmsy80RAx;s20RAy )(dimen̹x;dimen̹y )iThe]-coptioncanbSeusedtoorverride]apeculiarbeharviourofMathematica'sprimitiveText. mdTVoQplacetext,4mma2ltxnormallyusesthesameconrventionsQoftheMathematica'sprimitivre`Text':8referencepSoint(x;yn9)isrealizedasfollows:ThetextstringisplacedinrtoabSoxhavingthesamesize.UAnQ!o set(s̹xH;s̹y )inthebSoundingborxcoordinatessystem(seetheFig.1)determineswherethereferencepSoinrtgoes.x⍍KdfdjDO line10D-qqϜferO0d6F=VM8΍8̍wZ;}BK`yG cmr10BT9ext ~K1 ~K fe p6,K? b>p cmmi10xU[8̎̉VM)[G< lcirclew10Gr_8JAacmr6(1;cmmi6;G1))2Gr?Í(1;G0))Gr䈍T(1;Gq% cmsy61)rOGr䈍t߾(0;G1)GYuGr䈍6d(1;G1)GYu2Gr?Í.Q(1;G0)GYu[Gr_9H+(1;G1)rO[Gr_t߾(0;G1)L{{0,{Pi/2,"\\pi\\over2"},{Pi,"\\pi"},r{3Pi/2,,"3{\\Pi\\over2}"},{2Pi,"2\\pi"},Automatic}]Note,>toobtainthebacrkslash`\'fromwithinMathematicaitmustbSedoubled.)ISoeveryL"s3Va^T E!XconrtrolsequencespSeci edintoaMathematicastringmustbSeprecededbya`\\'.FVorexampletoplacetheformrula/JffG(x)UR=sinō\L1QmfeR  x;>atthepSoinrt(0:5;0:5)ofagraphic,leftandbottomaligned,wremayusetheMathematicacommand'hText["f(x)=\\sin\\frac{1}{x}",,{0.5,0.5},{-1,-1}](VQ9ManualVadjustmentoflab+elsb#SometimesmaryhappSenstohavetwoormorelabSelstoomruchclosedeacrhother.Inthiscasea}?manrualadjustmentisneeded.TVodothis,editthe legeneratedbymma2ltxhavingtheextension`.tex'.8FVorinstance,let'sanalyzethe le`mypic.tex':%,Picture:mypic.eps%,Createdbymma2ltxv1.2-Copyright(C)1994GiuseppeGhib\`o%,Commandline:mma2ltx-ucm-w10cm-sfootnotesizemypic.ps%,Creationdate:SatJul1610:40:431994\mmaheaderprotrue{%ߐ8 WH\footnotesize%\mmasetpic(10.0000,6.1803)[cm]{mypic.eps}\mmatextfits(2.152,3.090)(0,2){$0.2$}\mmatextfits(4.051,3.090)(0,2){$0.4$}\mmatextfits(5.949,3.090)(0,2){$0.6$}\mmatextfits(7.848,3.090)(0,2){$0.8$}\mmatextfits(9.747,3.090)(0,2){$1$}\mmatextfits(0.129,0.157)(1,0){$-1$}\mmatextfits(0.129,1.623)(1,0){$-0.5$}\mmatextfits(0.129,4.557)(1,0){$0.5$}\mmatextfits(0.129,6.024)(1,0){$1$}\mmatextfits(5.000,4.557)(-1,-1){$f(x)=,\sin\frac{1}{x}$}\begin{mmapicture}\mmaputtext(2.152,3.090)(0,2){$0.2$}\mmaputtext(4.051,3.090)(0,2){$0.4$}\mmaputtext(5.949,3.090)(0,2){$0.6$}\mmaputtext(7.848,3.090)(0,2){$0.8$}\mmaputtext(9.747,3.090)(0,2){$1$}\mmaputtext(0.129,0.157)(1,0){$-1$}\mmaputtext(0.129,1.623)(1,0){$-0.5$}\mmaputtext(0.129,4.557)(1,0){$0.5$}\mmaputtext(0.129,6.024)(1,0){$1$}\mmaputtext(5.000,4.557)(-1,-1){$f(x)=,\sin\frac{1}{x}$}\end{mmapicture}%}%33WVe#CmaryobservethateverylabSelappearstrwiceinthe.tex le: withinthecommand\mmatextfitspandinthecommand\mmaputtext(andsometimesinthecommand\mmaputtext*).Thesecommandsharvethefollorwingsyntax:gY\mmatextfits(x;yn9)(s̹xH;s̹y )[(o #fcmti8x;o ̻y)]{objeffct}gY\mmaputtext,(x;yn9)(s̹xH;s̹y )[(o ̻x;o ̻y)]{objeffct}gY\mmaputtext*(x;yn9)(s̹xH;s̹y )[(o ̻x;o ̻y)]{objeffct}whereX&(x;yn9)arethecoSordinatesofthereferencepoinrt.Z(s̹xH;s̹y )aretheboundingborxcoor-dinatess$asexplainedatx {6.11.T(o ̻x;o ̻y)isanoptionalargumenrtandrepresentstheo setinthexandydirectionfromthereferencepSoinrt(x;yn9).fobjeffct$DgmaybSeanyL"s3Va^T E!XWob-jecty(evrenanothermma2ltxpicture). RTheunitofmeasureistheonewhichappSearsin`\mmasetpic'vcommand(inthiscasecm).=Thecommand`\mmaputtext*'hasthesamee ectof8%`\mmaputtext',KexceptitenclosestheobjeffctinawhitebSorx(seethelabel\sometext"inthe3DgraphicshorwninFig.4).FVorinstancesuppSosewrewanttomoverightthelabSel`0:2'by0:5cm,/Uthenwemustreplacetheline'h\mmatextfits(2.152,3.090)(0,2){$0.2$}withthelineߐ9 bH'h\mmatextfits(2.152,3.090)(0,2)(0.5,0){$0.2$}andtheline'h\mmaputtext(2.152,3.090)(0,2){$0.2$}withtheline'h\mmaputtext(2.152,3.090)(0,2)(0.5,0){$0.2$}Note7thatthisapproacrhissimilartotheoneexplainedatx 66.11,withtheexceptionthatwemarycontroleverylabSel,ratherthanagroupoflabels.NorwsuppSosewewanttoreplacethelabSel`0:8'placedunderthex-axiswiththelabel`x̸1'GltoplaceorverGlthex-axiswiththelorwedgeofthe(invisible)bSoxthatbSoundsthislabelat0:2cm*fromthex-axis.8Inthiscasewremustreplacethelines'h\mmatextfits(7.848,3.090)(0,2){$0.8$}'h.'h.'h.'h\mmaputtext(7.848,3.090)(0,2){$0.8$}withthelines'h\mmatextfits(7.848,3.090)(0,-1)(0,0.2){$x_1$}'h.'h.'h.'h\mmaputtext(7.848,3.090)(0,-1)(0,0.2){$x_1$}TheresultisshorwninFig.4.W*\0psfile=12mag.eps hsize=283.46375 vsize=175.18903o0:2dɍL0:4o70:66%x1oo1VSJ1ԠqK,0:5SJ0:5Wҥ[Yh1w{-Qf(x)=sin<$G1wfe (֍x.,1psfile=12mag_3d.eps hsize=103.6371 vsize=85.03912z2M1j0D G,2_52Rhj0[lph20 Y1޼0:5!50B E0:5!1z2M1j0D G,2U4x0psfile=mmawhite.eps hsize=42.81207 vsize=11.67684xQff* 믍 ffsomeXtext*,9 ffffff*ӼFigure4:8Asample gure.ܠ10 nHQ10%TheVpxrogramZFontForm'Mathematicaparameter.(VQ13%Tj~oVdolistb#Herefollorwfutureenhancementswhichareonmylist:ܠ12 yHAddsuppSortforL"s3Va^T E!X2U".AddsuppSortforrotatedlabels.AddsuppSortforothersdvitoProstScriptprocessors.(VQ14%AuthoxrVinfob#If4Kyrouhavesomequestions,suggestions,comments,bug4KrepSortorenhancementrequests,pleasefeelfreetoconrtactmeatoneofthefollowingaddresses:ordinarymail:GiuseppSeGhib oviaSestriere,133I-10090CascineVica{Rivroli(TVorino)ITVALYinternet:8ghibffo@galileo.polito.it(VQ15%Acknoxwledgementsb#Theauthorwishestothanks:PV.LepSoraforhissigni cativresuggestionsandcollaboration.PV.Boieriforhissuggestionsandforharvingintenselytestedmma2ltx.Q16%Histoxryb#version1.23!t-qAddedoption-atodrarwarrowsonaxesofa2Dgraphic.!t-qFixedabuginthestrylemmatext.sty.version1.22!t-qFixedasmallbugwhicrhcaused'segmentationfault'underLinux.!t-qUseofpSerror()insteadofstrerror()(suggestedbryPeterWhaite).version1.21!t-qProssibilitytousenewrerprologue lesfromMathematica.!t-qAddedsuppSortformrultiple-coptions.ܠ13H!t-qAddedoption-e(suggestedbryHolgerDanielsson).!t-qFixedabuginthefunctionstrtolwr()(repSortedbryKlausBurkhard).version1.2!t-qAddedsuppSorttoobtainnon-transparenrtobjects.rNowobjects(strings,pictures-qandsoon),canbSeplacedtoorverlapthebacrkgroundgraphic,i.e.asiftheywrere-qnon-transparenrt.!t-qAddedProstScriptdoScumentationfor600dpiprinters.!t-qAddedbinaryexecutablefortheAmiga.version1.1;ߢFirstpublicrelease.ܠ14;΀Zp cmmi106!",ff cmsy104K`yff cmr101߆T cmtt120N cmbx12/}h! cmsl12.@ cmti12-!", cmsy10,g cmmi12+XQ cmr12 cmmi10K`y cmr10#fcmti8K cmsy82cmmi8 |{Ycmr8ٓRcmr7q% cmsy6;cmmi6Aacmr6