LaTeX macros in the new axodraw4j.sty (3 Nov. 2008)
===================================================

One of the formats of output file generated by JaxoDraw are a LaTeX
file that makes use of Jos Vermaseren's axodraw.sty package.  Another
output format is an encapsulated postscript file generated from
compiling the LaTeX file.  Axodraw.sty is a package for LaTeX that
draws Feynman graphs according to a specification in a document's
LaTeX code.  One of the advantages of this is that diagrams can
contain labels that use all the features of LaTeX.  The specification
of the diagram is quite compact and suitable for hand editing, unlike
the .xml files generated by JaxoDraw.  JaxoDraw can import LaTeX files
written in axodraw format. 

Now JaxoDraw v. 2 can make diagrams using features that go beyond
those supported by the original version of axodraw (at
http://www.ctan.org/tex-archive/graphics/axodraw/).  So we have
written a new version of axodraw to support new features that are also
useful independently of the generation of figures using JaxoDraw.  In
addition, the new version corrects some bugs in the original version
of axodraw.

Distributed with JaxoDraw v. 2 is a file called axodraw4j.sty (i.e.,
"axodraw for JaxoDraw"), and this is the package used by JaxoDraw v. 2
when an export to LaTeX is made.  The name has been changed to avoid
any backward compatibility issues with old documents that use the
original axodraw.  We plan to make a separate release of a package
named axodraw2.sty, which will be distributed on CTAN
(http://www.ctan.org/) and will be fully fully documented.  This will
be the appropriate package to use for new documents in place of the
original version of axodraw.  Generally axodraw2.sty and axodraw4j.sty
will be kept very close.

We describe here, from a user's perspective, how axodraw4j.sty differs
from the original version.  The reader unfamiliar with axodraw should
therefore also refer to the documentation for the original version, at 
http://www.ctan.org/tex-archive/graphics/axodraw/axodraw.pdf.

Changes from axodraw to axodraw4j
---------------------------------

1.  Lines (solid, dashed, photon, and gluon) can now be made double,
    with an adjustable separation.

2.  The dimensions and positions of arrows can be adjusted.

3.  Lines and dashed lines can be made from Bezier curves.

4.  Since there are now many more possibilities to specify a line,
    optional arguments to the main line drawing commands can be used
    to specify them in a keyword style.

5.  A new macro named \Arc is introduced for lines and dashed lines.

6.  For consistency the \GlueArc macro is renamed to \GluonArc, with
    the old macro retained as a synonym.

7.  Some bugs are corrected.  The most notable one is that axodraw4j
    now works correctly with revtex and revtex4.

8.  The behavior of arcs is changed when the specified opening is
    outside the natural range.

9.  The macros originally specified as \B2Text, \G2Text, and \C2Text
    are now named \BTwoText, \GTwoText, and \CTwoText.  (The intent of
    the original code was evidently to define macros with names
    \B2Text, etc.  But the rules for TeX macro names are that the
    macros are actually named \B.)


Commands
--------

The main macros for line drawing are \Arc, \Bezier, \Gluon, \GlueArc,
\Line, \Photon, and \PhotonArc.  Other varieties of these lines (e.g.,
\DashedLine) are defined in terms of these, so the use of these more
specific macros is no longer necessary.  

A typical use of the macros in a document is as follows:

   \documentclass{article}
   \usepackage{axodraw4j}
   \begin{document}
     \begin{picture}(162,39) (0,0)
       \Line[arrow,arrowlength=5,arrowwidth=2](0,19)(48,19)
       \Arc[arrow,arrowlength=5,arrowwidth=2](80,43)(40,-143.13,-36.87)
       \Line(112,19)(160,19)
       \GluonArc(80,-5)(40,37,143){3.5}{6}
     \end{picture}%
   \end{document}

In each of the following descriptions of the macros, the part enclosed
in square brackets, "[options]", is an optional argument, with the
options being specified by keywords, as explained later.  


\Line[options](x1,y1)(x2,y2)

Draws a line between the two endpoints.  By default the line is a
solid single line without an arrow.  Implemented options: all except
the arc related one, clock.


\Arc[options](x,y)(r,theta1,theta2)

Draws a line in the form of a circular arc with the given center
(x,y), radius, and starting and ending angles (given in degrees).  By
default, the arc is an anticlockwise single solid line without an
arrow.  The ending angle theta2 is adjusted modulo 360 until the
opening angle is at most 360 in the direction of the arc
(anticlockwise or clockwise).  Implemented options: all.


\Gluon[options](x1,y1)(x2,y2){amplitude}{windings}

Draws a gluon line between the two endpoints, with the given amplitude
and number of windings.  Implemented options: those for double line.


\GluonArc[options](x,y)(r,theta1,theta2){amplitude}{windings}

Draws a gluon line in the form of a circular arc with the given center
(x,y), radius, and starting and ending angles (given in degrees), with
the given amplitude and number of windings.  The ending angle is
treated as for \Arc.  By default, the arc is anticlockwise.
Implemented options: double line, clock.


\Photon[options](x1,y1)(x2,y2){amplitude}{windings}

Draws a photon line between the two endpoints, with the given
amplitude and number of windings. Implemented options: those for double
line.


\PhotonArc[options](x,y)(r,theta1,theta2){amplitude}{windings}

Draws a photon line in the form of a circular arc with the given
center (x,y), radius, and starting and ending angles (given in
degrees), with the given amplitude and number of windings.  The ending
angle is treated as for \Arc.  By default, the arc is
anticlockwise. Implemented options: those for double line.


\Bezier[options](x1,y1)(x2,y2)(x3,y3)(x4,y4)

Draws a Bezier line with the given control points.  Implemented
options: those for dashed line.





The allowed options are as follows.  Note that not all commands
implement all options. 

        arrowinset=..., inset of tail arrow relative to arrow length
                   (A value of 0 gives a triangular arrow, and a value
                   of 1 gives an arrow just consisting of two lines.)
        arrowwidth=..., (half) width of arrow.  
                If no height set, set it from 1.25 aspect ratio (h/tot.w)
        arrowlength=..., height of arrow.  
                If no width set, set it from 1.25 aspect ratio (h/tot.w)
        arrowpos=..., fractional position of arrow along line.
                Defaults to 0.5, i.e., center.
        arrow   turns on arrow
        arrow=true, arrow=false:     Arrow on or off.
        Similarly for clockwise, dash, double, and flip:
        dash    turns on dashing
        double  turns on double line
        clock   makes arc clockwise
        flip    flips arrow relative to direction of line
        dsize=... or dashsize=..., size of dashes for dashed line
        linesep=... or sep=..., separation of lines in double line

The boolean options default to true.  E.g., arrow is equivalent to
arrow=true. 

Defaults, before the options are parsed:

     arrow, clock, dashing, double are all off
     arrowpos = 0.5
     arrow dimensions are a default size
         Single line: arrowwidth = 1.2 * (2+linewidth)
         Double line: arrowwidth = 1.2 * (2+0.7*linesep+linewidth)
         In both cases:
                      arrowlength = 2.5 * (half)width
                      arrowinset       = 0.2
     dashsize = 3
     linesep (for double line) = 2 (which is treated as the separation
                                of the center line of the two
                                component single-lines). 


Macros are available for setting certain parameters without the need
to specify them in individual line commands.  In each of the
descriptions below, "num" represents a number

\SetArrowScale{num}  
   Sets the scale of an arrow relative to the default.  This is used
   on a line with an arrow when the dimensions are not otherwise
   specified. Its value is initialized to 1.

\SetArrowInset{num} 
   Sets the inset of the tail of an arrow relative to its length.
   This is used on a line with an arrow when the arrowinset is not
   explicitly specified.  Its value is initialized to 0.2.

\SetArrowAspect{num}
   Sets the default aspect ratio of arrows; this is the ratio of the
   length of an arrow to its full width.  This is used in arrows when
   no dimensions are specified or when only one of the length and
   width are specified.  Its value is initialized to 1.25.

\SetArrowPosition{num}
   Sets the default fractional position of arrows along a line: 0 is
   at the start, 1 is at the end, 0.5 is at the center.  This is used
   on a line with an arrow when the arrowpos option is not used.  Its
   value is initialized to 0.5. 
