÷ƒ’À;è TeX output 1997.02.18:1211‹ÿÿÿÿïheader=psfrag.pro ª� ýs o� ýÞ�’�’Áó߆µTG® cmtt12ºpsfrag.sty–7tóDÓítG®G®cmr17¹and“ºpsfrag.pro��Ÿùº¯ó!",š cmsy10¿ŽŽŽŸ�����‘{$óX«Q cmr12»Mic•¬rhael›ê¨Gran“t,˜Da“vid˜Carlisle,˜and˜Craig˜BarrattŽŽŸ��’§#1ó߆µT cmtt12Æpsfrag@rascals.stanford.eduŽŽŽŽŽŸ&37�’Ý »1997/01/22ŽŸ9þ5��‘IóÂÖN ff cmbx12È1Ž‘aLËó߆µTff cmtt12Épsfrag.styŽŸç��‘LüsóÙ“ Rcmr7±1Ž‘Sª®ó"©±�Ê cmsy9Íh�ó#ÒoÇw cmss9Îpack�¾9ageŽ‘#g ÍiŽŸûV��‘Ió&ÂÖN  cmbx12Ñ1.1Ž‘gÀIn� tializationŽŸuT��‘Lüs±2Ž‘Sª®óߤN cmtt9Ê\newif\ifpfg@compatޤ ��‘Lüs±3Ž‘Sª®Ê\newif\ifpfg@prepassŽ¡��‘Lüs±4Ž‘Sª®Ê\newif\ifpfg@debug‘¹–\pfg@debugfalseŽ¡��‘Lüs±5Ž‘Sª®Ê\if@compatibilityŽ¡��‘Lüs±6Ž‘]ÚÊ\pfg@compattrue\pfg@prepasstrueŽ¡��‘Lüs±7Ž‘Sª®Ê\elseŽ¡��‘Lüs±8Ž‘]ÚÊ\pfg@compatfalse\pfg@prepassfalseŽ¡��‘Lüs±9Ž‘Sª®Ê\fiŽ¡��‘I±10Ž‘Sª®Ê\def\psfragscanon{\pfg@prepasstrue}Ž¡��‘I±11Ž‘Sª®Ê\def\psfragscanoff{\pfg@prepassfalse}Ž¡��‘I±12Ž‘Sª®Ê\def\psfragdebugon{\pfg@debugtrue}Ž¡��‘I±13Ž‘Sª®Ê\def\psfragdebugoff{\pfg@debugfalse}ŽŸùS��‘I±14Ž‘Sª®Ê\DeclareOption{scanall}{\pfg@prepasstrue}Ž¡��‘I±15Ž‘Sª®Ê\DeclareOption{2emode}{\pfg@compatfalse\pfg@prepassfalse}Ž¡��‘I±16Ž‘Sª®Ê\DeclareOption{209mode}{\pfg@compattrue\pfg@prepasstrue}Ž¡��‘I±17Ž‘Sª®Ê\DeclareOption{debugshow}{\pfg@debugtrueŽ¡��‘I±18Ž’ÉÊTÊ\PassOptionsToPackage\CurrentOption{graphics}}Ž¡��‘I±19Ž‘Sª®Ê\DeclareOption*{\PassOptionsToPackage\CurrentOption{graphics}}Ž¡��‘I±20Ž‘Sª®Ê\ProcessOptionsŽŸùS�‘Xó'ßê cmmi10µy�[Ù²-axis.‘½~Man˜yŽ¡�‘Iother–@4drivš¸ãers“do“nothing.‘j¼Ho˜w˜ev˜er,‘Dnun˜til“w˜e“can“ nd“a“p�Gortable“w˜a˜y“to“mak˜e“thisŽ¡�‘Idetermination–UUin“Pš¸ãostScript“itself,“w˜e“ha˜v˜e“to“supply“that“information“here.Ž©��‘I±24Ž‘Sª®Ê\def\pfg@orient{1}ޤ ��‘I±25Ž‘Sª®Ê\def\@tempa{dvips.def}\ifx\Gin@driver\@tempa\def\pfg@orient{-1}\fi%Ž¡��‘I±26Ž‘Sª®Ê\def\@tempa{textures.def}\ifx\Gin@driver\@tempa\def\pfg@orient{-1}\fi%ŽŸþ6��‘IÑ1.2Ž‘gÀInš terface–€to“the“ó+ñkAH cmssbx10Ögraphics“Ñand“Öepsf‘j«Ñpac˜k‘ÿ@agesŽŸuT����‘ LøÊ\pfg@pcountŽŽŽ‘I²Coun•¸ãts›UUho“w˜man“y˜fragmen“ts˜are˜activ“e˜in˜the˜curren“t˜ gure.ŽŸ����‘ LøÊ\pfg@scountŽŽŽ‘I²Coun•¸ãts›ÒFho“w˜man“y˜replacemen“ts˜strings˜are˜activ“e˜in˜the˜curren“t˜ gure.‘è›Since˜itޤ �‘Iis–ˆ‰p�Gossible“for“a“single“string“to“accept“mš¸ãultiple“replacemen˜ts,‘ÕUÒ\pfg@scount“ó !",š cmsy10¸Ž¡�‘IÒ\pfg@pcount².ަ��‘I±27Ž‘Sª®Ê\newcount\pfg@pcount‘¹–\pfg@pcount=\z@ŽŸ ��‘I±28Ž‘Sª®Ê\newcount\pfg@scount‘¹–\pfg@scount=\z@ŽŸ����‘yº\epsfboxŽŽŽ‘I²Here–Êwš¸ãe“in˜tercept“calls“to“Ò\epsfbox“²and“wrap“them“with“the“ÓPSfrag‘ퟲpro�Gcessing.Ž¡�‘IW‘ÿ*ªe–›Yneed“to“di erenš¸ãtiate“b�Get˜w˜een“a“call“to“the“classic“Òepsf.sty“²macros“and“callsŽ¡�‘Ito–Ya“wrapp�Ger“around“the“Ógraphics“²pac�¸ãk‘ÿqÇage;‘ZÝso“Ò\ifpfg@epsf“²is“used“to“insure“thatŽ¡�‘Iour–X_functions“are“called“only“once.‘zä(These“wrapp�Gers“w�¸ãere“at“one“time“distributedŽ¡�‘Iwith–UUÓpsfrag²,“but“they“are“no“longer“needed.)ަ��‘I±29Ž‘Sª®Ê\let\pfg@epsfbox\epsfboxޤ ��‘I±30Ž‘Sª®Ê\newif\ifpfg@epsf\pfg@epsffalseŽ¡��‘I±31Ž‘Sª®Ê\def\epsfbox#1{%Ž¡��‘I±32Ž‘f‘Ê\begingroup\pfg@epsftrueŽ¡��‘I±33Ž‘f‘Ê\ifpfg@prepass\pfg@scan{#1}\fiŽ¡��‘I±34Ž‘f‘Ê\ifnum\pfg@scount>\z@\pfg@hidestart\fiŽ¡��‘I±35Ž‘f‘Ê\pfg@epsfbox{#1}%Ž¡��‘I±36Ž‘f‘Ê\ifnum\pfg@scount>\z@\pfg@hideend\fiŽ¡��‘I±37Ž‘f‘Ê\endgroup}ŽŸ����‘ÙÌ\Ginclude@epsŽŽŽ‘I²W‘ÿ*ªe–Ì‘need“to“o•¸ãv“erride–Ì‘this“function“from“the“Ógraphics“²pac�¸ãk‘ÿqÇage“in“a“similar“fashionŽŸ �‘Ito‘UUÒ\epsfbox².ަ��‘I±38Ž‘Sª®Ê\let\pfg@Ginclude@eps\Ginclude@epsŽ¡��‘I±39Ž‘Sª®Ê\def\Ginclude@eps#1{%Ž¡��‘I±40Ž‘f‘Ê\ifpfg@epsf\elseŽ¡��‘I±41Ž‘yw^Ê\begingroup\ifpfg@prepass\pfg@scan{#1}\fiŽ¡��‘I±42Ž‘yw^Ê\ifnum\pfg@scount>\z@\pfg@hidestart\fiŽ¡��‘I±43Ž‘f‘Ê\fiŽ¡��‘I±44Ž‘f‘Ê\pfg@Ginclude@eps{#1}%Ž¡��‘I±45Ž‘f‘Ê\ifpfg@epsf\elseŽ¡��‘I±46Ž‘yw^Ê\ifnum\pfg@scount>\z@\pfg@hideend\fiŽ¡��‘I±47Ž‘yw^Ê\endgroupŽ¡��‘I±48Ž‘f‘Ê\fi}ŽŸ����‘3PpsfragsŽŽŽ‘I²De nes–UUa“dummš¸ãy“en˜vironmen˜t“to“delimit“the“scop�Ge“of‘rÓPSfrag‘xâ²replacemen˜ts.ަ��‘I±49Ž‘Sª®Ê\newenvironment{psfrags}{\ignorespaces}{\global\@ignoretrue}ŽŽŸ�’ø²2ŽŽŒ‹ § ª� ýs o� ý´����‘ý 6Ê\psfragspecialŽŽŽ‘I²This–UUmacro“is“no“longer“supp�Gorted.Ž©��‘I±50Ž‘Sª®Ê\ifpfg@compatޤ ��‘I±51Ž‘Sª®Ê\def\psfragspecial#1#2#3#4#5#6{%Ž¡��‘I±52Ž‘a×pÊ\PackageError{PSfrag}%Ž¡��‘I±53Ž‘kJœÊ{\string\psfragspecial–¹–no“longer“implemented.}{}}Ž¡��‘I±54Ž‘Sª®Ê\fiŽŸ����‘3P\psfragŽŽŽ‘IÒ{�¸hÔtag‘â}¸iŽ‘²Ò}[�¸hÔp‘ÿ}'osn‘Äc¸iŽ‘÷�Ò][�¸hÔpsp‘ÿ}'osn‘Äc¸iŽ‘%*ÀÒ][�¸hÔscl‘‰¸iŽ‘6Ò][�¸hÔr‘ÿ}'ot‘òظiŽ‘Ý}Ò]ޤ �‘I²The–‰#main“macro“Ò\psfrag“²m�¸ãust“bšGe“de ned“sp˜ecially“in“order“to“handle“its“o˜dd“com-Ž¡�‘Ibination–‰�of“optional“and“required“argumenš¸ãts.‘wIn“addition,‘–žcatco�Gde“tric˜ks“(thanksŽ¡�‘Ito–:Daš¸ãvid“Carlisle“and“others)“allo˜w“sp�Gecial“c˜haracters“to“b�Ge“used“inside“the“tagŽ¡�‘Itext.‘�It–1Balso“replaces“spaces“with“their“o�Gctal“equiv‘ÿqÇalenš¸ãts“to“prev˜en˜t“driv˜ers“lik˜eŽ¡�‘IÓdvips–UU²from“breaking“one“in“the“middle.ަ��‘I±55Ž‘Sª®Ê\newif\ifpfg@starޤ ��‘I±56Ž‘Sª®Ê\def\psfrag{\@ifstar{\pfg@startrue\@psfraga}{\pfg@starfalse\@psfraga}}Ž©��‘I±57Ž‘Sª®Ê\def\@psfraga{\begingroupŽ¡��‘I±58Ž‘a×pÊ\@makeother\"\@makeother\*\@makeother\!\@makeother\~%Ž¡��‘I±59Ž‘a×pÊ\@makeother\:\@makeother\\\@makeother\%\@makeother\#%Ž¡��‘I±60Ž‘a×pÊ\@makeother\‘¹–\@psfragb}ަ��‘I±61Ž‘Sª®Ê\ifpfg@compatŽ¡��‘I±62Ž‘Sª®Ê\def\@psfragb#1{\xdef\@gtempa{#1}\endgroupŽ¡��‘I±63Ž’ŸDÊ\@ifnextchar[{\@psfragc{\@gtempa}}%Ž¡��‘I±64ޒܰ¬Ê{\@psfrag{\@gtempa}[bl][bl][1][0]}}Ž¡��‘I±65Ž‘Sª®Ê\def\@psfragc#1[#2]{\@ifnextchar‘¹–[{\@psfragd{#1}[#2]}%Ž¡��‘I±66Ž’ôPšÊ{\@psfrag{#1}[#2][bl][1][0]}}ަ��‘I±67Ž‘Sª®Ê\elseŽ¡��‘I±68Ž‘Sª®Ê\def\@psfragb#1{\xdef\@gtempa{#1}\endgroupŽ¡��‘I±69Ž’ŸDÊ\@ifnextchar‘¹–[{\@psfragc{\@gtempa}}%Ž¡��‘I±70Ž’ájBÊ{\@psfrag{\@gtempa}[Bl][Bl][1][0]}}Ž¡��‘I±71Ž‘Sª®Ê\def\@psfragc#1[#2]{\@ifnextchar‘¹–[{\@psfragd{#1}[#2]}%Ž¡��‘I±72Ž’ôPšÊ{\@psfrag{#1}[#2][Bl][1][0]}}Ž¡��‘I±73Ž‘Sª®Ê\fiަ��‘I±74Ž‘Sª®Ê\def\@psfragd#1[#2][#3]{\@ifnextchar‘¹–[{\@psfrage{#1}[#2][#3]}%Ž¡��‘I±75Ž’6òÊ{\@psfrag{#1}[#2][#3][1][0]}}Ž¡��‘I±76Ž‘Sª®Ê\def\@psfrage#1[#2][#3][#4]{\@ifnextchar‘¹–[{\@psfrag{#1}[#2][#3][#4]}%Ž¡��‘I±77Ž’ ðˆÊ{\@psfrag{#1}[#2][#3][#4][0]}}ŽŸ����‘yº\@psfragŽŽŽ‘IÒ{�¸hÔtag‘â}¸iŽ‘²Ò}ޤ �‘I²Noš¸ãw–ø)that“w˜e“ha˜v˜e“all“of“the“argumen˜ts,‘ Þw˜e“need“to“c˜hec˜k“to“c˜hec˜k“to“see“if“theŽ¡�‘Istring–@/has“b�Geen“used“yš¸ãet;‘GÒ.ަ��‘I±88Ž‘Sª®Ê\def\@nameedef#1#2{\expandafter\edef\csname‘¹–#1\endcsname{#2}}Ž©’Ú��‘I±89Ž‘Sª®Ê\def\@@@psfrag#1.#2.#3[#4][#5][#6][#7]#8{%ޤ ��‘I±90Ž‘f‘Ê\advance\pfg@pcount\@neŽ¡��‘I±91Ž‘f‘Ê\ifpfg@star\else\@nameedef{pfg@align@#2}{(#3)[}\fiŽ¡��‘I±92Ž‘f‘Ê\@nameedef{pfg@align@#2}{\@nameuse{pfg@align@#2}[#1(#5)#6‘¹–#7]}%Ž¡��‘I±93Ž‘f‘Ê\@namedef{pfg@place@#1}{\pfg@@place{#1}{#4}{#8}}\ignorespaces}ަ��‘I±94Ž‘Sª®Ê\def\pfg@align#1.{\@nameuse{pfg@align@#1}}Ž¡��‘I±95Ž‘Sª®Ê\def\pfg@place#1.{\@nameuse{pfg@place@#1}}ŽŸa��‘IÑ1.3Ž‘gÀF‘þàragmen� t‘€pro�`cessingŽŸuT����‘ý 6Ê\pfg@hidestartŽŽŽ‘I²This–¤£pro�Gcedure“proš¸ãvides“P˜ostScript“with“a“list“of“the“strings“that“ÓPSfrag‘È0²w˜ould“lik˜eޤ �‘Ito–Wareplace,‘Š,and“the“conš¸ãtrol“p�Goin˜ts,–Š,scales,“and–Warotations“of“eac˜h“one.‘!The“P˜ostScriptŽ¡�‘Ico�Gde–®8in“Òpsfrag.pro“²will“use“this“information“to“construct“transformation“matricesŽ¡�‘Ifor–UUeacš¸ãh“replacemen˜t“to“mo˜v˜e“them“in˜to“propšGer“p˜osition.‘qÇ.Ž© Im��‘I±96Ž‘Sª®Ê\def\pfg@hidestart{%ޤ ��‘I±97Ž‘f‘Ê\def\pfg@{}\count@=\z@\loop\ifnum\count@<\pfg@scountŽ¡��‘I±98Ž‘yw^Ê\toks@=\expandafter{\expandafter\pfg@align\the\count@.}%Ž¡��‘I±99Ž‘yw^Ê\edef\pfg@{\pfg@\the\toks@]}%Ž¡��‘E�±100Ž‘yw^Ê\advance\count@‘¹–by\@ne\repeatŽ¡��‘E�±101Ž‘f‘Ê\Gin@PS@raw{/PSfrag‘¹–where{pop\pfg@\the\pfg@scount\spaceŽ¡��‘E�±102Ž’ŸDÊ\ifpfg@debug1\else0\fi\space\pfg@orient/BeginŽ¡��‘E�±103Ž’ŸDÊPSfrag}{userdict‘¹–/PSfrag{pop}put}ifelse}}ŽŸÜG����‘“b\pfg@hideendŽŽŽ‘I²Noš¸ãw–¢†that“the“EPS‘¢Y le“has“b�Geen“loaded,‘ÆJand“(therefore)“all“of“the“replacemen˜t“p�Gosi-ޤ �‘Itions›óha•¸ãv“e˜b�Geen˜determined,‘Ômo“v“e˜eac“h˜replacemen“t˜to˜its˜prop•Ger˜p“osition˜b�¸ãy˜call-Ž¡�‘Iing–àthe“Ò\pfg@place“²pro�Gcedure“for“eac�¸ãh“one.‘^õExcept“for“the“calls“to“Ò\Gin@PS@raw²,Ž¡�‘Iit–�¼lo�Goks“likš¸ãe“w˜e're“building“a“v˜ertical“list“of“the“replacemen˜ts:‘æ•that's“the“idea,Ž¡�‘Ib�Gecause–UUwš¸ãe“w˜an˜t“it“to“lo�Gok“decen˜t“when“view˜ed“b˜y“a“D˜VI“view˜er.ަ��‘E�±104Ž‘Sª®Ê\def\pfg@hideend{%ޤ ��‘E�±105Ž‘f‘Ê\Gin@PS@raw{/End‘¹–PSfrag}%Ž¡��‘E�±106Ž‘f‘Ê\vbox‘¹–to\z@{\vssŽ¡��‘E�±107Ž‘yw^Ê\Gin@PS@raw{/Hide‘¹–PSfrag}%Ž¡��‘E�±108Ž‘yw^Ê\hbox–¹–to\z@{\hss“\raisebox{\depth}{%Ž¡��‘E�±109Ž’Œ]¶Ê\underline{PSfrag‘¹–replacements}}}%Ž¡��‘E�±110Ž‘yw^Ê\Gin@PS@raw{/Unhide‘¹–PSfrag}%Ž¡��‘E�±111Ž‘yw^Ê\count@=\z@\loop\ifnum\count@<\pfg@pcountŽ¡��‘E�±112Ž’Œ]¶Ê\expandafter\pfg@place\the\count@.%Ž¡��‘E�±113Ž’Œ]¶Ê\advance\count@‘¹–by\@ne\repeat}}ŽŽŸ�’ø²4ŽŽŒ‹"¶ ª� ýs o� ý´����‘ LøÊ\pfg@@placeŽŽŽ‘IÒ{�¸hÔr‘ÿ}'epl-key‘â}¸iŽ‘*DŽÒ}{�¸hÔp‘ÿ}'osn‘Äc¸iŽ‘÷�Ò}{�¸hÔr–ÿ}'eplac“ement‘òظiŽ‘<8pÒ}ޤ �‘I²The–¨Âfolloš¸ãwing“macro“do�Ges“the“dirt˜y“w˜ork.‘lIts“job“is“to“insert“the“appropriateŽ¡�‘IcošGde–Õåso“that“the“T�‘þU>Ÿ'EŽ‘ãxX“replacemen�¸ãt“is“transformed“to“its“requested“lo˜cation;‘.and,Ž¡�‘Iif–sCdesired,‘z¿rep�Geated“for“as“manš¸ãy“times“as“the“P˜ostScript“tag“text“app�Geared“in“theŽ¡�‘I gure.Ž¡�‘XIt–-äpšGerforms“this“magic“b�¸ãy“ rst“surrounding“the“T�‘þU>Ÿ'EŽ‘ãxX-pro˜duced“co˜de“in“curlyŽ¡�‘Ibraces,‘Zzso–Yswš¸ãe“can“defer“its“execution“while“w˜e“ gure“out“where“to“place“it.‘~ Then,Ž¡�‘Iwš¸ãe–ºcall“the“ÒPlace“²routine“in“Òpsfrag.pro²,‘ÓBwhic˜h“tak˜es“Ò{�¸hÔr‘ÿ}'epl-key‘â}¸iŽ‘*DŽÒ}“²and“pro˜videsŽ¡�‘Ithe–UUpropšGer“co˜ordinate“transformations.Ž¡�‘XW‘ÿ*ªe're›ø+allo•¸ãw“ed˜to˜reassign˜these˜dimension˜registers˜b�Gecause˜w“e˜are˜alw“a“ysŽ¡�‘Iinside–UUa“group“when“wš¸ãe“use“them.‘qÇThis“tec˜hnique“is“tak˜en“from“Ògraphics.sty²...ޤ��‘E�±114Ž‘Sª®Ê\let\pfg@dp\leftmargini\let\pfg@wd\leftmarginiiŽ© ��‘E�±115Ž‘Sª®Ê\let\pfg@dx\leftmarginiii\let\pfg@dy\leftmarginivŽŸ�‘I²W‘ÿ*ªe–UUneed“to“stu “the“curly“braces“in�¸ãto“macros.Ž¡��‘E�±116Ž‘Sª®Ê\edef\pfg@bchar{–¹–\string{“}ަ��‘E�±117Ž‘Sª®Ê\edef\pfg@echar{–¹–\string}“}ަ��‘E�±118Ž‘Sª®Ê\def\pfg@@place#1#2#3{\begingroupŽŸ�‘I²Tš¸ãyp�Geset–UUthe“replacemen˜t“in˜to“a“b�Go˜x“and“determine“its“dimensions.Ž¡��‘E�±119Ž‘f‘Ê\sbox\z@{#3}%ަ��‘E�±120Ž‘f‘Ê\dimen@=\ht\z@–¹–\advance\dimen@“by\dp\z@%ŽŸ�‘I²Determine–é¡the“desired“alignmenš¸ãt“of“the“T�‘þU>Ÿ'EŽ‘ãxX“b�Go˜x,‘ÿ,and“the“glue“that“will“b�Ge“neededŽŸ �‘Iin–UUorder“to“ac•¸ãhiev“e–UUthis“alignmen�¸ãt.Ž¡��‘E�±121Ž‘f‘Ê\pfg@wd=0.5\wd\z@\pfg@dp=0.5\dimen@ަ��‘E�±122Ž‘f‘Ê\pfg@dx=\pfg@wd\pfg@dy=\pfg@dpަ��‘E�±123Ž‘f‘Ê\@tfor\@tempa:=#2\do{%ަ��‘E�±124Ž‘yw^Ê\if–¹–l\@tempa“\pfg@dx=\z@‘æX\pfg@wd=\wd\z@“\elseަ��‘E�±125Ž‘yw^Ê\if–¹–r\@tempa“\pfg@dx=\wd\z@“\pfg@wd=\z@‘æX\elseަ��‘E�±126Ž‘yw^Ê\if–¹–b\@tempa“\pfg@dy=\z@–æX\pfg@dp=\z@“\elseަ��‘E�±127Ž‘yw^Ê\if–¹–t\@tempa“\pfg@dy=\dimen@\pfg@dp=\dimen@\elseަ��‘E�±128Ž‘yw^Ê\if–¹–B\@tempa“\pfg@dy=\dp\z@“\pfg@dp=\dp\z@“\fi\fi\fi\fi\fi}%ŽŸ�‘I²Create–C8a“zero-area“b�Goš¸ãx“with“the“desired“ÓPSfrag‘fŲreplacemen˜t“text“t˜yp�Geset“insideޤ �‘Iof–1Yit“(and“aligned“with“the“glue).‘ÔThis“is“actually“the“bšGo�¸ãx“that“will“b˜e“mo•¸ãv“ed,Ž¡�‘Irotated,–UUand/or“scaled.ŽŸ��‘E�±129Ž‘f‘Ê\setbox\z@\hbox‘¹–to\z@{\hskip-\pfg@dx\box\z@\hss}%ަ��‘E�±130Ž‘f‘Ê\setbox\z@\vbox‘¹–to\z@{\vss\box\z@\vskip-\pfg@dy}%ŽŸ�‘I²T�¸ãypšGeset–îthe“b˜o�¸ãx.‘^¥The“inner,‘'izero-size“b˜oš¸ãx“is“the“one“w˜e“place“with“the“P˜ostScriptŽ¡�‘Ico�Gde,›Pand–òŽthe“outer,˜full-heigh•¸ãt,˜righ“t-–òŽjusti ed“b�Goš¸ãx“is“the“one“that“w˜e“use“to“stac˜kŽ¡�‘Iup–UUthe“preview“list.ŽŸ��‘E�±131Ž‘f‘Ê\vbox–¹–to\dimen@{\vss\hbox“to\z@{\hssަ��‘E�±132Ž‘yw^Ê\Gin@PS@raw{\pfg@bchar}\box\z@ަ��‘E�±133Ž‘yw^Ê\Gin@PS@raw{\pfg@echar#1/Place‘¹–PSfrag}%ަ��‘E�±134Ž‘yw^Ê\hskip\pfg@wd}\vskip\pfg@dp}%ަ��‘E�±135Ž‘f‘Ê\endgroup}ŽŸ��‘E�±136Ž‘Sª®Íh�ó!5ùž" cmmi9Ì=Îpack�¾9ageŽ‘#g Íiަ��‘E�±137Ž‘Sª®Íh�Î lep�¾9roŽ‘5GÍiŽŽŸ�’ø²5ŽŽŒ‹0ò ª� ýs o� ý´��‘IÈ2Ž‘aLËThe–ffP�ŒÌostScript“library‘þ¦f,“Épsfrag.proŽŸç�‘I²This–›1cošGde“m�¸ãust“p˜erform“t•¸ãw“o–›1functions:‘µ1)“determine“and“sa•¸ãv“e–›1the“alignmen�¸ãt“p˜oin�¸ãt,ޤ �‘Irotation,‘¸þand–¥scaling“for“eacš¸ãh“piece“of“P˜ostScript“text“that“is“going“to“serv˜e“as“aŽ¡�‘IÓPSfrag‘÷¡²tag;‘“tand–Ô2)“use“that“information“to“propšGerly“transform“the“co˜ordinateŽ¡�‘Isystem–UUfor“eacš¸ãh“T�‘þU>Ÿ'EŽ‘ãxX“replacemen˜t.Ž¡�‘XThe–!ªonly“t•¸ãw“o›!ªsym“b�Gols˜that˜w“e˜de ne˜globally˜are˜ÒPSfragLib²,‘TÀthe˜library˜ofŽ¡�‘Isupp�Gort›¬êroutines,–ÂÏÒPSfragDict²,“the˜dictionary˜con�¸ãtaining˜the˜\magic"˜Òshow˜²com-Ž¡�‘Imands,–n[and›iZÒPSfrag²,“the˜gatew•¸ãa“y˜from˜the˜global˜namespace˜to˜ÒPSfragLib².‘­ÖThisŽ¡�‘Itecš¸ãhnique–1 minimizes“the“p�Gossibilit˜y“that“our“pro�Gcedure“names“will“con ict“withŽ¡�‘Ithose–UUde ned“bš¸ãy“the“P˜ostScript“driv˜er“or“the“ gure“itself.Ž©��‘E�±138Ž‘Sª®Êuserdict‘¹–beginޤ ��‘E�±139Ž‘Sª®Ê/PSfragLib–¹–90“dict“defŽ¡��‘E�±140Ž‘Sª®Ê/PSfragDict–¹–6“dict“defŽ¡��‘E�±141Ž‘Sª®Ê/PSfrag–¹–{“PSfragLib“begin“load“exec“end“}“bind“defŽ¡��‘E�±142Ž‘Sª®ÊendŽŸ����‘À$PSfragLibŽŽŽ‘IÒPSfragLib–ª(²is“the“dictionary“with“the“meat�¸ãy“stu .‘p@W‘ÿ*ªe're“also“de ning“some“use-ޤ �‘Iful– abbreviations.‘‰ðOf“note“is“the“ÒOE‘ß²command“(\outside“exec"),‘4»whic�¸ãh“executesŽ¡�‘Isome–‡¨co�Gde“after“remoš¸ãving‘«5ÒPSfragLib“²from“the“stac˜k“(to“insure“that“there“are“noŽ¡�‘Icollisions–UUwith“ÒPSfragLib²'s“in�¸ãternal“names.ަ��‘E�±143Ž‘Sª®ÊPSfragLib‘¹–beginޤ ��‘E�±144Ž‘Sª®Ê/RO–¹–/readonly‘Y„load“defŽ¡��‘E�±145Ž‘Sª®Ê/CP–¹–/currentpoint‘ s,load“defŽ¡��‘E�±146Ž‘Sª®Ê/CM–¹–/currentmatrix“load“defŽ¡��‘E�±147Ž‘Sª®Ê/B–¹–{“bind“RO“def“}“bind“defŽ¡��‘E�±148Ž‘Sª®Ê/X–¹–{“exch“def“}“BŽ¡��‘E�±149Ž‘Sª®Ê/MD–¹–{“{“X“}“forall“}“BŽ¡��‘E�±150Ž‘Sª®Ê/OE–¹–{“end“exec“PSfragLib“begin“}“BŽ¡��‘E�±151Ž‘Sª®Ê/tstr–¹–8“string“defŽ¡��‘E�±152Ž‘Sª®Ê/islev2–¹–{“languagelevel“}“stopped“{“false“}“{“2“ge“}“ifelse“defŽŸ�‘I²Allo�Gcate–àLsome“space“for“matrices“that“wš¸ãe“will“use“frequen˜tly‘ÿ*ª.‘ ­ÒsrcFM‘ßç²con˜tainsޤ �‘Ia–:ymatrix“whic�¸ãh“describšGes“the“di erence“b˜et•¸ãw“een›:yP“ostScript's˜Òdefaultmatrix˜²andŽ¡�‘Ithe–S¢transformation“that“the“D•¸ãVI-to-PS‘Sadriv“er's–S¢\default“matrix."‘áThis“informationŽ¡�‘Iis–UUcrucial“to“the“prop�Ger“placing“of“the“ÓPSfrag‘xâ²replacemen�¸ãts.ަ��‘E�±153Ž‘Sª®Ê[–¹–/tM“/srcM“/dstM“/dM“/idM“/srcFM“/dstFM“]“{“matrix“def“}“forallޤ ��‘E�±154Ž‘Sª®ÊdM–¹–defaultmatrix“RO“idM“invertmatrix“RO“popŽ¡��‘E�±155Ž‘Sª®ÊsrcFM–¹–identmatrix“popŽŸ����‘,`HideŽŽ���Ÿ �‘"ìæUnhideŽŽŽŽŽ‘I²Surrounding–èIa“(fairly)“arbitrary“piece“of“P�¸ãostScript“co�Gde“with“calls“to“ÒHide“²andޤ �‘IÒUnhide–|ó²should“render“it“inš¸ãvisible.‘è ÓPSfrag‘ €²uses“these“calls“to“hide“un˜used“replace-Ž¡�‘Imenš¸ãts.‘>Note–™ithat“w˜e“are“assuming“that“the“D˜VI-to-PS‘™driv˜er“isn't“relying“onŽ¡�‘Ian�¸ãy–3åof“the“information“that“will“bšGe“wip˜ed“out“b�¸ãy“the“Ògrestore²,‘kˆexcept“for“theŽ¡�‘IÒcurrentpoint².ަ��‘E�±156Ž‘Sª®Ê/Hide–¹–{“gsave“{“CP“}“stopped“not“newpath“clip“{“moveto“}“if“}“BŽŸ ��‘E�±157Ž‘Sª®Ê/Unhide–¹–{“{“CP“}“stopped“not“grestore“{“moveto“}“if“}“BŽŸ����‘3PsetreplŽŽ���¡�‘3PgetreplŽŽŽŽŽ‘I²These–UÖmacros“are“de ned“di erenš¸ãtly“for“Lev˜el“1“and“Lev˜el“2“P˜ostScript.‘sKÒsetreplŽ¡�‘I²accepts–YÀan“arraš¸ãy“of“N‘Y€elemen˜ts,‘Œfollo˜w˜ed“b˜y“the“length“N,“and“store“them“in“a“globalŽ¡�‘Iv›ÿqÇariable– a(or“the“equiv˜alen�¸ãt)“for“later“use.‘YvÒgetrepl“²restores“that“exact“informationŽŽŸ�’ø6ŽŽŒ‹=â ª� ýs o� ý´�‘I²to–COthe“stacš¸ãk.‘;µThis“is“used“to“store“the“replacemen˜t“information“in“a“p�Gersisten˜tŽ© �‘Ifashion.ŽŸ ���‘E�±158Ž‘Sª®Ê/setrepl–¹–islev2“{{“/glob“currentglobal“def“true“setglobal“array“astoreޤ ��‘E�±159Ž’­pÐÊglobaldict–¹–exch“/PSfrags“exch“put“glob“setglobal“}}Ž¡��‘E�±160Ž’ŸDÊ{{–¹–array“astore“/PSfrags“X“}}“ifelse“BŽ¡��‘E�±161Ž‘Sª®Ê/getrepl–¹–islev2“{{“globaldict“/PSfrags“get“aload“length“}}Ž¡��‘E�±162Ž’ŸDÊ{{–¹–PSfrags“aload“length“}}“ifelse“BŽŸ°����‘3PconvertŽŽŽ‘I²This–CÒroutine“takš¸ães“a“string“and“replaces“ev˜ery“c˜haracter“whose“ASCI•GI‘CÍco“de–CÒis“lessަ�‘Ithan–^ù32“with“a“space.‘޲This“makš¸ães“the“replacemen˜t“dictionary“robust“to“m˜ultiple-ަ�‘Iline–UUtags,“etc.ŽŸ ���‘E�±163Ž‘Sª®Ê/convert‘¹–{Ž¡��‘E�±164Ž‘a×pÊ/src–¹–X“src“length“stringŽ¡��‘E�±165Ž‘a×pÊ/c–¹–0“def“src“length“{Ž¡��‘E�±166Ž‘p2Êdup–¹–c“src“c“get“dup“32“lt“{“pop“32“}“if“put“/c“c“1“add“defŽ¡��‘E�±167Ž‘a×pÊ}‘¹–repeatŽ¡��‘E�±168Ž‘Sª®Ê}‘¹–BŽŸ°����‘'¦|BeginŽŽŽ‘IÓPSfrag‘ õ²calls–èhthis“routine“once“p�Ger“ gure,‘þ1once“it“has“placed“on“the“stacš¸ãk“all“of“eac˜hަ�‘Itag's›Ð^alignmen�¸ãt,–ï!rotation,“and˜scaling˜information.‘âãThis˜information˜is˜collectedަ�‘Iinš¸ãto–a#a“dictionary:‘‰ceac˜h“tag“has“an“en˜try“whic˜h“is“an“arra˜y“of“[“repl-k˜ey‘ÿ*ª,‘d(psp�Gosn),ަ�‘Iscl,‘âõrot–Æ¢]“quads.‘Å®Then“it“sa•¸ãv“es–Æ¢the“curren�¸ãt“transformation“information“in“a“formަ�‘Iready–UUfor“Ò/replace“²to“use.ŽŸ ���‘E�±169Ž‘Sª®Ê/Begin‘¹–{Ž¡��‘E�±170Ž‘f‘Ê/saver–¹–save“defŽ¡��‘E�±171Ž‘f‘ÊsrcFM–¹–exch“3“exch“putŽ¡��‘E�±172Ž‘f‘Ê0–¹–ne“/debugMode“X“0“setreplŽ¡��‘E�±173Ž‘f‘Êdup–¹–/S“exch“dict“def“{“S“3“1“roll“exch“convert“exch“put“}“repeatŽ¡��‘E�±174Ž‘f‘ÊsrcM–¹–CM“dup“invertmatrix“popŽ¡��‘E�±175Ž‘f‘Êmark–¹–{“currentdict“{“end“}“stopped“{“pop“exit“}“if“}“loopŽ¡��‘E�±176Ž‘f‘ÊPSfragDict–¹–counttomark“{“begin“}“repeat“popŽ¡��‘E�±177Ž‘Sª®Ê}‘¹–BŽŸ°����‘1¨EndŽŽŽ‘I²End› écon•¸ãv“erts˜the˜alignmen“t˜information˜that˜has˜b�Geen˜collected˜in“to˜a˜dictionary:ަ�‘Ieac•¸ãh›,±repl-k“ey˜that˜w“as˜encoun“tered˜in˜ÒBegin˜²has˜an˜en“try˜whic“h˜is˜an˜arra“y˜ofަ�‘Itransformation‘UUmatrices.ŽŸ ���‘E�±178Ž‘Sª®Ê/End‘¹–{Ž¡��‘E�±179Ž‘f‘Êmark–¹–{“currentdict“end“dup“PSfragDict“eq“{“pop“exit“}“if“}“loopŽ¡��‘E�±180Ž‘f‘Êcounttomark–¹–{“begin“}“repeat“popŽ¡��‘E�±181Ž‘f‘Êgetrepl–¹–saver“restoreŽ¡��‘E�±182Ž‘f‘Ê7–¹–idiv“dup“/S“exch“dict“def“{Ž¡��‘E�±183Ž‘yw^Ê6–¹–array“astore“/mtrx“X“tstr“cvs“/K“XŽ¡��‘E�±184Ž‘yw^ÊS–¹–K“[“S“K“known“{“S“K“get“aload“pop“}“if“mtrx“]“putŽ¡��‘E�±185Ž‘f‘Ê}‘¹–repeatŽ¡��‘E�±186Ž‘Sª®Ê}‘¹–BŽŸ°����‘'¦|PlaceŽŽŽ‘I²This–~7macro“is“called“once“for“eacš¸ãh“ÓPSfrag‘¡Ä²replacemen˜t.‘ìlIt“c˜hec˜ks“to“see“if“theަ�‘Ireplacemenš¸ãt's–Jctag“w˜as“actually“encoun˜tered“in“the“PS‘J gure;‘£_if“not,‘Çit“surrounds“theަ�‘Ico�Gde–HÞin“a“\clip“all"“conš¸ãtext“and“executes“it.‘mŸThis“mak˜es“it“in˜visible,‘K\as“requested,ަ�‘Ibut–P¹still“alloš¸ãws“it“to“run“so“that“an˜y“side“e ects“that“the“co�Gde“ma˜y“ha˜v˜e“will“tak˜eަ�‘Iplace.ަ�‘XIf–ÍÎthe“replacemenš¸ãt's“tag“Ôwas‘Ÿï²encoun˜tered,–èého˜w˜ev˜er,“it–ÍÎretriev˜es“the“transforma-ަ�‘Ition–~ïmatrix“that“wš¸ãas“calculated“for“it;‘“¼it“prep�Gends“this“calculation“to“the“curren˜tŽŽŸ�’ø7ŽŽŒ‹L8 ª� ýs o� ý´�‘I²(T�‘þU>Ÿ'EŽ‘ãxX)–�Ëtransformation“matrix“(some“tricš¸ãky“math“to“w˜ade“through“there!),‘·Mand“thenޤ �‘Idraš¸ãws–UUthe“replacemen˜t.Ž¡�‘XIf–nthere“are“mš¸ãultiple“copies“of“the“replacemen˜t“to“b�Ge“laid“do˜wn,‘P´this“will“doŽ¡�‘Iit,‘á°surrounding–Åžall“but“the“last“replacemen�¸ãt“in“a“Òsave²-Òrestore“²pair.‘¢This“Òsave²-Ž¡�‘IÒrestore–1Ʋpair“maš¸ãy“slo˜w“things“do˜wn,›8âbut“theoretically“it“is“necessary‘ÿ*ª,˜b�Gecause“theŽ¡�‘IprošGcedure–"migh�¸ãt“mo˜dify“other“v‘ÿqÇariables“in“the“P�¸ãostScript“namespace.‘^ W‘ÿ*ªe“need“toŽ¡�‘IbšGe–UUsure“that“those“mo˜di cations“do“not“\accum�¸ãulate".Ž¡�‘XF‘ÿ*ªor–Ÿ'EŽ‘ãxXcošGde“to“the“prop˜erŽ¡�‘Iorienš¸ãtation.‘NbIt–ô3stores“in“ÒreplArray²,‘ëfor“eac˜h“alignmen˜t/scale/rotation“com˜bina-Ž¡�‘Ition,–UUa“transformation“matrix“that“ac•¸ãhiev“es‘UUthis.ަ��‘E�±212Ž‘Sª®Ê/replace‘¹–{ŽŸ ��‘E�±213Ž‘f‘Êaload–¹–pop“MDŽŸm�‘I²T‘ÿ*ªrace–£¼out“the“text“and“determine“its“bšGounding“b˜o�¸ãx.‘6”W‘ÿ*ªe“need“to“temp˜orarily“rev�¸ãertŽ¡�‘Ito–Ûan“iden•¸ãtit“y–Ûtransformation“matrix,‘ü~so“that“wš¸ãe“can“b�Ge“sure“to“get“the“tigh˜testŽ¡�‘Ib•Gounding›Ê—b“o�¸ãx˜p“ossible.‘Ñ�If˜the˜text˜is˜rotated,‘ççthe˜b“ounding˜b“o•¸ãx˜that˜P“ostScriptŽ¡�‘Ipro�Gduces–UUwith“the“Òpathbbox“²command“is“not“optimal.Ž¡�‘XW‘ÿ*ªe–ûœalso“need“to“sa•¸ãv“e–ûœthe“pšGosition“of“the“p˜oinš¸ãt“follo˜wing“the“text“placemen˜t,Ž¡�‘Iand›`œmo•¸ãv“e˜to˜that˜p�Gosition˜when˜w“e'v“e˜ nished,‘£nto˜fo�Gol˜the˜PS‘`Xin“terpreter˜in“toŽ¡�‘Ithinking–UUw�¸ãe“actually“drew“that“text.ŽŽŸ�’ø8ŽŽŒ‹ Y_ ª� ýs o� ý´��‘E�±214Ž‘f‘ÊCP–¹–/bY“X“/lX“X“gsave“initmatrixޤ ��‘E�±215Ž‘f‘Êstr–¹–stringwidth“abs“exch“abs“add“dup“0“eqŽ¡��‘E�±216Ž‘yw^Ê{–¹–pop“}“{“360“exch“div“dup“scale“}“ifelseŽ¡��‘E�±217Ž‘f‘ÊlX–¹–neg“bY“neg“translate“newpath“lX“bY“movetoŽ¡��‘E�±218Ž‘f‘Êstr–¹–{“/ch“X“(“)“dup“0“ch“put“false“charpath“ch“Kproc“}“forallŽ¡��‘E�±219Ž‘f‘Êflattenpath–¹–pathbbox“[“/uY“/uX“/lY“/lX“]“MDŽ¡��‘E�±220Ž‘f‘ÊCP–¹–grestore“movetoŽ©�‘I²If–+žthe“F‘ÿ*ªonš¸ãtMatrix“sho˜ws“that“the“fon˜t“is“dra˜w“in“the“oppšGosite“X‘+gor“opp˜osite“Yޤ �‘Idirection,‘Vœthen–V[the“X›VZor“Y˜cošGordinates“of“the“b˜ounding“b˜o•¸ãx,‘Vœresp˜ectiv“ely‘ÿ*ª,‘Vœneed‘V[toŽ¡�‘Ib•Ge›sŒsw�¸ãapp“ed.‘ÌkThis˜actually˜o“ccurs˜quite˜often.‘ÌkHere˜w•¸ãe˜also˜determine˜the˜cen“terŽ¡�‘Iof–UUthe“b�Go�¸ãx.ŽŸ��‘E�±221Ž‘f‘Êcurrentfont–¹–/FontMatrix“get“dstFM“copy“dupޤ ��‘E�±222Ž‘f‘Ê0–¹–get“0“lt“{“uX“lX“/uX“X“/lX“X“}“ifŽ¡��‘E�±223Ž‘f‘Ê3–¹–get“0“lt“{“uY“lY“/uY“X“/lY“X“}“ifŽ¡��‘E�±224Ž‘f‘Ê/cX–¹–uX“lX“add“0.5“mul“defŽ¡��‘E�±225Ž‘f‘Ê/cY–¹–uY“lY“add“0.5“mul“defަ�‘I²If–Ýëdebug“mošGde“has“b˜een“enabled,‘õÍwš¸ãe“dra˜w“the“bšGounding“b˜o�¸ãx,›õÍthe“baseline,˜and“theŽŸ �‘Icen�¸ãter–UUlines“of“the“text.ŽŸ��‘E�±226Ž‘f‘ÊdebugMode–¹–{“gsave“0“setgray“1“setlinewidthŽ¡��‘E�±227Ž‘yw^ÊlX–¹–lY“moveto“lX“uY“lineto“uX“uY“lineto“uX“lY“lineto“closepathŽ¡��‘E�±228Ž‘yw^ÊlX–¹–bY“moveto“uX“bY“lineto“lX“cY“moveto“uX“cY“linetoŽ¡��‘E�±229Ž‘yw^ÊcX–¹–lY“moveto“cX“uY“lineto“strokeŽ¡��‘E�±230Ž‘f‘Êgrestore–¹–}“ifަ�‘I²Add–UUeacš¸ãh“replacemen˜t's“alignmen˜t“to“ÒreplArray².ŽŸ��‘E�±231Ž‘f‘ÊdstFM–¹–dup“invertmatrix“dstM“CM“srcMŽ¡��‘E�±232Ž‘f‘Ê2–¹–{“dstM“concatmatrix“}“repeat“popŽ¡��‘E�±233Ž‘f‘Êgetrepl–¹–/temp“XŽ¡��‘E�±234Ž‘yw^ÊS–¹–str“convert“get“{ަ�‘I²Retrievš¸ãe–UUthe“replacemen˜t“informationޤ��‘E�±235Ž’Œ]¶Êaload–¹–pop“[“/rot“/scl“/loc“/K“]“MDަ�‘I²Determine–UUthe“Pš¸ãostScript“alignmen˜t“p�Goin˜t.Ž¡��‘E�±236Ž’Œ]¶Ê/aX–¹–cX“def“/aY“cY“defޤ ��‘E�±237Ž’Œ]¶Êloc‘¹–{Ž¡��‘E�±238Ž’ŸDÊdup–¹–66‘ s,eq“{“/aY“bY“def“}“{“%“BŽ¡��‘E�±239Ž’ŸDÊdup–¹–98‘ s,eq“{“/aY“lY“def“}“{“%“bŽ¡��‘E�±240Ž’ŸDÊdup–¹–108“eq“{“/aX“lX“def“}“{“%“lŽ¡��‘E�±241Ž’ŸDÊdup–¹–114“eq“{“/aX“uX“def“}“{“%“rŽ¡��‘E�±242Ž’ŸDÊdup–¹–116“eq“{“/aY“uY“def“}‘,Â%“tŽ¡��‘E�±243Ž’ŸDÊif–¹–}“ifelse“}“ifelse“}“ifelse“}“ifelse“popŽ¡��‘E�±244Ž’Œ]¶Ê}‘¹–forallަ�‘I²Store– .the“replacemenš¸ãt“k˜ey‘ÿ*ª,›òäand“the“transformation“information,˜in“ÒreplArray².ޤ �‘IThese–ütransformations“are“app�Gended“to“the“CTM‘üencoun�¸ãtered“when“ÒPlace“²is“run.Ž¡�‘IIndeed,–UUthis“and“ÒPlace“²are“the“t•¸ãw“o–UUmost“dicult“pieces“of“co�Gde“to“understand.ŽŸ��‘E�±245Ž’Œ]¶ÊK–¹–srcFM“rot“tM“rotate“dstMޤ ��‘E�±246Ž’Œ]¶Ê2–¹–{“tM“concatmatrix“}“repeat“aload“pop“pop“popŽ¡��‘E�±247Ž’Œ]¶Ê2–¹–{“scl“normalize“4“2“roll“}“repeatŽ¡��‘E�±248Ž’Œ]¶ÊaX–¹–aY“transformŽ¡��‘E�±249Ž’Œ]¶Ê/temp–¹–temp“7“add“defŽ¡��‘E�±250Ž‘yw^Ê}‘¹–forallŽ¡��‘E�±251Ž‘f‘Êtemp‘¹–setreplŽŽŸ�’ø²9ŽŽŒ‹ g= ª� ýs o� ý´��‘E�±252Ž‘Sª®Ê}‘¹–BŽ©ÿ5����‘5Ó>rsŽŽ���Ÿ �‘1¨rksŽŽŽŽ���¤ ¡�‘1¨rasŽŽŽŽ���¤ ¡¡�‘1¨rwsŽŽŽŽ���¤ ¡¡¡�‘,`rawsŽŽŽŽŽ‘I²These–™˜macros“inš¸ãtercept“calls“to“their“P˜ostScript“coun˜terparts“and“execute“ÒreplaceŽŸ �‘I²in–UUtheir“stead“if“the“argumenš¸ãt“string“matc˜hes“one“in“the“replacemen˜t“list.ŽŸ ªg��‘E�±253Ž‘Sª®Ê/Rif‘¹–{ޤ ��‘E�±254Ž‘f‘ÊS–¹–3“index“convert“known“{“pop“replace“}“{“exch“pop“OE“}“ifelseŽ¡��‘E�±255Ž‘Sª®Ê}‘¹–BŽ¡��‘E�±256Ž‘Sª®Ê/XA–¹–{“bind“[“/Kproc“/str“}“B“/XC“{“]“2“array“astore“def“}“BŽ¡��‘E�±257Ž‘Sª®Ê/xs‘,Â{–¹–pop“}“XA“XCŽ¡��‘E�±258Ž‘Sª®Ê/xks‘ s,{–¹–/kern“load“OE“}“XA“/kern“XCŽ¡��‘E�±259Ž‘Sª®Ê/xas‘ s,{–¹–pop“ax“ay“rmoveto“}“XA“/ay“/ax“XCŽ¡��‘E�±260Ž‘Sª®Ê/xws‘ s,{–¹–c“eq“{“cx“cy“rmoveto“}“if“}“XA“/c“/cy“/cx“XCŽ¡��‘E�±261Ž‘Sª®Ê/xaws–¹–{“ax“ay“rmoveto“c“eq“{“cx“cy“rmoveto“}“if“}Ž¡��‘E�±262Ž‘f‘ÊXA–¹–/ay“/ax“/c“/cy“/cx“XCŽ¡��‘E�±263Ž‘Sª®Ê/raws–¹–{“xaws“{“awidthshow“}“Rif“}“BŽ¡��‘E�±264Ž‘Sª®Ê/rws‘ s,{–¹–xws“{“widthshow“}“Rif“}“BŽ¡��‘E�±265Ž‘Sª®Ê/rks‘ s,{–¹–xks“{“kshow“}“Rif“}“BŽ¡��‘E�±266Ž‘Sª®Ê/ras‘ s,{–¹–xas“{“ashow“}“Rif“}“BŽ¡��‘E�±267Ž‘Sª®Ê/rs‘,Â{–¹–xs“{“show“}“Rif“}“Bަ����‘3PrestoreŽŽŽ‘I²In–E5Levš¸ãel“1“P˜ostScript,‘Hothis“is“necessary“b�Gecause“global“v‘ÿqÇariables“do“not“exist“(andޤ �‘Iwš¸ãe–a.need“one!).‘•SEv˜ery“call“to“Òrestore“²wip�Ges“out“an˜y“v‘ÿqÇariables“that“w˜ere“mo�Gdi edŽ¡�‘Isince–@Ýthe“previous“call“to“Òsave².‘4`Unfortunately‘ÿ*ª,‘{¿this“is“not“guaranš¸ãteed“to“w˜ork,Ž¡�‘Ialthough–UUit“do�Ges“w�¸ãork“for“Ódvips².Ž¡�‘XF‘ÿ*ªor–{Levš¸ãel“2,‘)sw˜e“can“use“global“v‘ÿqÇariables“so“this“is“not“necessary–ÿ*ª.‘_~W“e–{mak˜e“thisŽ¡�‘Idistinction›$Ôat–fˆprint“time²,‘-áso˜a˜ le˜that˜do�Ges˜not˜seem˜to˜w•¸ãork˜on˜a˜Lev“el˜1˜prin“terŽ¡�‘Ifor–$�whicš¸ãh“it“w˜as“originally“in˜tended“should“still“w˜ork“on“a“Lev˜el“2“prin˜ter“withoutŽ¡�‘Imo�Gdi cation.ŽŸ ªg��‘E�±268Ž‘Sª®Ê/rrs–¹–{“getrepl“dup“2“add“-1“roll“restore“setrepl“}“Bަ����‘,`DictŽŽŽ‘I²This–L�dictionary“is“added“to“the“stac�¸ãk“just“b�Gefore“the“ gure,‘NQso“that“its“de nitionsŽ¡�‘Iof–UUthe“Òshow“²op�Gerators“can“substitute“for“the“originals.ŽŸ ªg��‘E�±269Ž‘Sª®ÊPSfragDict‘¹–beginޤ ��‘E�±270Ž‘Sª®Êislev2–¹–not“{“/restore“{“/rrs“PSfrag“}“B“}“ifŽ¡��‘E�±271Ž‘Sª®Ê/show‘!{–¹–/rs‘,ÂPSfrag“}“BŽ¡��‘E�±272Ž‘Sª®Ê/kshow‘Y„{–¹–/rks‘ s,PSfrag“}“BŽ¡��‘E�±273Ž‘Sª®Ê/ashow‘Y„{–¹–/ras‘ s,PSfrag“}“BŽ¡��‘E�±274Ž‘Sª®Ê/widthshow– s,{›¹–/rws“PSfrag˜}˜BŽ¡��‘E�±275Ž‘Sª®Ê/awidthshow–¹–{“/raws“PSfrag“}“BŽ¡��‘E�±276Ž‘Sª®Êend–¹–PSfragDict“RO“popŽ¡��‘E�±277Ž‘Sª®ÊendŽŸÿ5��‘E�±278Ž‘Sª®Íh�Ì=Î lep�¾9roŽ‘5GÍiŽŸTÎ��‘E�±279Ž‘Sª®Íh�Îpack�¾9ageŽ‘#g ÍiŽŸ È��‘IÈ3Ž‘aLËThe‘ffscannerŽŸç�‘I²This–o0cošGde“implemen�¸ãts“the“T�‘þU>Ÿ'EŽ‘ãxX-based“scanner“that“p˜erforms“the“w�¸ãork“that“theޤ �‘IÓPSfrag‘¬¾²Pš¸ãerl–‰1script“used“to“p�Gerform.‘ \This“is“v˜ery“similar“to“the“co�Gde“used“to“scanŽ¡�‘Ifor–UUbšGounding“b˜o�¸ãxes“in“Ògraphics.sty².Ž¡�‘XW‘ÿ*ªe–ùZneed“to“read“the“string“with“t•¸ãw“o–ùZsets“of“catco�Gdes:‘¹Òas“`v�¸ãerbatim“text'“forŽ¡�‘Iusing–Û5in“the“ rst“argumen�¸ãt“of“Ò\psfrag²,‘ó¢and“as“normal“T�‘þU>Ÿ'EŽ‘ãxX“commands“for“using“inŽŽŸ�’õÿ10ŽŽŒ‹ sM ª� ýs o� ý´�‘I²the–=°replacemnš¸ãt“text“argumen˜t.‘iåThe“only“w˜a˜y“to“do“this“sensibly“in“standard“T�‘þU>Ÿ'EŽ‘ãxXޤ �‘Iis–ëÈto“write“the“string“to“a“ le“and“then“read“it“bac�¸ãk.‘5 So“while“reading“the“EPSŽ¡�‘I le,‘Ygthe–X–cš¸ãharacter“Ò\“²will“b�Ge“`activ˜e'.‘{‹Then“the“argumen˜t“can“bšGe“duplicated“b˜eforeŽ¡�‘Iwriting–©)this“temp“ le,‘¾once“with“Ò\“²expanding“to“Ò\\“²(t•¸ãw“o–©)catco�Gde“12“tok�¸ãens)“andŽ¡�‘Ionce–ÿ+to“Ò\“²(one“catco�Gde“12“tokš¸ãen).‘oHWhen“this“is“read“bac˜k,‘) these“tok˜ens“will“b�GeŽ¡�‘Ire-catco�Gded–UUb�¸ãy“the“Òpsfrag“²command.Ž©��‘E�±280Ž‘Sª®Ê\newwrite\pfg@tempŽŸ����‘À$\pfg@scanŽŽŽ‘I²The–4Bmain“command.›�Ò#1“²is“the“name“of“the“ le.˜It“migh�¸ãt“bšGe“b˜etter“to“use“theŽ¡�‘Ib•Gounding›‚¹b“o•¸ãx˜(`Ò.bb²')˜ le˜name˜so˜that˜compressed˜ les˜could˜w“ork˜b“y˜y“ou˜cop“y-Ž¡�‘Iing–†„an�¸ãy“lines“with“Ò(\\tex².–ªª.“.“strings–†„in“them“to“the“Òbb“² le“b�Gefore“compressing.Ž¡�‘IHo•¸ãw“ev“er,‘ð…if›×Py“ou˜are˜doing˜that,‘ð…y“ou˜ma“y˜as˜w“ell˜just˜mo“v“e˜the˜Ò\psfrag˜²commandsŽ¡�‘Ito–UUthe“main“T�‘þU>Ÿ'EŽ‘ãxX“ le.‘qÇSo“currenš¸ãtly“compression“is“not“supp�Gorted“b˜y“this“system.ަ��‘E�±281Ž‘Sª®Ê\def\pfg@scan#1{\begingroupŽŸ�‘I²First–UUthe“standard“making“`safe'“of“illegal“c�¸ãharacters.ަ��‘E�±282Ž‘f‘Ê\@tempcnta\z@ޤ ��‘E�±283Ž‘f‘Ê\loopŽ¡��‘E�±284Ž‘f‘Ê\ifnum\@tempcnta<\@xxxiiŽ¡��‘E�±285Ž‘yw^Ê\catcode\@tempcnta12‘¹–\advance\@tempcnta\@neŽ¡��‘E�±286Ž‘f‘Ê\repeatŽŸ�‘X²Noš¸ãw–(hnormalise“some“catco�Gdes“w˜e“need.‘bÍMost“things“are“treated“v˜erbatim,‘1dbutޤ �‘IÒ{}›¥²ha•¸ãv“e˜their˜normal˜catco�Gdes˜so˜Ò\read˜²will˜read˜m“ulti-line˜Ò\\tex˜²expresions;Ž¡�‘Iand,›Ê�as–³discussed“ab�Go•¸ãv“e,˜Ò\–³²is“made“activ�¸ãe.‘‹!The“end“of“a“line“is“treated“as“space.Ž¡�‘IOriginally–Wthis“meanš¸ãt“that“m˜ulti-line“Ò\tex“²commands“did“not“w˜ork,‘‰àbut“with“v3.02,Ž¡�‘Ithe–¹–PS‘¹|side“of“things“normalises“white“space“to“`space',‘Ò¦as“wš¸ãell“so“ev˜ery˜one“is“inŽ¡�‘Iagreemen�¸ãt.ަ��‘E�±287Ž‘f‘Ê\let\do\@makeother\dospecials\catcode`\–¹–10“%ޤ ��‘E�±288Ž‘f‘Ê\catcode`\{=1\catcode`\}=2\catcode127=12‘¹–%Ž¡��‘E�±289Ž‘f‘Ê\catcode`\\=\active\catcode\endlinechar5‘¹–%ŽŸ�‘X²Op�Gen–¹Óthe“scratc�¸ãh“ le.‘ŸBDon't“complain“if“it“already“exists“as“that“is“probablyޤ �‘Ijust– „a“previous“graphic,‘or“a“previous“run.‘Y‚Òpfgguide.tex“²wš¸ãarns“that“an˜y“existingŽ¡�‘I le–UUof“this“name“will“bšGe“zapp˜ed,“so:‘qÇy•¸ãou'v“e–UUb˜een“w�¸ãarned.ަ��‘E�±290Ž‘f‘Ê\immediate\openout\pfg@temp=\jobname.pfg‘¹–%ŽŸ�‘X²If–Ýbthe“graphic“ le“is“not“there,–õ`complain,“else–Ýbstart“reading“it“line“b�¸ãy“line.‘IÌLo�GokŽ¡�‘Iat– Ûeacš¸ãh“line“with“Ò\pfg@find².‘�ZUnlik˜e“the“lo�Goking“for“Ò%%BoundingBox“²where“y˜ouŽ¡�‘Ican–®Çstop“once“y•¸ãou'v“e–®Çfound“it,‘Å$here“y�¸ãou“need“to“go“to“the“end“of“the“ le“lo�GokingŽ¡�‘Ifor–‚fall“the“o�Gccurrences“of“Ò\tex“²so“if“yš¸ãou“giv˜e“it“megab˜ytes“of“data,‘�ªthis“ma˜y“tak˜eŽ¡�‘Ia‘UUwhile.ަ��‘E�±291Ž‘f‘Ê\immediate\openin\@inputcheck=#1‘¹–%ޤ ��‘E�±292Ž‘f‘Ê\ifeof\@inputcheckŽ¡��‘E�±293Ž‘p2Ê\PackageWarning{psfrag}{Could–¹–not“scan“#1...}\endgroupŽ¡��‘E�±294Ž‘f‘Ê\elseŽ¡��‘E�±295Ž‘p2Ê\message{}%Ž¡��‘E�±296Ž‘p2Ê\@tempswatrueŽ¡��‘E�±297Ž‘p2Ê\loopŽ¡��‘E�±298Ž‘yw^Ê\ifeof\@inputcheckŽ¡��‘E�±299Ž’‚êŠÊ\@tempswafalseŽ¡��‘E�±300Ž‘yw^Ê\elseŽ¡��‘E�±301Ž’‚êŠÊ\read\@inputcheck‘¹–to\@tempaŽŽŸ�’õÿ²11ŽŽŒ‹ € ª� ýs o� ý´��‘E�±302Ž’‚êŠÊ\expandafter\pfg@find\@tempa{\@nil}%ޤ ��‘E�±303Ž‘yw^Ê\fiŽ¡��‘E�±304Ž‘p2Ê\if@tempswaŽ¡��‘E�±305Ž‘p2Ê\repeatŽ¡��‘E�±306Ž‘p2Ê\closein\@inputcheckŽ¡��‘E�±307Ž‘f‘Ê\fiŽ¡��‘E�±308Ž‘f‘Ê\immediate\closeout\pfg@tempŽ¡��‘E�±309Ž‘f‘Ê\endgroupŽ¡��‘E�±310Ž‘f‘Ê\@input{\jobname.pfg}}ޤ����‘À$\pfg@findŽŽŽ‘I²This–÷Wcommand“ rst“lo�Goks“for“an“explicit“brace“group“Ò{‘?ý}².‘Rs(one“de nitely“exists“asŽ© �‘IÒ{\@nil}–UU²is“added“at“the“end“as“a“`mark�¸ãer').ŽŸ��‘E�±311Ž‘Sª®Ê\long\def\pfg@find#1#{\pfg@finda{#1}}Ž¡�‘X²T‘ÿ*ªo–äŒenable“an“`activš¸ãe'“cop˜y“or“Ò\“²to“bšGe“accessed“easily‘ÿ*ª,‘Yuse“a“sp˜ecial“lo•¸ãw“ercaseަ�‘Itable–UUwhile“de ning“these“macros.ŽŸ��‘E�±312Ž‘Sª®Ê\begingroupޤ ��‘E�±313Ž‘]ÚÊ\lccode`\~=`\\Ž¡��‘E�±314Ž‘]ÚÊ\lowercase{\endgroupŽŸ����‘Ž\pfg@findaŽŽŽ‘I²If–Žthe“group“found“conš¸ãtained“the“Ò\@nil“²mark˜er“stop,‘else“start“lo�Goking“for“Ò(\\texަ�‘I²in–UUthe“tok�¸ãens“b�Gefore“the“group.ŽŸ��‘E�±315Ž‘Sª®Ê\long\def\pfg@finda#1#2{%Ž¡��‘E�±316Ž‘]ÚÊ\def\@tempa{#2}%Ž¡��‘E�±317Ž‘]ÚÊ\ifx\@tempa\@nnilŽ¡��‘E�±318Ž‘]ÚÊ\elseŽ¡��‘E�±319Ž‘f‘Ê\pfg@findb#1(~~tex(~~tex%Ž¡��‘E�±320Ž‘]ÚÊ\fi}ŽŸ����‘Ž\pfg@findbŽŽŽ‘I²Haš¸ãving–=€found“a“brace“group,‘BDlo�Gok“for“the“string“Ò\\tex“²in“the“preceding“tok˜ens.‘iÕIfަ�‘Ithere–UÓis“sucš¸ãh,‘Uódiscard“an˜y“tok˜ens“b�Gefore“that“then“tak˜e“all“tok˜ens“after“Ò\\tex“²(upަ�‘Ito–ß>the“brace“already“found)“to“b�Ge“the“optional“argumen�¸ãts.‘JjIn“that“case“write“out“aަ�‘Isuitable–ñcall“to“Ò\psfrag²,‘'and“then“con•¸ãtin“ue–ñafter“the“brace“group.‘P_Otherwise“if“noަ�‘IÒ\\tex–* ²is“found,‘2³Add“the“con•¸ãten“ts–* of“the“brace“group“(without“the“braces)“bac�¸ãk“inަ�‘Ifronš¸ãt–^¨of“the“list“b�Gefore“restarting“the“searc˜h.‘�ÀIn“that“w˜a˜y“an˜y“strings“inside“braceަ�‘Igroups–UUwill“b�Ge“found.ަ�‘XAs–®%Ò{}“²ha•¸ãv“e–®%their“normal“catco�Gdes,‘ÄXmš¸ãultiline“Ò\tex“²commands“w˜ork“as“long“asަ�‘Ianš¸ãy–X:line“breaks“o�Gccur“inside“the“main“Ò{‘?ý}“²argumen˜t,‘˜ónot“b�Get˜w˜een“the“optionalަ�‘Iargumenš¸ãts–µ¢(normally“there“is“no“space“at“all“there,‘͵so“no“p�Gossibilit˜y“of“a“break).ަ�‘IThis–_Iis“b�Gecause“T�‘þU>Ÿ'EŽ‘ãxX“will“read“more“than“a“line“if“necessary“to“ensure“that“bracesަ�‘Ibalance.ަ�‘XThe–UUargumenš¸ãts“are“delimited“b˜y“Ò(\\tex“²sequences:ަ�‘IÒ#1–UU²Is“alw•¸ãa“ys–UUdiscarded;“the“tokš¸ãens“b�Gefore“an˜y“Ò(\\tex“²string.ަ�‘IÒ#2–UU²conš¸ãtains“an˜y“optional“argumen˜ts“(complete“with“Ò[]“²brac˜k˜ets).ަ�‘IÒ#3––ó²Will“b�Ge“the“`dummš¸ãy“tok˜ens'“placed“at“the“end,‘½unless“no“Ò(\\tex“²is“in“the“string,ަ�‘Iin–�whicš¸ãh“case“Ò#3“²will“b�Ge“empt˜y‘ÿ*ª.‘ðoThis“argumen˜t“is“Ò\fi“²delimited“whic˜h“allo˜ws“forަ�‘Itail–UUrecursion“in“a“slighš¸ãtly“sneaky“w˜a˜y‘ÿ*ª.ŽŸ��‘E�±321Ž‘Sª®Ê\long\def\pfg@findb#1(~~tex#2(~~tex#3\fi{%Ž¡��‘E�±322Ž‘]ÚÊ\fiŽ¡��‘E�±323Ž‘]ÚÊ\ifx\box#3\boxŽ¡��‘E�±324Ž‘]ÚÊ\elseŽŽŸ�’õÿ²12ŽŽŒ‹ �Ñ ª� ýs o� ý´�‘I²Since– Ò\“²is“the“PS‘ýescap�Ge“cš¸ãharacter“in“strings,‘)æas“w˜ell“as“the“T�‘þU>Ÿ'EŽ‘ãxX“escap�Ge“c˜haracter,ޤ �‘Ithe–<ãfolloš¸ãwing“lo�Goks“a“bit“w˜eird,‘AÇbut“it's“probably“righ˜t.‘i¡A‘<ÝÒ\“²will“app�Gear“in“the“PSŽ¡�‘Istring–UUas“Ò\\²,“so.–ªª.“.Ž¡�‘XFirst–ã%set“Ò\“²to“bšGe“Ò\string“²(recall“Ò\“²is“activ�¸ãe,‘˜and“can“b˜e“written“as“Ò~“²due“toŽ¡�‘Ithe–{Ò\lowercase“²abšGo•¸ãv“e).‘]~This–{means“that“Ò\\foo“²expands“to“Ò\foo“²(one“catco˜de“12Ž¡�‘IÒ\– Ͳcoming“from“Ò\string\“²and“then“a“catco�Gde“11“Òfoo²).‘YšThis“expansion“is“frozen“b�¸ãyŽ¡�‘Ian–HµÒ\edef“²for“use“in“the“second“argumen�¸ãt.‘m’Then“rede ne“Ò\“²to“b�Ge“Ò\relax“²so“it“is“aŽ¡�‘Inon-expandable–UUactivš¸ãe“tok˜en,“whic˜h“writes“as“itself.Ž¡�‘XNoš¸ãw–ÚLwrite“a“call“to“Ò\psfrag“²to“the“temp“ le.‘HÄThe“`user'“string“Ò\foo“²whic˜h“w˜asŽ¡�‘Ithe–UUliteral“PS“Ò\\foo“²th�¸ãus“ends“up“as:Ž¡�‘IÒ\psfrag{².–ªª.“.“Ò\\foo›UU².“.“.“Ò}{˜².“.“.“Ò\foo˜}%Ž¡�‘X²When–é�this“ le“is“read“bacš¸ãk“Ò\psfrag“²will“read“the“ rst“argumen˜t“v˜erbatim,‘ÿandŽ¡�‘Ithe–¤�second“argumen�¸ãt“with“normal“catcošGdes“so“ nally“Ò\foo“²gets“to“b˜e“a“single“tok�¸ãenŽ¡�‘Iinstead–UUof“4,“and“is“executed“as“part“of“the“replacemen�¸ãt“text.Ž¡�‘XFinally–T¯reset“Ò\@tempa“²(whicš¸ãh“con˜tatined“the“con˜ten˜ts“of“the“brace“group“toŽ¡�‘Iemptš¸ãy‘ÿ*ª,–UUas“w˜e'v˜e“done“with“that.Ž©��‘E�±325Ž‘kJœÊ{\let~\stringޤ ��‘E�±326Ž‘yw^Ê\edef\@tempb{\@tempa}%Ž¡��‘E�±327Ž‘p2Ê\let~\relaxŽ¡��‘E�±328Ž‘yw^Ê\immediate\write\pfg@temp{%Ž¡��‘E�±329Ž’‚êŠÊ\string\psfrag\spaceŽ¡��‘E�±330Ž’Œ]¶Ê{\string\\tex#2{\@tempa}}#2\@percentcharŽ¡��‘E�±331Ž’‚êŠÊ^^J\@spaces\@spaces{\@tempb}\@percentchar}}%Ž¡��‘E�±332Ž‘f‘Ê\let\@tempa\@emptyŽ¡��‘E�±333Ž‘]ÚÊ\fiŽŸ�‘X²Noš¸ãw–Ò¨start“lo�Goking“for“the“next“brace“group“to“test.‘éÀFirst“tip“the“con˜ten˜ts“ofޤ �‘IÒ\@tempa–4²in“fronš¸ãt“of“the“tok˜ens“not“y˜et“seen,‘:°so“that“the“con˜ten˜ts“of“a“brace“groupŽ¡�‘Iwill–UUb�Ge“searcš¸ãhed“if“they“w˜ere“not“used“as“the“argumen˜t“to“Ò\tex².ަ��‘E�±334Ž‘]ÚÊ\expandafter\pfg@find\@tempa}ŽŸ�‘X²Finally–UUclose“the“call“to“Ò\lowercase².ަ��‘E�±335Ž‘Sª®Ê}ŽŸ��‘E�±336Ž‘Sª®Íh�Ì=Îpack�¾9ageŽ‘#g ÍiŽŽŸ�’õÿ²13ŽŽŒø™»ƒ’À;説 ó,ßê cmmi10óKñ`y cmr10óÙ“ Rcmr7óú±u cmex10ù¢¹ßßßßß