JaxoDraw axodraw2 (LaTeX) Plugin
A JaxoDraw plugin to export graphs to LaTeX files that use the axodraw2 style file to generate graphics with Feynman diagrams.
Go to the Downloads page to get the latest version of the plugin.
For installation instructions, see the Install page.
Documentation
Documentation on axodraw2
is available at
arXiv.org and
ctan.org.
It is also provided by the axodraw2
package
in both of the main TeX distributions,
TeXLive and
MiKTeX.
Text modes
- Postscript text mode
- Any Postscript text present in the graph will be ignored by this plugin (a warning message is displayed if a latex->dvips export/preview is attempted with some Postscript text present in the graph).
- LaTeX text mode
-
In LaTeX text mode, the user may enter a text string that will appear
only in the LaTeX output file and any files created from it via
latex
. Like that all the commands known to LaTeX in math mode are available to the user. If the text is rolled over by the cursor, the corresponding LaTeX text is displayed in a pop-up window on top of the canvas. Note that the LaTeX text string will automatically be put between $ signs, so the text will always be in LaTeX math mode. If you want a normal font in LaTeX text mode, you should use->
dvips{\rm }
. Note also that your input here is the only possible source of errors in your LaTeX source code. If you get any LaTeX compilation errors, check your LaTeX text objects first. In edit mode, the user may choose the LaTeX font size and the alignment with respect to the current position of the text object. You can also specify rotation angles for LaTeX texts (rotations are implemented using the LaTeXpstricks
package).
Importing LaTeX files
This JaxoDraw plugin allows to import existing LaTeX files, even if they were not originally created by JaxoDraw. However, only commands that are known to JaxoDraw are actually recognized (that are commands that are used when exporting to a LaTeX file), unknown commands will be silently ignored. The commands known to JaxoDraw are:
\ArrowArc
|
\ArrowArcn
|
\ArrowLine
|
\CArc
|
\CBox
|
\CCirc
|
\COval
|
\CTri
|
\DashArrowArc
|
\DashArrowArcn
|
\DashArrowLine
|
\DashCArc
|
\DashLine
|
\GBox
|
\GCirc
|
\GlueArc
|
\Gluon
|
\GOval
|
\GTri
|
\Line
|
\PhotonArc
|
\Photon
|
\SetColor
|
\SetWidth
|
\Text
|
\usepackage
|
\Vertex
|
\ZigZag
|
(see the axodraw
user guide for
documentation on these commands [3]).
In addition, the following LaTeX commands are required:
\documentclass
|
\begin{document}
|
\begin{picture}
|
If these ones are not found in the file to be imported, the import process is abandoned with a warning message.
Due to the specific algorithm internally used by JaxoDraw to draw
triangles, the commands \GTri
and \CTri
will work only when the
imported LaTeX file has been generated from JaxoDraw itself.
Otherwise they will be ignored. Moreover, because of rounding errors in the
export/import routines, sometimes the imported graphs may be slightly
different from the original ones (possible differences being the number of
wiggles/windings of photon/gluon objects and the position of objects).
These differences are usually of one unit.
Lines that start with %%\JaxoComment
will be read in as a
description of the graph while lines of the form
%%\JaxoScale{scale}
allow to read in a floating point value
scale factor which is used internally by JaxoDraw to
convert Java coordinates into LaTeX coordinates. If it is not given,
the scale factor defaults to 1. Finally lines of the form
%%\JaxoDrawID:
are identifiers used by
JaxoDraw to reconstruct some objects.
Known problems
If a LaTeX text object is present at the edge of a graph then
the bounding box of a "LaTeX -> EPS
"
export is most probably not
correct. This manifests itself by a "broken" text, i.e., a thin white
line is crossing the text. Basically, there is no way for us to
estimate the extension of a text after latex compilation,
so the only workaround is to adjust the bounding box by hand.
Tips and tricks
-
Note that Postscript files produced by
Export - EPS
are considerably larger in size than the same files generated vialatex -> dvips
. This is due to the way how Java handles the Postscript printing internally. Keep this in mind if you want to include a bunch of small figures in your document: it is then probably preferable to use the LaTeX output. -
Instead of producing EPS figures and including them into your document,
you may as well cut-and-paste the LaTeX output of JaxoDraw into
your own LaTeX source code. Like that you may avoid the proliferation
of numerous Postscript files to be distributed with your source code.
Note however that you will have to include axodraw2 in the header of
your LaTeX file
(put
\usepackage{axodraw2}
somewhere before\begin{document}
) and you will probably have to distribute theaxodraw2.sty
file along with your source code because it is not part of any standard LaTeX distribution.
History
The 1.x series of JaxoDraw used the original axodraw latex package written by Jos Vermaseren to generate Feynamn diagrams. The naming of JaxoDraw is a reminiscent of this origin.
In the 2.x series of JaxoDraw, the axodraw
style file was replaced
with axodraw2.sty
(i.e. axodraw for Java).
It was based on axodraw
and was written mainly by John Collins
specifically for the JaxoDraw project.
The name has been changed to avoid any backward compatibility issues with old
documents that use the original axodraw.sty
.
In both the 1.x and 2.x series of JaxoDraw the LaTeX export/import
functionality was integrated into the main program.
With the release 3.0 of JaxoDraw the
JLaTeXMath library
was used as the underlying LaTeX engine. The axodraw2
-specific part of the
code was instead pulled out into this plugin, so the the original functionality
is still available to JaxoDraw users.