diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/axodraw |
Initial commit
Diffstat (limited to 'graphics/axodraw')
-rw-r--r-- | graphics/axodraw/README | 22 | ||||
-rw-r--r-- | graphics/axodraw/axodraw.pdf | bin | 0 -> 135892 bytes | |||
-rw-r--r-- | graphics/axodraw/axodraw.sty | 1685 | ||||
-rw-r--r-- | graphics/axodraw/axodraw.tex | 960 |
4 files changed, 2667 insertions, 0 deletions
diff --git a/graphics/axodraw/README b/graphics/axodraw/README new file mode 100644 index 0000000000..f5511d9179 --- /dev/null +++ b/graphics/axodraw/README @@ -0,0 +1,22 @@ + +This is the 'axodraw' system. Currently it is used for drawing +Feynman diagrams in the contents of a LaTeX document. +This system was made by Jos Vermaseren and can be used freely for +non commercial purposes only. +Any commercial use needs the written approval of Jos Vermaseren. +Basically the graphics primitives are written in postscript, but the +user sees only LaTeX commands, and never has to worry about postscript. +This gives a considerable flexibility. +The current version (5-mar-1998) supports color. + +The whole will work together with the dvips system of radical eye software. +With other dvi to postscript converters or with systems that do not +convert properly to postscript working is not garanteed. + +The manual is obtained by the commands +latex axoman +dvips axoman +after which it should be available from the printer. + +Good Luck + Jos Vermaseren diff --git a/graphics/axodraw/axodraw.pdf b/graphics/axodraw/axodraw.pdf Binary files differnew file mode 100644 index 0000000000..3af724b66d --- /dev/null +++ b/graphics/axodraw/axodraw.pdf diff --git a/graphics/axodraw/axodraw.sty b/graphics/axodraw/axodraw.sty new file mode 100644 index 0000000000..6a86f24d0a --- /dev/null +++ b/graphics/axodraw/axodraw.sty @@ -0,0 +1,1685 @@ +% +% Style file for the drawing of Feynman diagrams with LaTeX. +% It assumes that the dvips that is used is by Radical Eye Software +% (by Rokicki), because the graphics primitives are given in +% postscript. If you do not work with a dvi to postscript converter +% you are out of luck. +% +% Made by J.A.M. Vermaseren 14-feb-1994 +% +% Use: +% Enter the picture environment with for instance +% \begin{picture}(width,height)(0,0) +% statements +% \end{picture} +% All statements should be entered inside the picture environment. +% All coordinates should be in terms of pt (but the pt must be omitted). +% One may also use the figure environment. +% +\input{epsf.sty} +\openin5=colordvi.sty +\ifeof5 + \closein5 + \def\axocolor{ } + \def\SetColor#1{ } + \def\Color#1#2{#2} + \def\IfColor#1#2{#2 } +\else + \closein5 + \input{colordvi.sty} + \background{White} + \textBlack + \def\axocolor{Black } + \def\SetColor#1{\def\axocolor{#1 }} + \def\IfColor#1#2{#1} +\fi +% +% The variables in are: +% mtrx,num,ampi,x1,y1,x2,y2,dx,dy,dr,speed +% step,phi,arcend,arcstart,radius +% theindex,thechar,darc,const,amp1 amp2 amp3 +% gcolor,xx,name,name1,name2,xx1,xx2 +% +% NOTE: blank lines are not allowed inside the postscript code!!!!! +% (LaTeX sneaks \par commands in and the postscript goes boink) +% +\special{! /ed{exch def}def /gs{gsave dup scale}def +/gsw{gs /width ed width setlinewidth}def /p1{/y1 ed /x1 ed}def +/p2{/y2 ed /x2 ed}def /abox{newpath x1 y1 moveto x1 y2 lineto +x2 y2 lineto x2 y1 lineto closepath}def } +% +% +\special{! /arrowdown{ + /nwidth { width 1 add } def + newpath + 0 nwidth 1.5 mul neg moveto % Arrow is a triangle + nwidth 1.2 mul nwidth 3 mul rlineto + nwidth 2.4 mul neg 0 rlineto + nwidth 1.2 mul nwidth 3 mul neg rlineto + closepath fill % and it is filled +} def } +% +% +\special{! /arrowup{ + /nwidth { width 1 add } def + newpath + 0 nwidth 1.5 mul moveto % Arrow is a triangle + nwidth 1.2 mul nwidth 3 mul neg rlineto + nwidth 2.4 mul neg 0 rlineto + nwidth 1.2 mul nwidth 3 mul rlineto + closepath fill % and it is filled +} def } +% +% +\special{! /arrowright{ + /nwidth { width 1 add } def + newpath + nwidth 1.5 mul 0 moveto % Arrow is a triangle + nwidth 3 mul neg nwidth 1.2 mul rlineto + 0 nwidth 2.4 mul neg rlineto + nwidth 3 mul nwidth 1.2 mul rlineto + closepath fill % and it is filled +} def } +% +% +\special{! /gluon{ + gsw /num ed /ampi ed /dy ed /dx ed p1 + /dy dy y1 sub def /dx dx x1 sub def +% +% We have a 'head' and a 'tail' and inbetween the 'body' +% The head + tail is 2 windings. The body is num-1 windings. +% + /dr dx dx mul dy dy mul add sqrt def +% + x1 y1 translate dy dx atan rotate +% + /num num 0.5 sub round def + /inc dr num 2 mul 2 add div def % increment per half winding + /amp8 ampi 0.9 mul def + amp8 0 lt {/amp8 amp8 neg def} if +% + /x1 inc 2 mul def +% + newpath + 0 0 moveto + inc 0.1 mul ampi 0.5 mul inc 0.5 mul ampi inc 1.4 mul ampi curveto + x1 amp8 add dup ampi exch ampi neg dup x1 exch curveto +% + 2 1 num { + pop + x1 amp8 sub dup ampi neg exch ampi dup x1 inc add exch curveto + /x1 x1 inc dup add add def + x1 amp8 add dup ampi exch ampi neg dup x1 exch curveto + } for +% + x1 amp8 sub dup ampi neg exch ampi dup x1 inc 0.6 mul add exch curveto + x1 inc 1.5 mul add ampi dr inc 0.1 mul sub ampi 0.5 mul dr 0 curveto + stroke +% + grestore +} def } +% +% +\special{! /photon{ +% +% Draws a photon from x1,y1 to x2,y2 with amplitude A and n wiggles +% + gsw /num ed /ampi ed p2 p1 + /dy y2 y1 sub def /dx x2 x1 sub def + /dr dx dx mul dy dy mul add sqrt def +% + x1 y1 translate + dy dx atan rotate + /num num 2 mul 0.5 sub round def + /x2 dr num div def + /pi 3.141592 def + /sign 1 def + 1 1 num { + pop + newpath + 0 0 moveto + 4 3 div x2 mul pi div dup neg x2 add + 4 3 div ampi sign mul mul dup 3 1 roll + x2 0 curveto + stroke + /sign sign neg def + x2 0 translate + } for +% + grestore +} def } +% +% +\special{! /zigzag{ +% +% Draws a zigzag line from x1,y1 to x2,y2 with amplitude A and n zigzags +% + gsw /num ed /ampi ed p2 p1 + /dy y2 y1 sub def /dx x2 x1 sub def + /dr dx dx mul dy dy mul add sqrt def +% + x1 y1 translate + dy dx atan rotate + /num num 2 mul 0.5 sub round def + /x2 dr num div def + /pi 3.141592 def + /sign 1 def + 1 1 num { + pop + newpath + 0 0 moveto + x2 2 div ampi sign mul lineto + x2 0 lineto + stroke + /sign sign neg def + x2 0 translate + } for +% + grestore +} def } +% +% +\special{! /photonarc{ +% +% Draws a photonarc center at x1,y1, radius arcstart,arcend, amplitude +% number of wiggles, width, scale +% + gsw /num ed /ampli ed /arcend ed /arcstart ed /radius ed +% + translate % The center of the circle is now the origin +% + /num num 2 mul round def % number of half wiggles + arcend arcstart lt { /arcend arcend 360 add def } if + /arcend arcend arcstart sub num div def % phi + arcstart rotate + /arcstart arcend 2 div def % phi/2 + /cp arcend cos def + /sp arcend sin def + /cp2 arcstart cos def + /sp2 arcstart sin def +% + newpath + 1 1 num { + pop + radius 0 moveto + /beta radius arcend mul 180 ampli mul div def + /tt sp cp beta mul sub cp sp beta mul add div def + /amp1 radius ampli add 8 mul beta cp2 mul sp2 sub mul beta 4 cp add mul + tt cp mul 3 mul sp 4 mul sub add radius mul sub + beta tt sub 3 mul div def % this is x2 + radius ampli add 8 mul cp2 mul 1 cp add radius mul sub 3 div amp1 sub + dup radius sub beta mul % x1,y1 + amp1 dup radius cp mul sub tt mul radius sp mul add % x2,y2 + radius cp mul radius sp mul % x3 y3 + curveto + /ampli ampli neg def + arcend rotate + } for + stroke +% + grestore +} def } +% +% +\special{! /gluearc{ +% +% Draws a gluon on an arcsegment +% x_center,y_center,radius,stat_angle,end_angle,gluon_radius,num +% in which num is the number of windings of the gluon. +% Method: +% 1: compute length of arc. +% 2: generate gluon in x and y as if the arc is a straight line +% 3: x' = (radius+y)*cos(x*const) +% y' = (radius+y)*sin(x*const) +% + gsw /num ed /ampi ed /arcend ed /arcstart ed /radius ed +% + translate % move to center of circle + arcstart rotate % segment starts at zero + /darc arcend arcstart sub def % argsegment + /dr darc 180 div 3.141592 mul radius mul def % length of segment. + /const darc dr div def % conversion constant +% + /num num 0.5 sub round def + /inc dr num 2 mul 2 add div def % increment per half winding +% + /amp8 ampi 0.9 mul def + /amp1 radius ampi add def + /amp2 radius ampi sub def + /amp3 radius ampi 2 div add def + /amp4 amp1 inc amp8 add const mul cos div def + /amp5 amp2 amp8 const mul cos div def + /amp6 amp1 inc 0.6 mul amp8 add const mul cos div def + /amp7 amp1 inc 0.9 mul const mul cos div def + amp8 0 lt {/amp8 amp8 neg def} if +% + /x1 inc 2 mul def +% + newpath + radius 0 moveto +% + inc 0.1 mul const mul dup cos amp3 mul exch sin amp3 mul + inc 0.5 mul const mul dup cos amp7 mul exch sin amp7 mul + inc 1.4 mul const mul dup cos amp1 mul exch sin amp1 mul + curveto + x1 amp8 add const mul dup cos amp6 mul exch sin amp6 mul + x1 amp8 add const mul dup cos amp5 mul exch sin amp5 mul + x1 const mul dup cos amp2 mul exch sin amp2 mul + curveto +% + 2 1 num { + pop + x1 amp8 sub const mul dup cos amp5 mul exch sin amp5 mul + x1 amp8 sub const mul dup cos amp4 mul exch sin amp4 mul + x1 inc add const mul dup cos amp1 mul exch sin amp1 mul + curveto + /x1 x1 inc dup add add def + x1 amp8 add const mul dup cos amp4 mul exch sin amp4 mul + x1 amp8 add const mul dup cos amp5 mul exch sin amp5 mul + x1 const mul dup cos amp2 mul exch sin amp2 mul + curveto + } for +% + x1 amp8 sub const mul dup cos amp5 mul exch sin amp5 mul + x1 amp8 sub const mul dup cos amp6 mul exch sin amp6 mul + x1 inc 0.6 mul add const mul dup cos amp1 mul exch sin amp1 mul + curveto + x1 inc 1.5 mul add const mul dup cos amp7 mul exch sin amp7 mul + dr inc 0.1 mul sub const mul dup cos amp3 mul exch sin amp3 mul + dr const mul dup cos radius mul exch sin radius mul + curveto + stroke +% + grestore +} def } +% +% +\special{! /arrowarc{ +% +% Draws an anticlockwise arc with an arrow in the middle +% The arc is x_center, y_center, radius, start_angle, end_angle +% + gsw /arcend ed /arcstart ed /radius ed +% + translate % x and y are still on stack + newpath 0 0 radius arcstart arcend arc stroke + arcstart arcend gt { + /arcend arcend 360 add def } if + arcstart arcend add 2 div rotate % middle of arc + radius 0 translate % move to it + arrowup + grestore +} def } +% +% +\special{! /longarrowarc{ +% +% Draws an anticlockwise arc with an arrow at the end +% The arc is x_center, y_center, radius, start_angle, end_angle +% + gsw /arcend ed /arcstart ed /radius ed +% + translate % x and y are still on stack + arcstart arcend gt { + /arcend arcend 360 add def } if + /arcmid 540 width 1 add mul 3.14159 div radius div def + % discount for arrow + newpath 0 0 radius arcstart arcend arcmid sub arc stroke + arcend arcmid 2 div sub rotate % middle of arrow + radius 0 translate % move to it + arrowup + grestore +} def } +% +% +\special{! /dasharrowarc{ +% +% Draws a dashed anticlockwise arc with an arrow in the middle +% The arc is x_center, y_center, radius, start_angle, end_angle dsize +% + gsw /dsize ed /arcend1 ed /arcstart1 ed /radius ed +% + translate % x and y are still on stack +% + arcend1 arcstart1 lt { /arcend1 arcend1 360 add def } if + /arcmid1 arcend1 arcstart1 add 2 div def +% + 0 0 radius arcstart1 arcmid1 dsize width 1 dashcarc + 0 0 radius arcmid1 arcend1 dsize width 1 dashcarc + arcmid1 rotate + radius 0 translate + arrowup + grestore +} def } +% +% +\special{! /arrowarcn{ +% +% Draws a clockwise arc with an arrow in the middle +% The arc is x_center, y_center, radius, start_angle, end_angle +% + gsw /arcend ed /arcstart ed /radius ed +% + translate % x and y are still on stack + newpath 0 0 radius arcstart arcend arcn stroke + arcstart arcend lt { + /arcstart arcstart 360 add def } if + arcstart arcend add 2 div rotate % middle of arc + radius 0 translate % move to it + arrowdown + grestore +} def } +% +% +\special{! /longarrowarcn{ +% +% Draws a clockwise arc with an arrow in the end +% The arc is x_center, y_center, radius, start_angle, end_angle +% + gsw /arcend ed /arcstart ed /radius ed +% + translate % x and y are still on stack + arcstart arcend lt { + /arcstart arcstart 360 add def } if + /arcmid 540 width 1 add mul 3.14159 div radius div def + % correction for arrow + newpath 0 0 radius arcstart arcend arcmid add arcn stroke + arcend arcmid 2 div add rotate % middle of arrow + radius 0 translate % move to it + arrowdown + grestore +} def } +% +% +\special{! /dasharrowarcn{ +% +% Draws a dashed clockwise arc with an arrow in the middle +% The arc is x_center, y_center, radius, start_angle, end_angle +% + gsw /dsize ed /arcend1 ed /arcstart1 ed /radius ed +% + translate % x and y are still on stack + arcstart1 arcend1 lt { + /arcstart1 arcstart1 360 add def } if + /arcmid1 arcstart1 arcend1 add 2 div def + 0 0 radius arcmid1 arcstart1 dsize width 1 dashcarc + 0 0 radius arcend1 arcmid1 dsize width 1 dashcarc + arcmid1 rotate + radius 0 translate + arrowdown + grestore +} def } +% +% +\special{! /arrowline{ +% +% Draws a straight line with an arrow in the middle +% x1,y1,x2,y2 +% + gsw p2 p1 + /dx x2 x1 sub def /dy y2 y1 sub def + /dr dx dx mul dy dy mul add sqrt def +% + x1 y1 translate + newpath + 0 0 moveto + dx dy rlineto + stroke + dy dx atan rotate + dr 2.0 div 0 translate + arrowright + grestore +} def } +% +% +\special{! /longarrow{ +% +% Draws a straight line with an arrow at the end +% x1,y1,x2,y2 +% + gsw p2 p1 + /dx x2 x1 sub def /dy y2 y1 sub def + /dr dx dx mul dy dy mul add sqrt def +% + x1 y1 translate + dy dx atan rotate + newpath + 0 0 moveto + dr width 3 mul sub 0 rlineto + stroke + dr width 1.5 mul sub 0 translate + arrowright + grestore +} def } +% +% +\special{! /dasharrowline{ +% +% Draws a straight dashed line with an arrow in the middle +% x1,y1,x2,y2 +% +% The pattern is ideally [dsize dsize] 0 setdash +% but we want to have (2*n+1)/2 patterns, so dsize must be rounded +% Actually we want the center to be black too so that the arrow +% fits in nice. This means that n must be odd. So +% r = dsize*(4*m+3) +% + gsw /dsize ed p2 p1 + /dx x2 x1 sub def /dy y2 y1 sub def + /dr dx dx mul dy dy mul add sqrt 2 div def +% + x1 y1 translate + dy dx atan rotate +% + 0 0 dr 0 dsize width 1 dashline + dr 0 translate + 0 0 dr 0 dsize width 1 dashline + arrowright + grestore +} def } +% +% +\special{! /line{ +% +% Draws a straight line: x1,y1,x2,y2 +% + gsw p2 p1 +% + newpath + x1 y1 moveto + x2 y2 lineto + stroke + grestore +} def } +% +% +\special{! /dashline{ +% +% Draws a straight dashed line: x1,y1,x2,y2,dsize +% +% The pattern is ideally [dsize dsize] 0 setdash +% but we want to have (2*n+1)/2 patterns, so dsize must be rounded +% + gsw /dsize ed p2 p1 + /r y2 y1 sub dup mul x2 x1 sub dup mul add sqrt def + /dsize r dsize 2 mul div 0.5 sub round dup 0 le { pop 0 } if 2 mul 1 add + r exch div def + [dsize dsize] 0 setdash +% + newpath + x1 y1 moveto + x2 y2 lineto + stroke + grestore +} def } +% +% +\special{! /carc{ +% +% Draws an anti-clockwise arc segment: +% x_center, y_center, radius, start_angle, end_angle +% + gsw /arcend ed /arcstart ed /radius ed +% + translate % x and y are still on stack + newpath 0 0 radius arcstart arcend arc stroke + grestore +} def } +% +% +\special{! /dashcarc{ +% +% Draws an anti-clockwise arc segment: +% x_center, y_center, radius, start_angle, end_angle, dsize +% + gsw /dsize ed /arcend ed /arcstart ed /radius ed +% + translate % x and y are still on stack +% +% Compute the length of the line +% + /dr arcend arcstart sub dup 0 lt { 360 add } if + 3.14159 mul 180 div radius mul def + /dsize dr dsize 2 mul div 0.5 sub round dup 0 le { pop 0 } if 2 mul 1 add + dr exch div def + [dsize dsize] 0 setdash +% + newpath 0 0 radius arcstart arcend arc stroke + grestore +} def } +% +% +\special{! /vertex{ +% +% Puts a fat dot at x,y size is the radius of the dot +% + gs + /dotsize ed + translate + newpath + 0 0 dotsize 0 360 arc + fill stroke + grestore +} def } +% +% +\special{! /bcirc{ +% +% Draws an anti-clockwise blanked circle: +% x_center, y_center, radius +% + gsw /radius ed +% + translate % x and y are still on stack +% + gsave + 1 setgray + newpath 0 0 radius 0 360 arc fill + grestore + newpath 0 0 radius 0 360 arc stroke + grestore +} def } +% +% +\special{! /gcirc{ +% +% Draws an anti-clockwise blanked gray circle: +% x_center, y_center, radius, grayscale +% + gsw /gcolor ed /radius ed +% + translate % x and y are still on stack +% + 1 setgray + newpath 0 0 radius 0 360 arc fill + gcolor setgray + newpath 0 0 radius 0 360 arc fill + 0 setgray + newpath 0 0 radius 0 360 arc stroke + grestore +} def } +% +% +\special{! /ccirc1{ +% +% Draws an anti-clockwise circle : +% x_center, y_center, radius +% Part 1: the contents in background color +% + gsw /radius ed +% + translate % x and y are still on stack +% + newpath 0 0 radius 0 360 arc fill + grestore +} def } +% +% +\special{! /ccirc2{ +% +% Draws an anti-clockwise circle : +% x_center, y_center, radius +% Part 1: the contents in background color +% + gsw /radius ed +% + translate % x and y are still on stack +% + newpath 0 0 radius 0 360 arc stroke + grestore +} def } +% +% +\special{! /box{ +% +% Draws a box x1,y1,x2,y2 +% + gsw p2 p1 + abox stroke + grestore +} def } +% +% +\special{! /bbox{ +% +% Draws a blanked out box x1,y1,x2,y2 +% + gsw p2 p1 + gsave + 1 setgray abox fill + grestore + abox stroke + grestore +} def } +% +% +\special{! /gbox{ +% +% Draws a blanked out gray box x1,y1,x2,y2,color +% + gsw /gcolor ed p2 p1 + 1 setgray abox fill + gcolor setgray abox fill + 0 setgray abox stroke + grestore +} def } +% +% +\special{! /cbox1{ +% +% Draws a blanked out colored box x1,y1,x2,y2 +% Part 1: the background +% + gsw p2 p1 + abox fill + grestore +} def } +% +% +\special{! /cbox2{ +% +% Draws a blanked out colored box x1,y1,x2,y2 +% Part 1: the box +% + gsw p2 p1 + abox stroke + grestore +} def } +% +% +\special{! /btext{ +% +% Makes a box that has the text centered in it +% The center of the box is at x,y and the box is just large enough +% for the text. +% x,y,text,fontsize,linewidth,scale +% + gsw /fsize ed /thetext ed translate + /hsize thetext stringwidth pop def + /x1 hsize fsize add 2 div neg def + /y1 fsize 2 mul 3 div neg def + /x2 x1 neg def /y2 y1 neg def + gsave 1 setgray abox fill grestore + abox stroke + hsize 2 div neg fsize 3 div neg moveto thetext show + grestore +} def } +% +% +\special{! /b2text{ +% +% Makes a box that has two lines of text centered in it +% The center of the box is at x,y and the box is just large enough +% for the text. +% x,y,text1,text2,fontsize,linewidth,scale +% + gsw /fsize ed /text2 ed /text1 ed translate + /hsize1 text1 stringwidth pop def + /hsize2 text2 stringwidth pop def + hsize1 hsize2 lt { /hsize hsize2 def } { /hsize hsize1 def } ifelse + /x1 hsize fsize add 2 div neg def + /y1 fsize neg 7 mul 6 div def + /x2 x1 neg def /y2 y1 neg def + gsave 1 setgray abox fill grestore + abox stroke + hsize1 2 div neg fsize 6 div moveto text1 show + hsize2 2 div neg fsize 5 mul 6 div neg moveto text2 show + grestore +} def } +% +% +\special{! /gtext{ +% +% Makes a gray box that has the text centered in it +% The center of the box is at x,y and the box is just large enough +% for the text. +% x,y,gray,text,fontsize,linewidth,scale +% + gsw /fsize ed /thetext ed /graysc ed translate + /hsize thetext stringwidth pop def + /x1 hsize fsize add 2 div neg def + /y1 fsize 2 mul 3 div neg def + /x2 x1 neg def /y2 y1 neg def + graysc setgray abox fill 0 setgray abox stroke + hsize 2 div neg fsize 3 div neg moveto thetext show + grestore +} def } +% +% +\special{! /ctext1{ +% +% Makes a colored box that has the text centered in it +% The center of the box is at x,y and the box is just large enough +% for the text. +% x,y,text,fontsize,linewidth,scale +% Part 1: the background +% + gsw /fsize ed /thetext ed translate + /hsize thetext stringwidth pop def + /x1 hsize fsize add 2 div neg def + /y1 fsize 2 mul 3 div neg def + /x2 x1 neg def /y2 y1 neg def + abox fill + grestore +} def } +% +% +\special{! /ctext2{ +% +% Makes a colored box that has the text centered in it +% The center of the box is at x,y and the box is just large enough +% for the text. +% x,y,text,fontsize,linewidth,scale +% Part 2: the box and the text +% + gsw /fsize ed /thetext ed translate + /hsize thetext stringwidth pop def + /x1 hsize fsize add 2 div neg def + /y1 fsize 2 mul 3 div neg def + /x2 x1 neg def /y2 y1 neg def + abox stroke + hsize 2 div neg fsize 3 div neg moveto thetext show + grestore +} def } +% +% +\special{! /g2text{ +% +% Makes a gray box that has two lines of text centered in it +% The center of the box is at x,y and the box is just large enough +% for the text. +% x,y,gray,text1,text2,fontsize,linewidth,scale +% + gsw /fsize ed /text2 ed /text1 ed /graysc ed translate + /hsize1 text1 stringwidth pop def + /hsize2 text2 stringwidth pop def + hsize1 hsize2 lt { /hsize hsize2 def } { /hsize hsize1 def } ifelse + /x1 hsize fsize add 2 div neg def + /y1 fsize neg 7 mul 6 div def + /x2 x1 neg def /y2 y1 neg def + graysc setgray abox fill 0 setgray abox stroke + hsize1 2 div neg fsize 6 div moveto text1 show + hsize2 2 div neg fsize 5 mul 6 div neg moveto text2 show + grestore +} def } +% +% +\special{! /c2text1{ +% +% Makes a colored box that has two lines of text centered in it +% The center of the box is at x,y and the box is just large enough +% for the text. +% x,y,text1,text2,fontsize,linewidth,scale +% Part 1: the background +% + gsw /fsize ed /text2 ed /text1 ed translate + /hsize1 text1 stringwidth pop def + /hsize2 text2 stringwidth pop def + hsize1 hsize2 lt { /hsize hsize2 def } { /hsize hsize1 def } ifelse + /x1 hsize fsize add 2 div neg def + /y1 fsize neg 7 mul 6 div def + /x2 x1 neg def /y2 y1 neg def + abox fill + grestore +} def } +% +% +\special{! /c2text2{ +% +% Makes a colored box that has two lines of text centered in it +% The center of the box is at x,y and the box is just large enough +% for the text. +% x,y,text1,text2,fontsize,linewidth,scale +% Part 2, box and text +% + gsw /fsize ed /text2 ed /text1 ed translate + /hsize1 text1 stringwidth pop def + /hsize2 text2 stringwidth pop def + hsize1 hsize2 lt { /hsize hsize2 def } { /hsize hsize1 def } ifelse + /x1 hsize fsize add 2 div neg def + /y1 fsize neg 7 mul 6 div def + /x2 x1 neg def /y2 y1 neg def + abox stroke + hsize1 2 div neg fsize 6 div moveto text1 show + hsize2 2 div neg fsize 5 mul 6 div neg moveto text2 show + grestore +} def } +% +% +\special{! /ptext{ +% +% Puts a text at x,y (focal point) +% phi is a rotation angle +% Mode tells how the text should be w.r.t. the focal point. +% fsize is the fontsize +% Then the text is given. +% Finally the scale factor should be there +% + gs + /text ed + /fsize ed + /mode ed + 3 1 roll + translate rotate % We are at the focus and have the proper orientation + mode 3 lt { 0 fsize neg translate } { + mode 6 lt { /mode mode 3 sub def 0 fsize 2 div neg translate } + { /mode mode 6 sub def } ifelse } ifelse + /fsize text stringwidth pop def + mode 1 eq { fsize 2 div neg 0 translate } { + mode 2 eq { fsize neg 0 translate } if } ifelse + 0 0 moveto + text show + grestore +} def } +% +% +\special{! /goval{ +% +% Draws a colored oval that overwrites whatever was there. +% x_center y_center height width rotation color linewidth scale +% + gsw /gcolor ed /x1 ed /x2 ed /radius ed +% + translate % x and y are still on stack + x1 rotate + x2 radius div 1.0 scale + 1 setgray newpath 0 0 radius 0 360 arc fill + gcolor setgray newpath 0 0 radius 0 360 arc fill + 0 setgray newpath 0 0 radius 0 360 arc stroke + grestore +} def } +% +% +\special{! /coval1{ +% +% Draws a oval that overwrites whatever was there. +% x_center y_center height width rotation linewidth scale +% + gsw /x1 ed /x2 ed /radius ed +% + translate % x and y are still on stack + x1 rotate + x2 radius div 1.0 scale + newpath 0 0 radius 0 360 arc fill + grestore +} def } +% +% +\special{! /coval2{ +% +% Draws a oval that overwrites whatever was there. +% x_center y_center height width rotation linewidth scale +% + gsw /x1 ed /x2 ed /radius ed +% + translate % x and y are still on stack + x1 rotate + x2 radius div 1.0 scale + newpath 0 0 radius 0 360 arc stroke + grestore +} def } +% +% +\special{! /oval{ +% +% Draws an oval that does not overwrite whatever was there. +% x_center y_center height width rotation linewidth scale +% + gsw /x1 ed /x2 ed /radius ed +% + translate % x and y are still on stack + x1 rotate + x2 radius div 1.0 scale +% + newpath 0 0 radius 0 360 arc stroke + grestore +} def } +% +% +\special{! /docurve{ + x1 2 mul x2 add 3 div + y1 y0 sub x1 x0 sub div x2 x0 sub mul + y2 y0 sub x2 x0 sub div x1 x0 sub mul add + y1 add y0 2 mul add 3 div + x1 x2 2 mul add 3 div + y2 y3 sub x2 x3 sub div x1 x3 sub mul + y1 y3 sub x1 x3 sub div x2 x3 sub mul add + y2 add y3 2 mul add 3 div + x2 y2 curveto +} def } +% +\special{! /makecurve{ +% +% Incoming stack: +% [array of x,y pairs] width scale +% + gsw /points ed + /ss points length 2 idiv 2 mul def + newpath + ss 4 gt { + /x1 points 0 get def + /y1 points 1 get def + /x2 points 2 get def + /y2 points 3 get def + /x3 points 4 get def + /y3 points 5 get def + /x0 x1 2 mul x2 sub def + /y0 y3 y2 sub x3 x2 sub div y2 y1 sub x2 x1 sub div sub 2 mul + x2 x1 sub dup mul x3 x1 sub div mul + y1 2 mul add y2 sub def + x1 y1 moveto + docurve + 0 2 ss 8 sub { /ii ed + /x0 points ii get def + /y0 points ii 1 add get def + /x1 points ii 2 add get def + /y1 points ii 3 add get def + /x2 points ii 4 add get def + /y2 points ii 5 add get def + /x3 points ii 6 add get def + /y3 points ii 7 add get def + docurve + } for + /x0 points ss 6 sub get def + /y0 points ss 5 sub get def + /x1 points ss 4 sub get def + /y1 points ss 3 sub get def + /x2 points ss 2 sub get def + /y2 points ss 1 sub get def + /x3 x2 2 mul x1 sub def + /y3 y2 y1 sub x2 x1 sub div y1 y0 sub x1 x0 sub div sub 2 mul + x2 x1 sub dup mul x2 x0 sub div mul + y2 2 mul add y1 sub def + docurve + } { + ss 4 eq { + points 0 get points 1 get moveto + points 2 get points 3 get lineto + } if + } ifelse + stroke + grestore +} def } +% +% +\special{! /makedashcurve{ +% +% Incoming stack: +% [array of x,y pairs] dashsize width scale +% + gsw /dsize ed /points ed + /ss points length 2 idiv 2 mul def + newpath + ss 4 gt { + /x1 points 0 get def + /y1 points 1 get def + /x2 points 2 get def + /y2 points 3 get def + /x3 points 4 get def + /y3 points 5 get def + /x0 x1 2 mul x2 sub def + /y0 y3 y2 sub x3 x2 sub div y2 y1 sub x2 x1 sub div sub 2 mul + x2 x1 sub dup mul x3 x1 sub div mul + y1 2 mul add y2 sub def + x1 y1 moveto + docurve + 0 2 ss 8 sub { /ii ed + /x0 points ii get def + /y0 points ii 1 add get def + /x1 points ii 2 add get def + /y1 points ii 3 add get def + /x2 points ii 4 add get def + /y2 points ii 5 add get def + /x3 points ii 6 add get def + /y3 points ii 7 add get def + docurve + } for + /x0 points ss 6 sub get def + /y0 points ss 5 sub get def + /x1 points ss 4 sub get def + /y1 points ss 3 sub get def + /x2 points ss 2 sub get def + /y2 points ss 1 sub get def + /x3 x2 2 mul x1 sub def + /y3 y2 y1 sub x2 x1 sub div y1 y0 sub x1 x0 sub div sub 2 mul + x2 x1 sub dup mul x2 x0 sub div mul + y2 2 mul add y1 sub def + docurve + } { + ss 4 eq { + points 0 get points 1 get moveto + points 2 get points 3 get lineto + } if + } ifelse + centerdash + stroke + grestore +} def } +% +\special{! /pathlength{ + flattenpath + /dist 0 def + { /yfirst ed /xfirst ed /ymoveto yfirst def /xmoveto xfirst def } + { /ynext ed /xnext ed /dist dist ynext yfirst sub dup mul + xnext xfirst sub dup mul add sqrt add def + /yfirst ynext def /xfirst xnext def } + {} + {/ynext ymoveto def /xnext xmoveto def + /dist ynext yfirst sub dup mul + xnext xfirst sub dup mul add sqrt add def + /yfirst ynext def /xfirst xnext def } + pathforall + dist +} def } +% +\special{! /centerdash{ + /pathlen pathlength def + /jj pathlen dsize div 2.0 div cvi def + /ddsize pathlen jj 2.0 mul div def + [ddsize] ddsize 2 div setdash +} def } +% +% +\special{! /logaxis{ +% +% Draws an axis from x1,y1 to x2,y2 with nl log divisions +% size of the hashes hs, offset F +% and width W. The stack looks like +% x1,y1,x2,y2,nl,hs,F,W,scale +% After the rotation the hash marks are on top if nl is positive and +% on the bottom if nl is negative +% + gsw /offset ed /hashsize ed /nlogs ed p2 p1 + x1 y1 translate + /y2 y2 y1 sub def /x2 x2 x1 sub def + y2 x2 atan rotate + /rr x2 dup mul y2 dup mul add sqrt def + offset 0 ne { /offset offset ln 10 ln div def } if + /offset offset dup cvi sub def + newpath + 0 0 moveto + rr 0 lineto + /lsize rr nlogs div def + 0 1 nlogs { /x2 ed + x2 offset ge { + /y2 x2 offset sub lsize mul def + y2 rr le { + y2 0 moveto + y2 hashsize 1.2 mul lineto + } if + } if + } for + stroke + width 0.6 mul setlinewidth + newpath + 0 1 nlogs { /x2 ed + 2 1 9 { + ln 10 ln div x2 add + /xx2 ed + xx2 offset ge { + /y2 xx2 offset sub lsize mul def + y2 rr le { + y2 0 moveto + y2 hashsize 0.8 mul lineto + } if + } if + } for + } for + stroke + grestore +} def } +% +% +\special{! /linaxis{ +% +% x1,y1,x2,y2,num_decs,per_dec,hashsize,offset,width,scale +% + gsw /offset ed /hashsize ed /perdec ed /numdec ed p2 p1 + x1 y1 translate + /y2 y2 y1 sub def /x2 x2 x1 sub def + y2 x2 atan rotate + /rr x2 dup mul y2 dup mul add sqrt def + newpath + 0 0 moveto + rr 0 lineto + /x1 rr numdec perdec mul div def + /y1 rr numdec div def + /offset offset x1 mul def + 0 1 numdec { y1 mul offset sub + dup 0 ge { + dup rr le { + dup 0 moveto + hashsize 1.2 mul lineto + } if + } if + } for + stroke + width 0.6 mul setlinewidth + newpath + offset cvi 1 numdec perdec mul offset add { + x1 mul offset sub + dup 0 ge { + dup rr le { + dup 0 moveto + hashsize 0.8 mul lineto + } if + } if + } for + stroke + grestore +} def } +% +\def\axowidth{0.5 } +\def\axoscale{1.0 } +\def\axoxoff{0 } +\def\axoyoff{0 } +\def\axoxo{0 } +\def\axoyo{0 } +\def\firstcall{1} +% +\def\Gluon(#1,#2)(#3,#4)#5#6{ +% +% Draws a gluon from (x1,y1) to (x2,y2) with amplitude and number of windings +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + \axoxo add #4 \axoyo add #5 #6 \axowidth \axoscale gluon showpage}} +} +% +\def\Photon(#1,#2)(#3,#4)#5#6{ +% +% Draws a photon from (x1,y1) to (x2,y2) with amplitude and number of windings +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + \axoxo add #4 \axoyo add #5 #6 \axowidth \axoscale photon showpage}} +} +% +\def\ZigZag(#1,#2)(#3,#4)#5#6{ +% +% Draws a zigzag from (x1,y1) to (x2,y2) with amplitude and number of zigzags +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + \axoxo add #4 \axoyo add #5 #6 \axowidth \axoscale zigzag showpage}} +} +% +\def\PhotonArc(#1,#2)(#3,#4,#5)#6#7{ +% +% Draws a photon on an arc segment. The center of the curve is at (1,2) +% The radius, start angle and target angle are (#3,#4,#5), 6 is the +% amplitude of the gluon, and 7 is the number of wiggles. +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + #4 #5 #6 #7 \axowidth \axoscale photonarc showpage}} +} +% +\def\GlueArc(#1,#2)(#3,#4,#5)#6#7{ +% +% Draws a gluon on aa arc segment. The center of the curve is at (1,2) +% The radius, start angle and target angle are (#3,#4,#5), 6 is the +% amplitude of the gluon, and 7 is the number of windings. +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + #4 #5 #6 #7 \axowidth \axoscale gluearc showpage}} +} +% +\def\ArrowArc(#1,#2)(#3,#4,#5){ +% +% Draws an arc segment with an arrow in it. The center of the curve +% is at (1,2). +% The radius, start angle and target angle are (#3,#4,#5). +% The arc segment runs anticlockwise +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + #4 #5 \axowidth \axoscale arrowarc showpage}} +} +% +\def\LongArrowArc(#1,#2)(#3,#4,#5){ +% +% Draws an arc segment with an arrow at its end. The center of the curve +% is at (1,2). +% The radius, start angle and target angle are (#3,#4,#5). +% The arc segment runs anticlockwise +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + #4 #5 \axowidth \axoscale longarrowarc showpage}} +} +% +\def\DashArrowArc(#1,#2)(#3,#4,#5)#6{ +% +% Draws a dashed arc segment with an arrow in it. The center of the curve +% is at (1,2). +% The radius, start angle and target angle are (#3,#4,#5). +% The arc segment runs anticlockwise +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + #4 #5 #6 \axowidth \axoscale dasharrowarc showpage}} +} +% +\def\ArrowArcn(#1,#2)(#3,#4,#5){ +% +% Draws an arc segment with an arrow in it. The center of the curve +% is at (1,2). +% The radius, start angle and target angle are (#3,#4,#5). +% The arc segment runs clockwise +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + #4 #5 \axowidth \axoscale arrowarcn showpage}} +} +% +\def\LongArrowArcn(#1,#2)(#3,#4,#5){ +% +% Draws an arc segment with an arrow at the end. The center of the curve +% is at (1,2). +% The radius, start angle and target angle are (#3,#4,#5). +% The arc segment runs clockwise +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + #4 #5 \axowidth \axoscale longarrowarcn showpage}} +} +% +\def\DashArrowArcn(#1,#2)(#3,#4,#5)#6{ +% +% Draws a dashed arc segment with an arrow in it. The center of the curve +% is at (1,2). +% The radius, start angle and target angle are (#3,#4,#5). +% The arc segment runs clockwise +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + #4 #5 #6 \axowidth \axoscale dasharrowarcn showpage}} +} +% +\def\ArrowLine(#1,#2)(#3,#4){ +% +% Draws a line with an arrow in it from (x1,y1) to (x2,y2) +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + \axoxo add #4 \axoyo add \axowidth \axoscale arrowline showpage}} +} +% +\def\LongArrow(#1,#2)(#3,#4){ +% +% Draws a line with an arrow at the end from (x1,y1) to (x2,y2) +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + \axoxo add #4 \axoyo add \axowidth \axoscale longarrow showpage}} +} +% +\def\DashArrowLine(#1,#2)(#3,#4)#5{ +% +% Draws a dashed line with an arrow in it from (x1,y1) to (x2,y2) +% The size of the dashes is given by the fifth argument. +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + \axoxo add #4 \axoyo add #5 \axowidth \axoscale dasharrowline showpage}} +} +% +\def\Line(#1,#2)(#3,#4){ +% +% Draws a line from (x1,y1) to (x2,y2) +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + \axoxo add #4 \axoyo add \axowidth \axoscale line showpage}} +} +% +\def\DashLine(#1,#2)(#3,#4)#5{ +% +% Draws a line from (x1,y1) to (x2,y2) with a dash pattern of which the +% alternating black and white pieces are approximately {5} points long +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + \axoxo add #4 \axoyo add #5 \axowidth \axoscale dashline showpage}} +} +% +\def\CArc(#1,#2)(#3,#4,#5){ +% +% Draws an arc segment. The center of the curve +% is at (1,2). +% The radius, start angle and target angle are (#3,#4,#5). +% The arc segment runs anticlockwise +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + #4 #5 \axowidth \axoscale carc showpage}} +} +% +\def\DashCArc(#1,#2)(#3,#4,#5)#6{ +% +% Draws a dashed arc segment. The center of the curve +% is at (1,2). +% The radius, start angle and target angle are (#3,#4,#5). +% The arc segment runs anticlockwise +% dsize (6) is the dashsize. this is rounded to make things come +% out right. +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + #4 #5 #6 \axowidth \axoscale dashcarc showpage}} +} +% +\def\Vertex(#1,#2)#3{ +% +% Draws a fat dot at (1,2). The radius of the dot is given by 3. +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + \axoscale vertex showpage}} +} +% +\def\Text(#1,#2)[#3]#4{ +% +% Draws text at (1,2). Argument 3 is l,r or c indicating whether +% the text is left adjusted, right adjusted or centered. +% 4 is of course the text. +% +\dimen0=\axoxoff \unitlength +\dimen1=\axoyoff \unitlength +\advance\dimen0 by #1 \unitlength +\advance\dimen1 by #2 \unitlength +\makeatletter +\@killglue\raise\dimen1\hbox to\z@{\kern\dimen0 \makebox(0,0)[#3]{#4}\hss} +\ignorespaces +\makeatother +} +% +\def\BCirc(#1,#2)#3{ +% +% Draws a circle at (1,2) and radius 3 that is blanked out. +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + \axowidth \axoscale bcirc showpage}} +} +% +\def\GCirc(#1,#2)#3#4{ +% +% Draws a circle at (1,2) and radius 3 that is blanked out. +% Then it fills the circle with a gray scale 4 (0 = black, 1 is white) +% +\put(\axoxoff,\axoyoff){\special{"#1 \axoxo add #2 \axoyo add #3 + #4 \axowidth \axoscale gcirc showpage}} +} +% +\def\CCirc(#1,#2)#3#4#5{ +% +% Draws a circle at (1,2) and radius 3 that is blanked out. +% #4 is the color of the circle, #5 the color of the contents +% +\put(\axoxoff,\axoyoff){\special{"#5 #1 \axoxo add #2 \axoyo add #3 + \axowidth \axoscale ccirc1 showpage}} +\put(\axoxoff,\axoyoff){\special{"#4 #1 \axoxo add #2 \axoyo add #3 + \axowidth \axoscale ccirc2 showpage}} +} +% +\def\EBox(#1,#2)(#3,#4){ +% +% Draws a box with the left bottom at (x1,y1) and the right top +% at (x2,y2). +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + \axoxo add #4 \axoyo add \axowidth \axoscale box showpage}} +} +% +\def\BBox(#1,#2)(#3,#4){ +% +% Draws a box with the left bottom at (x1,y1) and the right top +% at (x2,y2). The box is blanked out. +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + \axoxo add #4 \axoyo add \axowidth \axoscale bbox showpage}} +} +% +\def\GBox(#1,#2)(#3,#4)#5{ +% +% Draws a box with the left bottom at (x1,y1) and the right top +% at (x2,y2). The box is blanked out and then filled with gray 5 +% (0 is black, 1 is white) +% +\put(\axoxoff,\axoyoff){\special{"#1 \axoxo add #2 \axoyo add #3 + \axoxo add #4 \axoyo add #5 \axowidth \axoscale gbox showpage}} +} +% +\def\CBox(#1,#2)(#3,#4)#5#6{ +% +% Draws a box with the left bottom at (x1,y1) and the right top +% at (x2,y2). The color of the box is #5, the background is #6 +% +\put(\axoxoff,\axoyoff){\special{"#6 #1 \axoxo add #2 \axoyo add #3 + \axoxo add #4 \axoyo add \axowidth \axoscale cbox1 showpage}} +\put(\axoxoff,\axoyoff){\special{"#5 #1 \axoxo add #2 \axoyo add #3 + \axoxo add #4 \axoyo add \axowidth \axoscale cbox2 showpage}} +} +% +\def\Boxc(#1,#2)(#3,#4){ +% +% Draws a box with the center at (x1,y1). +% The width and height are (3,4). +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #3 2 div sub #2 \axoyo add + #4 2 div sub #1 \axoxo add #3 2 div add #2 \axoyo add #4 2 div add + \axowidth \axoscale box showpage}} +} +% +\def\BBoxc(#1,#2)(#3,#4){ +% +% Draws a box with the center at (x1,y1). +% The width and height are (3,4). The contents are blanked out +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #3 2 div sub #2 \axoyo add + #4 2 div sub #1 \axoxo add #3 2 div add #2 \axoyo add #4 2 div add + \axowidth \axoscale bbox showpage}} +} +% +\def\GBoxc(#1,#2)(#3,#4)#5{ +% +% Draws a box with the center at (x1,y1). +% The width and height are (3,4). The contents are blanked out +% Then the contents are filled with gray 5 (0 is black, 1 is white) +% +\put(\axoxoff,\axoyoff){\special{"#1 \axoxo add #3 2 div sub #2 \axoyo add + #4 2 div sub #1 \axoxo add #3 2 div add #2 \axoyo add #4 2 div add + #5 \axowidth \axoscale gbox showpage}} +} +% +\def\CBoxc(#1,#2)(#3,#4)#5#6{ +% +% Draws a box with the center at (x1,y1). +% The width and height are (3,4). The contents are blanked out +% The color of the box is #5, the background is #6 +% +\put(\axoxoff,\axoyoff){\special{"#6 #1 \axoxo add #3 2 div sub #2 \axoyo add + #4 2 div sub #1 \axoxo add #3 2 div add #2 \axoyo add #4 2 div add + \axowidth \axoscale cbox1 showpage}} +\put(\axoxoff,\axoyoff){\special{"#5 #1 \axoxo add #3 2 div sub #2 \axoyo add + #4 2 div sub #1 \axoxo add #3 2 div add #2 \axoyo add #4 2 div add + \axowidth \axoscale cbox2 showpage}} +} +% +\def\SetWidth#1{\def\axowidth{#1 }} +\def\SetScale#1{\def\axoscale{#1 }} +\def\SetOffset(#1,#2){\def\axoxoff{#1 } \def\axoyoff{#2 }} +\def\SetScaledOffset(#1,#2){\def\axoxo{#1 } \def\axoyo{#2 }} +% +\def\pfont{Times-Roman } +\def\fsize{10 } +% +\def\SetPFont#1#2{\def\pfont{#1 } \def\fsize{#2 }} +% +% Now some definitions to sort out the lt etc type of options in PText +% +\makeatletter +\def\fmode{4 } +\def\@l@{l} \def\@r@{r} \def\@t@{t} \def\@b@{b} +\def\mymodetest#1{\ifx#1\end \let\next=\relax \else { +\if#1\@r@\global\def\fmodeh{1 }\fi +\if#1\@l@\global\def\fmodeh{-1 }\fi +\if#1\@b@\global\def\fmodev{3 }\fi +\if#1\@t@\global\def\fmodev{-3 }\fi +} \let\next=\mymodetest\fi \next} +\makeatother +% +\def\PText(#1,#2)(#3)[#4]#5{ +% +% Draws a postscript text in a postscript font. +% Focal point is (1,2), rotation angle is 3, 4 is the mode (as in text) +% and 5 is the text. +% +\def\fmodev{0 } +\def\fmodeh{0 } +\mymodetest#4\end +\put(\axoxoff,\axoyoff){\makebox(0,0)[]{\special{"/\pfont findfont \fsize + scalefont setfont \axocolor #1 \axoxo add #2 \axoyo add #3 +\fmode \fmodev add \fmodeh add \fsize (#5) \axoscale ptext }}} +} +% +\def\GOval(#1,#2)(#3,#4)(#5)#6{ +% +% Draws a colored oval that overwrites whatever was there. +% Oval(x_center,y_center)(height,width)(rotation)(color) +% +\put(\axoxoff,\axoyoff){\special{"#1 \axoxo add #2 \axoyo add #3 #4 #5 #6 +\axowidth \axoscale goval showpage}} +} +% +\def\COval(#1,#2)(#3,#4)(#5)#6#7{ +% +% Draws a colored oval that overwrites whatever was there. +% Oval(x_center,y_center)(height,width)(rotation){color1}{color2} +% +\put(\axoxoff,\axoyoff){\special{"#7 #1 \axoxo add #2 \axoyo add #3 #4 #5 +\axowidth \axoscale coval1 showpage}} +\put(\axoxoff,\axoyoff){\special{"#6 #1 \axoxo add #2 \axoyo add #3 #4 #5 +\axowidth \axoscale coval2 showpage}} +} +% +\def\Oval(#1,#2)(#3,#4)(#5){ +% +% Draws an oval that does not overwrite whatever was there. +% Oval(x_center,y_center)(height,width)(rotation) +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 #4 #5 +\axowidth \axoscale oval showpage}} +} +% +\let\eind=] +\def\DashCurve#1#2{\put(\axoxoff,\axoyoff){\special{"\axocolor [ \kromme#1] #2 +\axowidth \axoscale makedashcurve showpage}}} +\def\Curve#1{\put(\axoxoff,\axoyoff){\special{"\axocolor [ \kromme#1] \axowidth +\axoscale makecurve showpage}}} +\def\kromme(#1,#2)#3{#1 \axoxo add #2 \axoyo add \ifx #3\eind\else +\expandafter\kromme\fi#3} +% +\def\LogAxis(#1,#2)(#3,#4)(#5,#6,#7,#8){ +% +% Draws a line with logarithmic hash marks along it. +% LogAxis(x1,y1)(x2,y2)(num_logs,hashsize,offset,width) +% The line is from (x1,y1) to (x2,y2) and the marks are on the left side +% when hashsize is positive, and right when it is negative. +% num_logs is the number of orders of magnitude and offset is the number +% at which one starts at (x1,y1) (like if offset=2 we start at 2) +% When offset is 0 we start at 1. Width is the linewidth. +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + \axoxo add #4 \axoyo add #5 #6 #7 #8 \axoscale logaxis showpage}} +} +% +\def\LinAxis(#1,#2)(#3,#4)(#5,#6,#7,#8,#9){ +% +% Draws a line with linear hash marks along it. +% LinAxis(x1,y1)(x2,y2)(num_decs,per_dec,hashsize,offset,width) +% The line is from (x1,y1) to (x2,y2) and the marks are on the left side +% when hashsize is positive, and right when it is negative. +% num_decs is the number of accented marks, per_dec the number of +% divisions between them and offset is the number +% at which one starts at (x1,y1) (like if offset=2 we start at the second +% small mark) Width is the linewidth. +% +\put(\axoxoff,\axoyoff){\special{"\axocolor #1 \axoxo add #2 \axoyo add #3 + \axoxo add #4 \axoyo add #5 #6 #7 #8 #9 \axoscale linaxis showpage}} +} +% +\input rotate.tex +\makeatletter +% +\def\rText(#1,#2)[#3][#4]#5{ +% +% Draws rotated text at (1,2). Argument 3 is l,r or c indicating whether +% the text is left adjusted, right adjusted or centered. +% 4 is the rotation angle and 5 is of course the text. +% +\ifnum\firstcall=1\global\def\firstcall{0}\rText(-10000,#2)[#3][]{#5}\fi +\dimen2=\axoxoff \unitlength +\dimen3=\axoyoff \unitlength +\advance\dimen2 by #1 \unitlength +\advance\dimen3 by #2 \unitlength +\@killglue\raise\dimen3\hbox to \z@{\kern\dimen2 +\makebox(0,0)[#3]{ +\ifx#4l{\setbox3=\hbox{#5}\rotl{3}}\else{ +\ifx#4r{\setbox3=\hbox{#5}\rotr{3}}\else{ +\ifx#4u{\setbox3=\hbox{#5}\rotu{3}}\else{#5}\fi}\fi}\fi}\hss} +\ignorespaces +} +\makeatother +% +\def\BText(#1,#2)#3{ +% +% Draws a box with the center at (x1,y1) and postscript text in it. +% +\put(\axoxoff,\axoyoff){\special{"/\pfont findfont \fsize + scalefont setfont \axocolor #1 \axoxo add #2 \axoyo add (#3) + \fsize \axowidth \axoscale btext showpage}} +} +% +\def\GText(#1,#2)#3#4{ +% +% Draws a box with the center at (x1,y1) and postscript(#4) text in it. +% The grayness of the box is given by #3 +% +\put(\axoxoff,\axoyoff){\special{"/\pfont findfont \fsize + scalefont setfont #1 \axoxo add #2 \axoyo add #3 (#4) + \fsize \axowidth \axoscale gtext showpage}} +} +% +\def\CText(#1,#2)#3#4#5{ +% +% Draws a box with the center at (x1,y1) and postscript(#5) text in it. +% The color of box and text is in #3 +% The color of the background is in #4 +% +\put(\axoxoff,\axoyoff){\special{"/\pfont findfont \fsize + scalefont setfont #4 #1 \axoxo add #2 \axoyo add (#5) + \fsize \axowidth \axoscale ctext1 showpage}} +\put(\axoxoff,\axoyoff){\special{"/\pfont findfont \fsize + scalefont setfont #3 #1 \axoxo add #2 \axoyo add (#5) + \fsize \axowidth \axoscale ctext2 showpage}} +} +% +\def\B2Text(#1,#2)#3#4{ +% +% Draws a box with the center at (x1,y1) and two lines of postscript +% text in it. +% +\put(\axoxoff,\axoyoff){\special{"/\pfont findfont \fsize + scalefont setfont \axocolor #1 \axoxo add #2 \axoyo add (#3) (#4) + \fsize \axowidth \axoscale b2text showpage}} +} +% +\def\G2Text(#1,#2)#3#4#5{ +% +% Draws a box with the center at (x1,y1) and two lines of postscript +% text (#4 and #5) in it. +% The grayness of the box is given by #3 +% +\put(\axoxoff,\axoyoff){\special{"/\pfont findfont \fsize + scalefont setfont #1 \axoxo add #2 \axoyo add #3 (#4) (#5) + \fsize \axowidth \axoscale g2text showpage}} +} +% +\def\C2Text(#1,#2)#3#4#5#6{ +% +% Draws a box with the center at (x1,y1) and two lines of postscript +% text (#5 and #6) in it. +% The color of the box and the text is given by #3 +% The background color is given by #4 +% +\put(\axoxoff,\axoyoff){\special{"/\pfont findfont \fsize + scalefont setfont #4 #1 \axoxo add #2 \axoyo add (#5) (#6) + \fsize \axowidth \axoscale c2text1 showpage}} +\put(\axoxoff,\axoyoff){\special{"/\pfont findfont \fsize + scalefont setfont #3 #1 \axoxo add #2 \axoyo add (#5) (#6) + \fsize \axowidth \axoscale c2text2 showpage}} +} diff --git a/graphics/axodraw/axodraw.tex b/graphics/axodraw/axodraw.tex new file mode 100644 index 0000000000..f817244397 --- /dev/null +++ b/graphics/axodraw/axodraw.tex @@ -0,0 +1,960 @@ +\documentstyle[11pt,a4,axodraw]{article} + +\def\KeyWord#1{$\backslash$\IfColor{$\!\!$\textRed{#1}\textBlack}{#1}$\!\!$} + +\begin{document} + +\begin{center} +{\Huge \IfColor{\textRed{A}\textOrange{X}\textYellow{O}\textGreen +{D}\textBlue{R}\textRoyalPurple{A}\textViolet{W}\textBlack$\!\!\!$}{AXODRAW}} \\ +\vspace{3cm} +{\LARGE J.A.M.Vermaseren} \\ +\vspace{4mm} +NIKHEF-H \\ P.O. Box 41882 \\ 1009 DB Amsterdam \\ \vspace{5mm} +\end{center} + +\vspace{5cm} + +\begin{abstract} +Axodraw is a set of drawing primitives for use in \LaTeX. These can be used +for the drawing of Feynman diagrams, flow charts and simple graphics. +Because it uses postscript for its drawing commands it works only in +combination with the dvips of Radical Eye Software which is presently the +most popular dvips program. More will be added in the future. It allows +whole articles including their pictures to be contained in a single file, +thereby making it easier to exchange the article file by e-mail. The +current version\footnote{An earlier version of Axodraw was published +in Comp. Phys. Comm. 83 (1994) 45.} supports color according to the scheme +implemented in the file colordvi.sty which comes with most \TeX{} +distributions. +\end{abstract} + +\newpage + +\section{Using Axodraw} + +The file axodraw.sty is a style file for \LaTeX{}. It should be included +in the documentstyle statement at the beginning of the +document. An example would be: \IfColor{\textBlue}{} +\begin{verbatim} + \documentstyle[a4,11pt,axodraw]{article} +\end{verbatim} +\IfColor{\textBlack}{} +Because axodraw.sty reads also the epsf.sty file that comes with many +implementations of \TeX{} and in particular those that rely on the dvips +program by Radical Eye Software for the printing, this file should be +present in the system. If this file is not available one should obtain it +from another system. The file colordvi.sty is also read, but if it is not +present there will be no error. The user should just not use color in that +case. The author feels in no way responsible for the problems that may +occur when a different dvi-to-postscript program is used. + +The drawing is actually done in postscript. Because the above mentioned +dvi-to-postscript converter allows the inclusion of postscript code the +graphics primitives have been included in the file axodraw.sty in terms +of postscript. If another postscript converter is used, one may have to +adapt the syntax of the inclusion of this code to the local system. + +The commands of Axodraw should be executed inside either the picture or the +figure environment. Inside this environment it is possible to place objects +at arbitrary positions and put text between them. In principle one could +try to draw objects with the facilities of \LaTeX{} itself, but it turns +out that the commands in the picture environment are not very powerful. +Axodraw gives good extensions of them. An example would be +\IfColor{\textBlue}{} +\begin{verbatim} + \begin{center} \begin{picture}(300,100)(0,0) + \SetColor{Red} + \GlueArc(150,50)(40,0,180){5}{8} + \SetColor{Green} + \GlueArc(150,50)(40,180,360){5}{8} + \SetColor{Blue} + \Gluon(50,50)(110,50){5}{4} \Vertex(110,50){2} + \Gluon(190,50)(250,50){5}{4} \Vertex(190,50){2} + \end{picture} \\ {\sl A gluon loop diagram} \end{center} +\end{verbatim} +\IfColor{\textBlack}{} +This code would result in: +\begin{center} \begin{picture}(300,100)(0,0) +\SetColor{Red} +\GlueArc(150,50)(40,0,180){5}{8} +\SetColor{Green} +\GlueArc(150,50)(40,180,360){5}{8} +\SetColor{Blue} +\Gluon(50,50)(110,50){5}{4} \Vertex(110,50){2} +\Gluon(190,50)(250,50){5}{4} \Vertex(190,50){2} +\end{picture} \\ {\sl A gluon loop diagram} \end{center} +The syntax and the meaning of these command are explained in the next +section. One should note that all coordinates are presented in units of +1 point. There are 72 points in an inch. It is possible to use scale +transformations if these units are not convenient. + +Currently the primitives are mainly useful for the drawing of Feynman +diagrams and the drawing of flowcharts. This means that the commands were +designed to draw a number of these graphs. Of course many more things can +be drawn with them, like scatter plots, histograms etc. + +The current manual uses only those color commands that are safe on systems +that do not have the required colordvi.sty file. It should however be clear +from the examples how to use the other features. To allow the creation of +complicated color commands that will work also in the absence of the +colordvi.sty file there is a macro IfColor which is described below with +the other commands. + +\section{The commands} + +The commands that are currently available in Axodraw are (in alphabetic +order): +\begin{itemize} +\item \KeyWord{ArrowArc}(x,y)(r,$\phi_1$,$\phi_2$) \hfill \\ + Draws an arc segment centered around (x,y). The radius is r. The + arc-segment runs counterclockwise from $\phi_1$ to $\phi_2$. All + angles are given in degrees. In the middle of the segment there will + be an arrow. +\item \KeyWord{ArrowArcn}(x,y)(radius,$\phi_1$,$\phi_2$) \hfill \\ + Draws an arc segment centered around (x,y). The radius is r. The + arc-segment runs clockwise from $\phi_1$ to $\phi_2$. All + angles are given in degrees. In the middle of the segment there will + be an arrow. +\item \KeyWord{ArrowLine}($x_1$,$y_1$)($x_2$,$y_2$) \hfill \\ + Draws a line from ($x_1$,$y_1$) to ($x_2$,$y_2$). There will be an + arrow in the middle of the line. +\item \KeyWord{BBox}($x_1$,$y_1$)($x_2$,$y_2$) \hfill \\ + Draws a box of which the contents are blanked out. This means that + anything that was present at the position of the box will be + overwritten. The lower left corner of the box is at ($x_1$,$y_1$) and + ($x_2$,$y_2$) is the upper right corner of the box. +\item \KeyWord{BBoxc}(x,y)(width,height) \hfill \\ + Draws a box of which the contents are blanked out. This means that + anything that was present at the position of the box will be + overwritten. The center of the box is at (x,y). Width and height refer + to the full width and the full height of the box. +\item \KeyWord{BCirc}(x,y)\{r\} \hfill \\ + Draws a circle of which the contents are blanked out. This means that + anything that was present at the position of the circle will be + overwritten. The center of the circle is at (x,y). r is its radius. +\item \KeyWord{Boxc}(x,y)(width,height) \hfill \\ + Draws a box. The center of the box is at (x,y). Width and height refer + to the full width and the full height of the box. +\item \KeyWord{BText}(x,y)\{text\} \hfill \\ + Draws a box with one line of centered postscript text in it. The box is + just big enough to fit around the text. The coordinates refer to the + center of the box. The box is like a BBox in that it blanks out + whatever was at the position of the box. +\item \KeyWord{B2Text}(x,y)\{text1\}\{text2\} \hfill \\ + Draws a box with two lines of centered postscript text in it. The box is + just big enough to fit around the text. The coordinates refer to the + center of the box. The box is like a BBox in that it blanks out + whatever was at the position of the box. +\item \KeyWord{CArc}(x,y)(radius,$\phi_1$,$\phi_2$) \hfill \\ + Draws an arc segment centered around (x,y). The radius is r. The + arc-segment runs counterclockwise from $\phi_1$ to $\phi_2$. All + angles are given in degrees. +\item \KeyWord{CBox}($x_1$,$y_1$)($x_2$,$y_2$)\{color1\}\{color2\} \hfill \\ + Draws a box. The lower left corner of the box is at ($x_1$,$y_1$) and + ($x_2$,$y_2$) is the upper right corner of the box. The contents of + the box are lost. The color of the box will be color1 and the color of + the background inside the box will be color2. +\item \KeyWord{CBoxc}(x,y)(width,height)\{color1\}\{color2\} \hfill \\ + Draws a box of which the contents are blanked out. This means that + anything that was present at the position of the box will be + overwritten. The center of the box is at (x,y). Width and height refer + to the full width and the full height of the box. The color of the box + will be color1 and the color of the background inside the box will be + color2. +\item \KeyWord{CCirc}(x,y)\{radius\}\{color1\}\{color2\} \hfill \\ + Draws a circle around (x,y) with radius r. The contents of + the circle are lost. The color of the box will be color1 and the color + of the background inside the box will be color2. +\item \KeyWord{COval}(x,y)(h,w)($\phi$)\{color1\}\{color2\} \hfill \\ + Draws an oval with an internal color indicated by color2. The oval + itself has the color color1. The center of the oval + is given by (x,y). Its height is h, and the width is w. In addition + the oval can be rotated counterclockwise over $\phi$ degrees. The + oval overwrites anything that used to be in its position. +\item \KeyWord{CText}(x,y)\{color1\}\{color2\}\{text\} \hfill \\ + Draws a box with one line of centered postscript text in it. The + box is just big enough to fit around the text. The coordinates refer to + the center of the box. The box is like a CBox in that it blanks out + whatever was at the position of the box. The color of the box and the + text inside is color1 and the background inside has the color color2. +\item \KeyWord{C2Text}(x,y)\{color1\}\{color2\}\{text1\}\{text2\} \hfill \\ + Draws a box with two lines of centered postscript text in it. + The box is just big enough to fit around the text. The coordinates + refer to the center of the box. The box is like a CBox in that it blanks + out whatever was at the position of the box. The color of the box and the + text inside is color1 and the background inside has the color color2. +\item \KeyWord{Curve}\{$(x_1,y_1)(x_2,y_2)\cdots(x_n,y_n)$\} \hfill \\ + Draws a curve through the given points. The x-values are supposed to + be in ascending order. The curve is a combination of quadratic and + third order segments and is continuous in its first and second derivatives. +\item \KeyWord{DashArrowArc}(x,y)(r,$\phi_1$,$\phi_2$)\{dashsize\} \hfill \\ + Draws a dashed arc segment centered around (x,y). The radius is r. The + arc-segment runs counterclockwise from $\phi_1$ to $\phi_2$. All + angles are given in degrees. In the middle of the segment there will + be an arrow. The size of the dashes is approximately equal to + `dashsize'. +\item \KeyWord{DashArrowArcn}(x,y)(radius,$\phi_1$,$\phi_2$)\{dashsize\} \hfill \\ + Draws a dashed arc segment centered around (x,y). The radius is r. The + arc-segment runs clockwise from $\phi_1$ to $\phi_2$. All + angles are given in degrees. In the middle of the segment there will + be an arrow. The size of the dashes is approximately equal to + `dashsize'. +\item \KeyWord{DashArrowLine}($x_1$,$y_1$)($x_2$,$y_2$)\{dashsize\} \hfill \\ + Draws a line from ($x_1$,$y_1$) to ($x_2$,$y_2$) with a dashed + pattern. The size of the black parts of the pattern is given by + `dashsize'. The alternating pieces have equal length. The size of + the pattern is adjusted so that both the begin and the end are + black. Halfway the line there is an arrow. +\item \KeyWord{DashCArc}(x,y)(radius,$\phi_1$,$\phi_2$)\{dashsize\} \hfill \\ + Draws a dashed arc segment centered around (x,y). The radius is r. The + arc-segment runs counterclockwise from $\phi_1$ to $\phi_2$. All + angles are given in degrees. The size of the dashes is determined by + `dashsize'. This size is adjusted somewhat to make the result look + nice. +\item \KeyWord{DashCurve}\{$(x_1,y_1)(x_2,y_2)\cdots(x_n,y_n)$\}\{ + dashsize\} \hfill \\ + Draws a dashed curve through the given points. The x-values are + supposed to be in ascending order. The curve is a combination of + quadratic and third order segments. The size of the black parts and + the white parts will be approximately `dashsize' each. Some + adjustment takes place to make the pattern come out right at the + endpoints. +\item \KeyWord{DashLine}($x_1$,$y_1$)($x_2$,$y_2$)\{dashsize\} \hfill \\ + Draws a line from ($x_1$,$y_1$) to ($x_2$,$y_2$) with a dashed + pattern. The size of the black parts of the pattern is given by + `dashsize'. The alternating pieces have equal length. The size of + the pattern is adjusted so that both the begin and the end are + black. +\item \KeyWord{EBox}($x_1$,$y_1$)($x_2$,$y_2$) \hfill \\ + Draws a box. The lower left corner of the box is at ($x_1$,$y_1$) and + ($x_2$,$y_2$) is the upper right corner of the box. +\item \KeyWord{IfColor}\{arg1\}\{arg2\} \hfill \\ + If the file colordvi.sty is present the first argument will be + executed. If this file is not present the second argument will be + executed. For examples, see some of the figures. This command can also + be used in the regular text of the \LaTeX{} file. +\item \KeyWord{GBox}($x_1$,$y_1$)($x_2$,$y_2$)\{grayscale\} \hfill \\ + Draws a box. The lower left corner of the box is at ($x_1$,$y_1$) and + ($x_2$,$y_2$) is the upper right corner of the box. The contents of + the box are lost. They are overwritten with a color gray that is + indicated by the parameter `grayscale'. This parameter can have + values ranging from 0 (black) to 1 (white). +\item \KeyWord{GBoxc}(x,y)(width,height)\{grayscale\} \hfill \\ + Draws a box. The center of the box is at (x,y). Width and height refer + to the full width and the full height of the box. The contents of + the box are lost. They are overwritten with a color gray that is + indicated by the parameter `grayscale'. This parameter can have + values ranging from 0 (black) to 1 (white). +\item \KeyWord{GCirc}(x,y)\{radius\}\{grayscale\} \hfill \\ + Draws a circle around (x,y) with radius r. The contents of + the circle are lost. They are overwritten with a color gray that is + indicated by the parameter `grayscale'. This parameter can have + values ranging from 0 (black) to 1 (white). +\item \KeyWord{GlueArc}(x,y)(r,$\phi_1$,$\phi_2$)\{amplitude\}\{windings\} \hfill \\ + Draws a gluon on an arc-segment. The center of the arc is (x,y) and r + is its radius. The arc segment runs counterclockwise from $\phi_1$ + to $\phi_2$. The width of the gluon is twice `amplitude', and the + number of windings is given by the last parameter. Note that whether + the curls are inside or outside can be influenced with the sign of + the amplitude. When it is positive the curls are on the inside. +\item \KeyWord{Gluon}($x_1$,$y_1$)($x_2$,$y_2$)\{amplitude\}\{windings\} \hfill \\ + Draws a gluon from ($x_1$,$y_1$) to ($x_2$,$y_2$). The width of the + gluon will be twice the value of `amplitude'. The number of windings + is given by the last parameter. If this parameter is not an integer + it will be rounded to an integer value. The side at which the + windings lie is determined by the order of the two coordinates. Also + a negative amplitude can change this side. +\item \KeyWord{GOval}(x,y)(h,w)($\phi$)\{grayscale\} Draws an oval with + an internal color indicated by grayscale. This parameter can have + values ranging from 0 (black) to 1 (white). The center of the oval + is given by (x,y). Its height is h, and the width is w. In addition + the oval can be rotated counterclockwise over $\phi$ degrees. The + oval overwrites anything that used to be in its position. +\item \KeyWord{GText}(x,y)\{grayscale\}\{text\} \hfill \\ + Draws a gray box with one line of centered postscript text in it. The + box is just big enough to fit around the text. The coordinates refer to + the center of the box. The box is like a BBox in that it blanks out + whatever was at the position of the box. +\item \KeyWord{G2Text}(x,y)\{grayscale\}\{text1\}\{text2\} \hfill \\ + Draws a gray box with two lines of centered postscript text in it. + The box is just big enough to fit around the text. The coordinates + refer to the center of the box. The box is like a BBox in that it + blanks out whatever was at the position of the box. +\item \KeyWord{LinAxis}($x_1$,$y_1$)($x_2$,$y_2$)($N_D$,$d$,hashsize + ,offset,width) \hfill \\ + This draws a line to be used as an axis in a graph. Along the axis + are hash marks. Going from the first coordinate to the second, the + hash marks are on the left side if `hashsize', which is the size of the + hash marks, is positive and on the right side if it is negative. + $N_D$ is the number of `decades', indicated by fat hash marks, and + $d$ is the number of subdivisions inside each decade. The offset + parameter tells to which subdivision the first coordinate + corresponds. When it is zero, this coordinate corresponds to a fat + mark of a decade. Because axes have their own width, this is + indicated with the last parameter. +\item \KeyWord{Line}($x_1$,$y_1$)($x_2$,$y_2$) \hfill \\ + Draws a line from ($x_1$,$y_1$) to ($x_2$,$y_2$). +\item \KeyWord{LogAxis}($x_1$,$y_1$)($x_2$,$y_2$)($N_L$,hashsize + ,offset,width) \hfill \\ + This draws a line to be used as an axis in a graph. Along the axis + are hash marks. Going from the first coordinate to the second, the + hash marks are on the left side if `hashsize', which is the size of the + hash marks, is positive and on the right side if it is negative. + $N_L$ is the number of orders of magnitude, indicated by fat + hash marks. The offset parameter tells to which integer subdivision + the first coordinate corresponds. When it is zero, this coordinate + corresponds to a fat mark, which is identical to when the value + would have been 1. Because axes have their own width, this is + indicated with the last parameter. +\item \KeyWord{LongArrow}($x_1$,$y_1$)($x_2$,$y_2$) \hfill \\ + Draws a line from ($x_1$,$y_1$) to ($x_2$,$y_2$). There will be an + arrow at the end of the line. +\item \KeyWord{LongArrowArc}(x,y)(r,$\phi_1$,$\phi_2$) \hfill \\ + Draws an arc segment centered around (x,y). The radius is r. The + arc-segment runs counterclockwise from $\phi_1$ to $\phi_2$. All + angles are given in degrees. At the end of the segment there will + be an arrow. +\item \KeyWord{LongArrowArcn}(x,y)(radius,$\phi_1$,$\phi_2$) \hfill \\ + Draws an arc segment centered around (x,y). The radius is r. The + arc-segment runs clockwise from $\phi_1$ to $\phi_2$. All + angles are given in degrees. At the end of the segment there will + be an arrow. +\item \KeyWord{Oval}(x,y)(h,w)($\phi$) Draws an oval. + The center of the oval + is given by (x,y). Its height is h, and the width is w. In addition + the oval can be rotated counterclockwise over $\phi$ degrees. The + oval does not overwrite its contents. +\item \KeyWord{Photon}($x_1$,$y_1$)($x_2$,$y_2$)\{amplitude\}\{wiggles\} \hfill \\ + Draws a photon from ($x_1$,$y_1$) to ($x_2$,$y_2$). The width of the + photon will be twice the value of `amplitude'. The number of wiggles + is given by the last parameter. If twice this parameter is not an integer + it will be rounded to an integer value. Whether the first wiggle + starts up or down can be influenced with the sign of the amplitude. +\item \KeyWord{PhotonArc}(x,y)(r,$\phi_1$,$\phi_2$)\{amplitude\}\{wiggles\} \hfill \\ + Draws a photon on an arc-segment. The center of the arc is (x,y) and r + is its radius. The arc segment runs counterclockwise from $\phi_1$ + to $\phi_2$. The width of the photon is twice `amplitude', and the + number of wiggles is given by the last parameter. Note that + the sign of the amplitude influences whether the photon starts going + outside (positive) or starts going inside (negative). If one likes + the photon to reach both endpoints from the outside the number of + wiggles should be an integer plus 0.5. +\item \KeyWord{PText}(x,y)($\phi$)$[$mode$]$\{text\} \hfill \\ + Places a postscript text. The focal point is (x,y). The text is the last + parameter. The mode parameter tells how the text should be + positioned with respect to the focal point. If this parameter is + omitted the center of the text will correspond to the focal point. + Other options are: l for having the left side correspond to the + focal point, r for having the right side correspond to it, t for + having the top at the focal point and b for the bottom. One may + combine two letters as in $[$bl$]$, as long as it makes sense. The + parameter $\phi$ is a rotation angle. The text is written in the + current postscript font. This font can be set with the SetPFont + command. +\item \KeyWord{rText}(x,y)$[$mode$][$rotation$]$\{text\} \hfill \\ + Places a rotated text. The focal point is (x,y). The text is the last + parameter. If the rotation parameter is the character l the text + will be rotated left by 90 degrees, if it is an r it will be rotated + to the right by 90 degrees and when it is the character u the text + will be rotated by 180 degrees. When there is no character there is + no rotation and the command is identical to the Text command. + The mode parameter tells how the resulting box should be + positioned with respect to the focal point. If this parameter is + omitted the center of the box will correspond to the focal point. + Other options are: l for having the left side correspond to the + focal point, r for having the right side correspond to it, t for + having the top at the focal point and b for the bottom. One may + combine two letters as in $[$bl$]$, as long as it makes sense. +\item \KeyWord{SetColor}\{NameOfColor\} \hfill \\ + Sets the color for the next commands. This command onlt affects the + current picture. In addition it does not affect the text commands that + write in \TeX{} mode. Also the commands that draw gray boxes are not + affected. For influencing the color of the \TeX{} or \LaTeX{} output + one can use the commands mentioned in the colordvi.sty file. +\item \KeyWord{SetPFont}\{fontname\}\{fontsize\} \hfill \\ + Sets the postscript font to a given type and scale. +\item \KeyWord{SetScale}\{scalevalue\} \hfill \\ + Changes the scale of all graphics operations. Unfortunately it does + not change the scale of the text operations (yet?). A `scalevalue' of + 1 is the default. It is allowed to use floating point values. +\item \KeyWord{SetOffset}(x\_offset,y\_offset) \hfill \\ + Adds the offset values to all coordinates at the \TeX{} level. This + makes it easier to move figures around. +\item \KeyWord{SetScaledOffset}(x\_offset,y\_offset) \hfill \\ + Adds the offset values to all coordinates at the postscript level. + This is done after scaling has been applied. Hence one can work with + the scaled coordinates. This can be very handy when drawing curves. +\item \KeyWord{SetWidth}\{widthvalue\} \hfill \\ + Changes the linewidth in all graphics operations. It does + not change the linewidth of the text operations. That is a matter of + font selection. A `widthvalue' of + 0.5 is the default. It is allowed to use floating point values. +\item \KeyWord{Text}(x,y)$[$mode$]$\{text\} \hfill \\ + Places a text. The focal point is (x,y). The text is the last + parameter. The mode parameter tells how the text should be + positioned with respect to the focal point. If this parameter is + omitted the center of the text will correspond to the focal point. + Other options are: l for having the left side correspond to the + focal point, r for having the right side correspond to it, t for + having the top at the focal point and b for the bottom. One may + combine two letters as in $[$bl$]$, as long as it makes sense. +\item \KeyWord{Vertex}(x,y)\{r\} \hfill \\ + Draws a fat dot at (x,y). The radius of the dot is given by r. +\item \KeyWord{ZigZag}($x_1$,$y_1$)($x_2$,$y_2$)\{amplitude\}\{wiggles\} \hfill \\ + Draws a zigzag line from ($x_1$,$y_1$) to ($x_2$,$y_2$). The width of the + zigzagging will be twice the value of `amplitude'. The number of zigzags + is given by the last parameter. If twice this parameter is not an integer + it will be rounded to an integer value. Whether the first zigzag + starts up or down can be influenced with the sign of the amplitude. +\end{itemize} + +A note about color. The names of the colors can be found in the local file +colordvi.sty or colordvi.tex. This file gives also the commands that allow +the user to change the color of the text. + +\section{Examples} + +Although the previous section contains all the commands and their proper +syntax a few examples may be helpful. +\subsection{Text modes} +The meaning of the mode characters in the text commands can best be +demonstrated. The statements +\IfColor{\textBlue}{} +\begin{verbatim} + \begin{center} \begin{picture}(300,100)(0,0) + \SetColor{BrickRed} + \CArc(50,75)(2,0,360) \Text(50,75)[lt]{left-top} + \CArc(50,50)(2,0,360) \Text(50,50)[l]{left-center} + \CArc(50,25)(2,0,360) \Text(50,25)[lb]{left-bottom} + \CArc(150,75)(2,0,360) \Text(150,75)[t]{center-top} + \CArc(150,50)(2,0,360) \Text(150,50)[]{center-center} + \CArc(150,25)(2,0,360) \Text(150,25)[b]{center-bottom} + \CArc(250,75)(2,0,360) \Text(250,75)[rt]{right-top} + \CArc(250,50)(2,0,360) \Text(250,50)[r]{right-center} + \CArc(250,25)(2,0,360) \Text(250,25)[rb]{right-bottom} + \end{picture} \end{center} +\end{verbatim} +\IfColor{\textBlack}{} +produce 9 texts and for each the focal point is indicated by a little +circle. It looks like +\begin{center} +\begin{picture}(300,100)(0,0) +\SetColor{BrickRed} +\CArc(50,75)(2,0,360) \Text(50,75)[lt]{left-top} +\CArc(50,50)(2,0,360) \Text(50,50)[l]{left-center} +\CArc(50,25)(2,0,360) \Text(50,25)[lb]{left-bottom} +\CArc(150,75)(2,0,360) \Text(150,75)[t]{center-top} +\CArc(150,50)(2,0,360) \Text(150,50)[]{center-center} +\CArc(150,25)(2,0,360) \Text(150,25)[b]{center-bottom} +\CArc(250,75)(2,0,360) \Text(250,75)[rt]{right-top} +\CArc(250,50)(2,0,360) \Text(250,50)[r]{right-center} +\CArc(250,25)(2,0,360) \Text(250,25)[rb]{right-bottom} +\end{picture} +\end{center} +This illustrates exactly all the combinations of the mode characters and +what their effects are. The commands $\backslash$Text and +$\backslash$rText give a tex according to \LaTeX{}. This text is +insensitive to the scaling commands, and the color of the text should be +set with the regular color commands given in colordvi.sty. The text in the +$\backslash$PText command (and the various boxes with text) is a postscript +text. Such text is sensitive to the scaling commands and in addition the +color is set with the $\backslash$SetColor command or in the command itself +(in the case of the boxes). In the case of \LaTeX{} text +it can of course contain different fonts, +math mode and all those little things that are usually easier in +\LaTeX{} than in postscript. + +\subsection{The windings of a gluon} + +Gluons are traditionally represented by a two dimensional projection of +a helix. Actually close inspection of some pretty gluons reveals that +it is usually not quite a helix. Hence the gluons in Axodraw are also +not quite helices. In addition one may notice that the begin and end +points deviate slightly from the regular windings. This makes it more in +agreement with hand drawn gluons. When a gluon is drawn, one needs not +only its begin and end points but there is an amplitude connected to +this almost helix, and in addition there are windings. The number of +windings is the number of curls that the gluon will have. Different +people may prefer different densities of curls. This can effect the +appearance considerably: +\IfColor{\textBlue}{} +\begin{verbatim} + \begin{center} + \begin{picture}(330,100)(0,0) + \SetColor{Red} + \Gluon(25,15)(25,95){5}{4} \Text(25,7)[]{4 windings} + \Gluon(95,15)(95,95){5}{5} \Text(95,7)[]{5 windings} + \Gluon(165,15)(165,95){5}{6} \Text(165,7)[]{6 windings} + \Gluon(235,15)(235,95){5}{7} \Text(235,7)[]{7 windings} + \Gluon(305,15)(305,95){5}{8} \Text(305,7)[]{8 windings} + \end{picture} + \end{center} +\end{verbatim} +\IfColor{\textBlack}{} +This code results in: +\begin{center} +\begin{picture}(330,100)(0,0) +\SetColor{Red} +\Gluon(25,15)(25,95){5}{4} \Text(25,7)[]{4 windings} +\Gluon(95,15)(95,95){5}{5} \Text(95,7)[]{5 windings} +\Gluon(165,15)(165,95){5}{6} \Text(165,7)[]{6 windings} +\Gluon(235,15)(235,95){5}{7} \Text(235,7)[]{7 windings} +\Gluon(305,15)(305,95){5}{8} \Text(305,7)[]{8 windings} +\end{picture} +\end{center} +The influence of the amplitude is also rather great. The user should +experiment with it. There is however an aspect to the amplitude that +should be discussed. For a straight gluon the amplitude can determine on +which side the curls are. So does the direction of the gluon: +\IfColor{\textBlue}{} +\begin{verbatim} + \begin{center} + \begin{picture}(325,100)(0,0) + \SetColor{Red} + \Gluon(50,15)(50,95){5}{6} + \Text(50,7)[]{amp $> 0$} \Text(40,50)[]{$\uparrow$} + \Gluon(125,95)(125,15){5}{6} + \Text(125,7)[]{amp $> 0$} \Text(115,50)[]{$\downarrow$} + \Gluon(200,15)(200,95){-5}{6} + \Text(200,7)[]{amp $< 0$} \Text(190,50)[]{$\uparrow$} + \Gluon(275,95)(275,15){-5}{6} + \Text(275,7)[]{amp $< 0$} \Text(265,50)[]{$\downarrow$} + \end{picture} + \end{center} +\end{verbatim} +\IfColor{\textBlack}{} +The picture gets the following appearance: +\begin{center} +\begin{picture}(325,100)(0,0) +\SetColor{Red} +\Gluon(50,15)(50,95){5}{6} +\Text(50,7)[]{amp $> 0$} \Text(40,50)[]{$\uparrow$} +\Gluon(125,95)(125,15){5}{6} +\Text(125,7)[]{amp $> 0$} \Text(115,50)[]{$\downarrow$} +\Gluon(200,15)(200,95){-5}{6} +\Text(200,7)[]{amp $< 0$} \Text(190,50)[]{$\uparrow$} +\Gluon(275,95)(275,15){-5}{6} +\Text(275,7)[]{amp $< 0$} \Text(265,50)[]{$\downarrow$} +\end{picture} +\end{center} +For straight gluons one does not need the option of the negative +amplitude. It is however necessary for gluons on an arc segment. In that +case the arc is always drawn in an anticlockwise direction. Hence the +direction is fixed and only the amplitude is left as a tool for +determining the side with the curls. + +\subsection{Scaling} + +Sometimes it is much easier to design a figure on a larger scale than it +is needed in the eventual printing. In that case one can use a scale +factor, either during the design or in the final result. We use the +figure in the first section as an example: +\IfColor{\textBlue}{} +\begin{verbatim} + \vspace{-10pt} \hfill \\ + \SetScale{0.3} + \begin{picture}(70,30)(0,13) + \SetColor{Red} + \GlueArc(120,50)(40,0,180){5}{8} + \SetColor{Green} + \GlueArc(120,50)(40,180,360){5}{8} + \SetColor{Blue} + \Gluon(20,50)(80,50){5}{4} \Vertex(80,50){2} + \Gluon(160,50)(220,50){5}{4} \Vertex(160,50){2} + \end{picture} $+$ others + $ = C_A(\frac{5}{3}+\frac{31}{9}\epsilon) + + n_F(-\frac{2}{3}-\frac{10}{9}\epsilon)$ + \vspace{10pt} \hfill \\ +\end{verbatim} +\IfColor{\textBlack}{} +We have lowered the figure by 13 points (the (0,13) in the picture +statement) to make it look nice with respect to the equal sign. The +result is + \vspace{-10pt} \hfill \\ + \SetScale{0.3} + \begin{picture}(70,30)(0,13) + \SetColor{Red} + \GlueArc(120,50)(40,0,180){5}{8} + \SetColor{Green} + \GlueArc(120,50)(40,180,360){5}{8} + \SetColor{Blue} + \Gluon(20,50)(80,50){5}{4} \Vertex(80,50){2} + \Gluon(160,50)(220,50){5}{4} \Vertex(160,50){2} + \end{picture} $+$ others + $ = C_A(\frac{5}{3}+\frac{31}{9}\epsilon) + + n_F(-\frac{2}{3}-\frac{10}{9}\epsilon)$ + \vspace{10pt} \hfill \\ + \SetScale{1} +This way it is rather straightforward to make whole pictorial equations. +Of course some things are not scale invariant. The appreciation of a +figure may be somewhat different when the scale is changed. In the above +case one might consider changing the amplitude of the gluons a little +bit. Changing this from 5 to 7 and at the same time reducing the number +of windings from 4 to 3 for the straight gluons and from 8 to 7 for the +gluons in the arcs gives + \vspace{-10pt} \hfill \\ + \SetScale{0.3} + \begin{picture}(70,30)(0,13) + \SetColor{Red} + \GlueArc(120,50)(40,0,180){7}{7} + \SetColor{Green} + \GlueArc(120,50)(40,180,360){7}{7} + \SetColor{Blue} + \Gluon(20,50)(80,50){7}{3} \Vertex(80,50){2} + \Gluon(160,50)(220,50){7}{3} \Vertex(160,50){2} + \end{picture} $+$ others + $ = C_A(\frac{5}{3}+\frac{31}{9}\epsilon) + + n_F(-\frac{2}{3}-\frac{10}{9}\epsilon)$ + \vspace{10pt} \hfill \\ + \SetScale{1} +At this scale this may please the eye more. + +There is one problem with scaling. Currently it is only possible to have +text scale with the rest of a figure when the text has been printed with +the PText command. This makes the typesetting more complicated, but the +scaling of the \TeX{} pixel fonts would give rather poor results anyway. + +\subsection{Photons} + +When drawing photons one should take care that the number of wiggles is +selected properly. Very often this number should be an integer plus +$0.5$. This can be seen in the following example: +\IfColor{\textBlue}{} +\begin{verbatim} + \begin{center}\begin{picture}(300,56)(0,0) + \Vertex(180,10){1.5} \Vertex(120,10){1.5} + \SetColor{Red} + \ArrowLine(100,10)(200,10) + \SetColor{Green} + \LongArrowArc(150,10)(20,60,120) + \SetColor{Brown} + \PhotonArc(150,10)(30,0,180){4}{8.5} % 8.5 wiggles + \end{picture} \end{center} +\end{verbatim} +\IfColor{\textBlack}{} +This gives the `proper' picture as it would usually drawn by hand: + \begin{center}\begin{picture}(300,56)(0,0) + \Vertex(180,10){1.5} \Vertex(120,10){1.5} + \SetColor{Red} + \ArrowLine(100,10)(200,10) + \SetColor{Green} + \LongArrowArc(150,10)(20,60,120) + \SetColor{Brown} + \PhotonArc(150,10)(30,0,180){4}{8.5} % 8.5 wiggles + \end{picture} \end{center} +When the number of wiggles is reduced to 8 we obtain: + \begin{center}\begin{picture}(300,56)(0,0) + \Vertex(180,10){1.5} \Vertex(120,10){1.5} + \SetColor{Red} + \ArrowLine(100,10)(200,10) + \SetColor{Green} + \LongArrowArc(150,10)(20,60,120) + \SetColor{Brown} + \PhotonArc(150,10)(30,0,180){4}{8} % 8 wiggles + \end{picture} \end{center} +This is not as nice. Somehow the symmetry is violated. One should also +take care that the wiggles start in the proper way. If we make the +amplitude negative we see that the photons are not `right' either: + \begin{center}\begin{picture}(300,56)(0,0) + \Vertex(180,10){1.5} \Vertex(120,10){1.5} + \SetColor{Red} + \ArrowLine(100,10)(200,10) + \SetColor{Green} + \LongArrowArc(150,10)(20,60,120) + \SetColor{Brown} + \PhotonArc(150,10)(30,0,180){-4}{8.5} % 8.5 wiggles + \end{picture} \end{center} +Sometimes these things require some experimenting. + +\subsection{Flowcharts} + +There are several commands for creating boxes with text in them. This can +be a box with either one line of text or with two lines of text. The rest +is just a matter of drawing lines and circle segments with arrows. If the +text is to scale with the picture one needs to use the postscript fonts. +The result of scaling the {\TeX} fonts is usually rather ugly, because +these fonts are pixel fonts. Here we present an example. It might describe +a system for the automatic computation of cross-sections: +\IfColor{\textBlue}{} +\begin{verbatim} +\begin{center} \begin{picture}(320,320)(0,0) +\SetPFont{Helvetica}{10} +\SetScale{0.8} +\SetColor{Magenta} +\ArrowLine(200,40)(200,10) \ArrowLine(200,100)(200,40) +\ArrowLine(200,150)(200,100) \ArrowLine(100,130)(200,100) +\ArrowLine(85,95)(200,100) \ArrowLine(260,105)(200,100) +\ArrowLine(250,135)(200,100) \ArrowLine(160,75)(200,100) +\ArrowLine(200,100)(250,70) \ArrowLine(200,185)(200,150) +\ArrowLine(200,220)(200,185) \ArrowLine(200,250)(200,220) +\ArrowLine(240,263)(200,250) \ArrowLine(240,237)(200,250) +\ArrowLine(200,285)(200,250) \ArrowLine(200,310)(200,285) +\ArrowLine(200,335)(200,310) \ArrowLine(180,360)(200,335) +\ArrowLine(200,385)(180,360) \ArrowLine(50,370)(180,360) +\ArrowArc(200,247.5)(62.5,90,180) +\ArrowArc(200,247.5)(62.5,180,270) +\ArrowLine(210,385)(300,360) \ArrowLine(210,335)(300,360) +\ArrowLine(80,300)(80,130) \ArrowLine(190,335)(80,300) +\ArrowLine(190,385)(80,300) \ArrowLine(50,335)(80,300) +\ArrowLine(300,360)(340,340) \ArrowArcn(205,347.5)(37.5,90,270) +\SetColor{Blue} +\BCirc(200,100){10} \BCirc(200,100){5} +\BCirc(200,40){7.5} \BCirc(200,250){10} +\BCirc(200,250){5} \BCirc(200,310){7.5} +\BCirc(180,360){7.5} \BCirc(80,300){7.5} +\BCirc(300,360){7.5} +\IfColor{\CCirc(200,185){7.5}{Blue}{Yellow} +}{\GCirc(200,185){7.5}{0.9}} +\SetColor{Red} +\BText(200,285){Form program} \BText(200,335){Diagrams} +\BText(200,385){Model} \BText(200,10){events} +\BText(80,95){Axolib} \BText(350,335){Pictures} +\IfColor{\CText(137.5,247.5){Blue}{Yellow}{instructions} +}{\GText(137.5,247.5){0.9}{instructions}} +\B2Text(260,70){Cross-sections}{Histograms} +\B2Text(140,75){Monte Carlo}{Routine} +\B2Text(275,105){FF}{1 loop integrals} +\IfColor{\C2Text(260,135){Blue}{Yellow}{Spiderlib}{Fortran/C} +}{\G2Text(260,135){0.9}{Spiderlib}{Fortran/C}} +\IfColor{\C2Text(200,150){Blue}{Yellow}{Matrix}{Element} +}{\G2Text(200,150){0.9}{Matrix}{Element}} +\B2Text(80,130){Kinematics}{Configuration} +\IfColor{\C2Text(200,220){Blue}{Yellow}{Output}{Formula} +}{\G2Text(200,220){0.9}{Output}{Formula}} +\IfColor{\C2Text(260,263){Blue}{Yellow}{Spiderlib}{Form part} +}{\G2Text(260,263){0.9}{Spiderlib}{Form part}} +\IfColor{\C2Text(260,237){Blue}{Yellow}{FF support}{library} +}{\G2Text(260,237){0.9}{FF support}{library}} +\B2Text(40,370){Reaction}{selection} +\B2Text(40,340){Specification}{Cuts, etc.} +\SetColor{Orange} +\PText(211,36)(0)[lb]{Event Generator} +\PText(211,181)(0)[lb]{Code Generator} +\PText(162,258)(0)[lb]{FORM} +\PText(211,301)(0)[lb]{Form program construction} +\PText(191,362)(0)[lb]{Diagram} +\PText(191,352)(0)[lb]{Generator} +\PText(311,370)(0)[lb]{Postscript} +\PText(311,360)(0)[lb]{Generator} +\PText(91,292)(0)[lb]{Kinematics} +\PText(91,282)(0)[lb]{Generator} +\end{picture} \end{center} +\end{verbatim} +\IfColor{\textBlack}{} +This gives the chart +\begin{center} \begin{picture}(320,320)(0,0) +\SetPFont{Helvetica}{10} +\SetScale{0.8} +\SetColor{Magenta} +\ArrowLine(200,40)(200,10) \ArrowLine(200,100)(200,40) +\ArrowLine(200,150)(200,100) \ArrowLine(100,130)(200,100) +\ArrowLine(85,95)(200,100) \ArrowLine(260,105)(200,100) +\ArrowLine(250,135)(200,100) \ArrowLine(160,75)(200,100) +\ArrowLine(200,100)(250,70) \ArrowLine(200,185)(200,150) +\ArrowLine(200,220)(200,185) \ArrowLine(200,250)(200,220) +\ArrowLine(240,263)(200,250) \ArrowLine(240,237)(200,250) +\ArrowLine(200,285)(200,250) \ArrowLine(200,310)(200,285) +\ArrowLine(200,335)(200,310) \ArrowLine(180,360)(200,335) +\ArrowLine(200,385)(180,360) \ArrowLine(50,370)(180,360) +\ArrowArc(200,247.5)(62.5,90,180) +\ArrowArc(200,247.5)(62.5,180,270) +\ArrowLine(210,385)(300,360) \ArrowLine(210,335)(300,360) +\ArrowLine(80,300)(80,130) \ArrowLine(190,335)(80,300) +\ArrowLine(190,385)(80,300) \ArrowLine(50,335)(80,300) +\ArrowLine(300,360)(340,340) \ArrowArcn(205,347.5)(37.5,90,270) +\SetColor{Blue} +\BCirc(200,100){10} \BCirc(200,100){5} +\BCirc(200,40){7.5} \BCirc(200,250){10} +\BCirc(200,250){5} \BCirc(200,310){7.5} +\BCirc(180,360){7.5} \BCirc(80,300){7.5} +\BCirc(300,360){7.5} +\IfColor{\CCirc(200,185){7.5}{Blue}{Yellow} +}{\GCirc(200,185){7.5}{0.9}} +\SetColor{Red} +\BText(200,285){Form program} \BText(200,335){Diagrams} +\BText(200,385){Model} \BText(200,10){events} +\BText(80,95){Axolib} \BText(350,335){Pictures} +\IfColor{\CText(137.5,247.5){Blue}{Yellow}{instructions} +}{\GText(137.5,247.5){0.9}{instructions}} +\B2Text(260,70){Cross-sections}{Histograms} +\B2Text(140,75){Monte Carlo}{Routine} +\B2Text(275,105){FF}{1 loop integrals} +\IfColor{\C2Text(260,135){Blue}{Yellow}{Spiderlib}{Fortran/C} +}{\G2Text(260,135){0.9}{Spiderlib}{Fortran/C}} +\IfColor{\C2Text(200,150){Blue}{Yellow}{Matrix}{Element} +}{\G2Text(200,150){0.9}{Matrix}{Element}} +\B2Text(80,130){Kinematics}{Configuration} +\IfColor{\C2Text(200,220){Blue}{Yellow}{Output}{Formula} +}{\G2Text(200,220){0.9}{Output}{Formula}} +\IfColor{\C2Text(260,263){Blue}{Yellow}{Spiderlib}{Form part} +}{\G2Text(260,263){0.9}{Spiderlib}{Form part}} +\IfColor{\C2Text(260,237){Blue}{Yellow}{FF support}{library} +}{\G2Text(260,237){0.9}{FF support}{library}} +\B2Text(40,370){Reaction}{selection} +\B2Text(40,340){Specification}{Cuts, etc.} +\SetColor{Orange} +\PText(211,36)(0)[lb]{Event Generator} +\PText(211,181)(0)[lb]{Code Generator} +\PText(162,258)(0)[lb]{FORM} +\PText(211,301)(0)[lb]{Form program construction} +\PText(191,362)(0)[lb]{Diagram} +\PText(191,352)(0)[lb]{Generator} +\PText(311,370)(0)[lb]{Postscript} +\PText(311,360)(0)[lb]{Generator} +\PText(91,292)(0)[lb]{Kinematics} +\PText(91,282)(0)[lb]{Generator} +\end{picture} \end{center} + +\subsection{Curves and graphs} + +Axodraw is equipped with a curve fitting facility that can draw smooth +curves through a set of coordinates. Coupled to this is a set of +commands to draw the axes that are typically needed for the use of +graphs and histograms. An example of a complete picture would be +\IfColor{\textBlue}{} +\begin{verbatim} +\begin{center} \begin{picture}(360,440)(0,0) +\SetOffset(40,30) +\LinAxis(0,0)(300,0)(3,10,5,0,1.5) +\LinAxis(0,400)(300,400)(3,10,-5,0,1.5) +\LogAxis(0,0)(0,400)(4,-5,2,1.5) +\LogAxis(300,0)(300,400)(4,5,2,1.5) +\SetScale{100.} \SetWidth{0.005} +\SetColor{Blue} +\Curve{(.1057001,1.2997)(.1057003,1.5399) +(.1057006,1.6908)(.1057010,1.8019)(.1057030,2.0406) +(.1057060,2.1911)(.1057100,2.3020)(.1057300,2.5403) +(.1057600,2.6904)(.1058000,2.8007)(.1060000,3.0365) +(.1080000,3.4512)(.1100000,3.5600)(.1200000,3.6950) +(.1300000,3.6969)(.1500000,3.6308)(.1800000,3.5024) +(.2200000,3.3413)(.3000000,3.0788)(.5000000,2.6374) +(.8000000,2.2295)(1.0000000,2.0357)(1.3000000 +,1.8078)(1.6000000,1.6275)(2.0000000,1.4336) +(2.5000000,1.2398)(3.0000000,1.0815)} +\SetColor{Red} +\DashCurve{(1.7853600,.0111)(1.7853800,.0228) +(1.7854000,.0339)(1.7856000,.1218)(1.7860000,.2324) +(1.7870000,.3821)(1.7900000,.5786)(1.8000000,.8089) +(1.8200000,.9765)(1.8500000,1.0869)(1.9000000 +,1.1718)(2.0000000,1.2335)(2.1000000,1.2468) +(2.2000000,1.2413)(2.4000000,1.2064) +(2.7000000,1.1340)(3.0000000,1.0574)}{0.05} +\SetScale{1.}\SetWidth{0.5} +\SetColor{Blue} +\Line(200,360)(270,360) +\Text(195,360)[r]{\large$e^+e^-\rightarrow\mu^+\mu^-$} +\SetColor{Red} +\DashLine(200,330)(270,330){5} +\Text(195,330)[r]{\large$e^+e^-\rightarrow\tau^+\tau^-$} +\SetColor{Black} +\Text(0,-10)[]{0} \Text(100,-10)[]{1} +\Text(200,-10)[]{2} \Text(300,-10)[]{3} +\Text(150,-25)[]{\large Beam energy in GeV} +\Text(-10,70)[]{$1$} \Text(-10,170)[]{$10$} +\Text(-10,270)[]{$10^2$} \Text(-10,370)[]{$10^3$} +\rText(-25,220)[][l]{\Large$\sigma$ in nb} +\ArrowLine(190,270)(160,300) +\ArrowLine(160,240)(190,270) +\ArrowLine(270,300)(240,270) +\ArrowLine(240,270)(270,240) +\Photon(190,270)(240,270){4}{4.5} +\Vertex(190,270){1.5} \Vertex(240,270){1.5} +\end{picture} \\ {\sl \hskip 10 pt Threshold +effects for $\mu$ and $\tau$} \end{center} +\end{verbatim} +\IfColor{\textBlack}{} +and the resulting picture would be +\begin{center} \begin{picture}(360,440)(0,0) +\SetOffset(40,30) +\LinAxis(0,0)(300,0)(3,10,5,0,1.5) +\LinAxis(0,400)(300,400)(3,10,-5,0,1.5) +\LogAxis(0,0)(0,400)(4,-5,2,1.5) +\LogAxis(300,0)(300,400)(4,5,2,1.5) +\SetScale{100.} \SetWidth{0.005} +\SetColor{Blue} +\Curve{(.1057001,1.2997)(.1057003,1.5399) +(.1057006,1.6908)(.1057010,1.8019)(.1057030,2.0406) +(.1057060,2.1911)(.1057100,2.3020)(.1057300,2.5403) +(.1057600,2.6904)(.1058000,2.8007)(.1060000,3.0365) +(.1080000,3.4512)(.1100000,3.5600)(.1200000,3.6950) +(.1300000,3.6969)(.1500000,3.6308)(.1800000,3.5024) +(.2200000,3.3413)(.3000000,3.0788)(.5000000,2.6374) +(.8000000,2.2295)(1.0000000,2.0357)(1.3000000 +,1.8078)(1.6000000,1.6275)(2.0000000,1.4336) +(2.5000000,1.2398)(3.0000000,1.0815)} +\SetColor{Red} +\DashCurve{(1.7853600,.0111)(1.7853800,.0228) +(1.7854000,.0339)(1.7856000,.1218)(1.7860000,.2324) +(1.7870000,.3821)(1.7900000,.5786)(1.8000000,.8089) +(1.8200000,.9765)(1.8500000,1.0869)(1.9000000 +,1.1718)(2.0000000,1.2335)(2.1000000,1.2468) +(2.2000000,1.2413)(2.4000000,1.2064) +(2.7000000,1.1340)(3.0000000,1.0574)}{0.05} +\SetScale{1.}\SetWidth{0.5} +\SetColor{Blue} +\Line(200,360)(270,360) +\Text(195,360)[r]{\large$e^+e^-\rightarrow\mu^+\mu^-$} +\SetColor{Red} +\DashLine(200,330)(270,330){5} +\Text(195,330)[r]{\large$e^+e^-\rightarrow\tau^+\tau^-$} +\SetColor{Black} +\Text(0,-10)[]{0} \Text(100,-10)[]{1} +\Text(200,-10)[]{2} \Text(300,-10)[]{3} +\Text(150,-25)[]{\large Beam energy in GeV} +\Text(-10,70)[]{$1$} \Text(-10,170)[]{$10$} +\Text(-10,270)[]{$10^2$} \Text(-10,370)[]{$10^3$} +\rText(-25,220)[][l]{\Large$\sigma$ in nb} +\ArrowLine(190,270)(160,300) +\ArrowLine(160,240)(190,270) +\ArrowLine(270,300)(240,270) +\ArrowLine(240,270)(270,240) +\Photon(190,270)(240,270){4}{4.5} +\Vertex(190,270){1.5} \Vertex(240,270){1.5} +\end{picture} \\ {\sl \hskip 10 pt Threshold +effects for $\mu$ and $\tau$} \end{center} +Of course one can scale these pictures further, but because the scale +factor has been used to enter the data points these should then be +adapted too. Note that when the scale is blown up by a factor 100, the +linewidth has to be scaled down or disasters will take place. + +Finally a playful example: +\IfColor{\textBlue}{} +\begin{verbatim} + \begin{center}\begin{picture}(300,56)(0,0) + \SetColor{Blue} + \Line(100,25)(150,25) + \SetColor{Green} + \Gluon(150,25)(200,25){3}{6} + \SetColor{Red} + \Photon(150,35)(200,45){3}{6} + \SetColor{Mahogany} + \ZigZag(150,15)(200,5){3}{6} + \IfColor{\COval(150,25)(20,10)(0){Black}{Yellow} + }{\GOval(150,25)(20,10)(0){0.5}} + \end{picture} \end{center} +\end{verbatim} +\IfColor{\textBlack{}}{}which results in + \begin{center}\begin{picture}(300,56)(0,0) + \SetColor{Blue} + \Line(100,25)(150,25) + \SetColor{Green} + \Gluon(150,25)(200,25){3}{6} + \SetColor{Red} + \Photon(150,35)(200,45){3}{6} + \SetColor{Mahogany} + \ZigZag(150,15)(200,5){3}{6} + \IfColor{\COval(150,25)(20,10)(0){Black}{Yellow} + }{\GOval(150,25)(20,10)(0){0.5}} + \end{picture} \end{center} + +Acknowledgement: The author wishes to thank G.J.van Oldenborgh for help +with some of the \TeX{} macros. + +Axodraw can be obtained from the authors homepage: +\IfColor{\textOliveGreen}{}{http://norma.nikhef.nl/$\sim$t68/axodraw}~ +{\IfColor{\textBlack}{}$\!\!\!\!$.} +Alternatively it is available by means of anonymous ftp from ftp.nikhef.nl. +There it is located in the directory pub/form/axodraw. Commentary and +suggestions should be sent to the author at t68\verb:@:nikhef.nl. +\end{document} |