\begin{abstract}
\LPack{pst-feyn} is a set of drawing graphical elements which are used for Feynman diagrams.
Simple flow charts and other graphics are possible, too. The package is based on the
macros of the old package \LPack{axodraw} from John Collins and Jos Vermaseren (\cite{axodraw2}), but uses the
capabilities of PSTricks (\cite{PSTricks2,PSTricksE}).
\vfill\noindent
Thanks for feedback and contributions to:\\
\end{abstract}
\clearpage
\section{Using pst-feyn}
The commands of \LPack{pst-feyn} should be executed inside either the \Lenv{pspicture}
environment. Inside this environment it is possible to place objects
at arbitrary positions and put text between them. An example would be
The syntax and the meaning of these command are explained in the next
section. One should note that all coordinates are presented in the current
user units, which is by default 1cm.
It is possible to use scale
transformations if these units are not convenient.
\section{The commands}
The commands that are currently available in \LPack{pst-feyn} are (in alphabetic
order):
Draws an arc segment centered around $(x,y)$. The radius can be set by the optional argument \Lkeyword{radius}
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.
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)$.
\subsection*{\Lcs{psBText}\OptArgs\Largr{$x,y$}\Largb{text}}
Draws a box with one line of text in it. 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.
\begin{LTXexample}[width=5cm]
\begin{pspicture}[showgrid](-0.4,-0.4)(4,4.2)
\psBText[linecolor=blue](2,3.5){A short line}
\psBText[linecolor=red](2,1.5){%
A short line\\ and another one \\a.s.o.}
\end{pspicture}
\end{LTXexample}
Draws an arc segment centered around $(x,y)$. The radius is set by the optional argument \Lkeyword{radius}. The
arc-segment runs counterclockwise from $\phi_1$ to $\phi_2$. The star version (\Lcs{psCArc*}) creates a filled arc.
\subsection*{\Lcs{psCCirc}\Largr{$x,y$}\Largb{radius}\Largb{color1}\Largb{color2}}
Draws a circle around $(x,y)$. 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. It is the same as\\
\verb|\pscircle[linecolor=color1,fillstyle=solid,fillcolor=color2](x,y){radius}|
\subsection*{\Lcs{psCText}\OptArgs\Largr{$x,y$}\Largb{col1}\Largb{col2}\Largb{text}}
Draws a box with test in it. The
box is just big enough to fit around the text. 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.
\begin{LTXexample}[width=5cm]
\begin{pspicture}[showgrid](-0.4,-0.4)(4,4.2)
\psCText(2,3.5){red}{cyan}{A short line}
\psCText(2,1.5){green}{yellow}{%
A short line\\ and another one \\a.s.o.}
\end{pspicture}
\end{LTXexample}
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'. 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.
\subsection*{\Lcs{psGluon}\Largr{$x_1,y_1$}\Largr{$x_2,y_2$}}
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'. If the number of windings is not an integer
it will be rounded. The side at which the
windings lie is determined by the order of the two coordinates. Also
a negative amplitude can change this side.
\subsection*{\Lcs{psPhoton}\Largr{$x_1,y_1$}\Largr{$x_2,y_2$}}
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.
\subsection*{\Lcs{psPhotonArc}\Largr{$x,y$}\Largr{$\phi_1,\phi_2$}}
Draws a photon on an arc-segment. The center of the arc is $(x,y)$. 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.
\subsection*{\Lcs{psPText}\OptArg{mode}\Largr{$x,y$}\Largr{$\phi$}\Largb{text}}
The focal point of the text box is $(x,y)$. 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 command is the same as\\
\verb|\rput[mode]{phi}(x,y){\shortstack{#4}}|
\begin{LTXexample}[width=5cm]
\begin{pspicture}[showgrid](-0.4,-0.4)(4,4.2)
\psPText(2,3.5)(0){A short line}
\psPText[lb](3,0)(90){%
A short line\\ and another one \\a.s.o.}
\end{pspicture}
\end{LTXexample}
\subsection*{\Lcs{psText}\OptArg{mode}\Largr{$x,y$}\Largb{text}}
Same as \Lcs{rput}.
\subsection*{\Lcs{psZigZag}\Largr{$x_1,y_1$}\Largr{$x_2,y_2$}}
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.
\iffalse
\begin{itemize}
\item \Lcs{psLinAxis}($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 \Lcs{psLogAxis}($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.
\end{itemize}
\fi
A note about color. The names of the colors can be found in the documentation
of package \LPack{xcolor}.
This package gives also the commands that allow the user to change the color of the text.
It is loaded by default with PSTricks.
\section{Examples}
\subsection{Text modes}
The meaning of the mode characters in the text commands can best be
demonstrated. The statements
produce 9 texts and for each the focal point is indicated by a little
circle. It looks like
This illustrates exactly all the combinations of the mode characters and
what their effects are. The text is
insensitive to the scaling commands, and the color of the text should be
set with the regular color commands. In the case of \LaTeX{} text
it can of course contain different fonts,
math mode and all those little things.
\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 pst-feyn 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:
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:
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:
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 to 0.5cm and at the same time reducing the number
of windings from 6 to 3 for the straight gluons and from 8 to 7 for the
gluons in the arcs gives
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:
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:
\LPack{pst-feyn} is a PSTricks related package and can use all commands by one of
the nearly``endless'' PSTricks packages.
An example of a complete picture would be:
%\begin{LTXexample}[pos=t]
\psset{unit=1pt}
\begin{pspicture}(-30,-30)(360,440)
\psLinAxis(0,0)(300,0)(3,10,5,0)\psLinAxis(0,400)(300,400)(3,10,-5,0)
\psLogAxis(0,0)(0,400)(4,-5,2) \psLogAxis(300,0)(300,400)(4,5,2)
\readdata\DataA{data/data0.dat} \readdata\DataB{data/data1.dat}
\listplot[plotstyle=curve,linecolor=Blue,linewidth=1.5pt,unit=100,curvature=.5 2 0]{\DataA}
\listplot[plotstyle=curve,linecolor=Red,linewidth=1.5pt,linestyle=dashed,unit=100,
curvature=.5 2 0]{\DataB}
\psline[linecolor=Blue](200,360)(270,360)
\rput[r](195,360){\blue\large$e^+e^-\rightarrow\mu^+\mu^-$}
\psline[linestyle=dashed,linecolor=Red](200,330)(270,330)
\rput[r](195,330){\red\large$e^+e^-\rightarrow\tau^+\tau^-$}
\rput(0,-10){0} \rput(100,-10){1}\rput(200,-10){2}\rput(300,-10){3}
\rput(150,-25){Beam energy in GeV (Threshold effects for $\mu$ and $\tau$)}
\rput(-10,70){$1$} \rput(-10,170){$10$}\rput(-10,270){$10^2$}\rput(-10,370){$10^3$}
\rput{90}(-25,220){\large$\sigma$ in nb}
\psArrowLine(190,270)(160,300) \psArrowLine(160,240)(190,270)
\psArrowLine(270,300)(240,270) \psArrowLine(240,270)(270,240)
\psPhoton[windings=4.5,amplitude=4](190,270)(240,270)
\psdot(190,270) \psdot(240,270)
\end{pspicture}
%\end{LTXexample}
\begin{lstlisting}
\psset{unit=1pt}
\begin{pspicture}(-30,-30)(360,440)
\psLinAxis(0,0)(300,0)(3,10,5,0)\psLinAxis(0,400)(300,400)(3,10,-5,0)
\psLogAxis(0,0)(0,400)(4,-5,2) \psLogAxis(300,0)(300,400)(4,5,2)
\readdata\DataA{data/data0.dat} \readdata\DataB{data/data1.dat}
\listplot[plotstyle=curve,linecolor=Blue,linewidth=1pt,unit=100,curvature=.5 2 0]{\DataA}
\listplot[plotstyle=curve,linecolor=Red,linewidth=1.5pt,linestyle=dashed,unit=100,
curvature=.5 2 0]{\DataB}
\psline[linecolor=Blue](200,360)(270,360)
\rput[r](195,360){\blue\large$e^+e^-\rightarrow\mu^+\mu^-$}
\psline[linestyle=dashed,linecolor=Red](200,330)(270,330)
\rput[r](195,330){\red\large$e^+e^-\rightarrow\tau^+\tau^-$}
\rput(0,-10){0} \rput(100,-10){1}\rput(200,-10){2}\rput(300,-10){3}
\rput(150,-25){Beam energy in GeV (Threshold effects for $\mu$ and $\tau$)}
\rput(-10,70){$1$} \rput(-10,170){$10$}\rput(-10,270){$10^2$}\rput(-10,370){$10^3$}
\rput{90}(-25,220){\large$\sigma$ in nb}
\psArrowLine(190,270)(160,300) \psArrowLine(160,240)(190,270)
\psArrowLine(270,300)(240,270) \psArrowLine(240,270)(270,240)
\psPhoton[windings=4.5,amplitude=4](190,270)(240,270)
\psdot(190,270) \psdot(240,270)
\end{pspicture}
\end{lstlisting}
There are several commands for creating boxes with text in them. The rest
is just a matter of drawing lines and circle segments with arrows. It might describe
a system for the automatic computation of cross-sections: