# Drawing Feynman diagrams with Feynmf

1. Apr 25, 2007

### nrqed

I have posted a question on the Tutorial subforum because there was already a thread on that subject but I figured that people here may be more likely to be able to help me out

Thanks!

Patrick

2. Apr 25, 2007

### Hans de Vries

I've got the JaxoDraw visual Feynman diagram editor working with MiKTeX and WinEdt.
http://jaxodraw.sourceforge.net/

It takes a lot of patience and about half a day. I should have taken notes during the process..
People going through the process could leave their step-by-step notes here to help others!!

Some things I remember:

2) Google for stuff you seem to be missing during the process.

3) You need to download JAVA stuff from sun.com. make sure it's the
developers environment needed compile things.

4) Use the Cygwin setup program to add a handfull of extra packets needed.

5) You can start "setup.exe" by clicking on a link on the main page of cygwin.com.

6) I needed several utilities just to compile. I had to google for them and install them.

7) You need the axodraw.sty file in the latex directory

8) With WinEdt I needed an alternative way to produce pdf files:
a) LATeX the tex file
b) do a: dvi->ps
c) finally do a: ps -> pdf
otherwise it complains it can not do "Postscript specials". It will generate
the pdf normally but the Feynman diagrams are missing.

I think a had a case of a missing file in the Java environment which
I found in another directory. I found it rather quick though.

Regards, Hans.

Last edited: Apr 25, 2007
3. Apr 25, 2007

### nrqed

Wow.
Thank you very much for all the information. That sounds like quite an adventure. I will try this if I can't figure out Feynmf . I am using TeXnicCenter to latex stuff, I guess things should work the same way as fo ryou.

A quick question: you used Cygwin to download packages, but are you running things within Cygwin? (If I reclal, Cygwin is a Unix emulator running under Windows, right?) Are you running MikTeX under Cygwin? (I hope my questions make some sense)

Thank you very much for taking the time to post all that information!

Patrick

4. Apr 25, 2007

### Hans de Vries

I couldn't get Feynmf working either....

I run WinEdt and JaxoDraw under windows.

JaxoDraw is a Java application and you can download the Java compiler

Yes,

Many developers use Cygwin and gcc to and you need it to compile tools all
the time. MiKTeX is one of them. I'm hoping I'm not confusing things here.
it has been a while ago and I installed several other packets in the mean
time. You can start with compiling Jaxodraw with Java and see what you
need further.

I use Cygwin gcc for c programs and I use the GNU GSL library for the
complete list of mathematical functions. In results from Feynman diagrams
you'll find functions like the Rieman Zeta function and the Poly Logarithm
(Di-Logarithm) You'll find all of these and much more in the GSL library.

Cygwin is rather easy to install and you can add/remove all kinds of
packets (including the GSL library) very conveniently with "setup.exe"
at the main page of cygwin.com. This program also shows you exactly
what you have and haven't installed.

http://www.cygwin.com/
http://www.gnu.org/software/gsl/
http://functions.wolfram.com/

http://www.miktex.org/
http://www.winedt.com/
http://jaxodraw.sourceforge.net/
http://www.nikhef.nl/~t68/axodraw/

Regards, Hans

5. Apr 25, 2007

### Hans de Vries

Hmm,

It seems there is a precompiled version of Jaxodraw now for Windows:

Better try this first then!

Regards, Hans

6. Apr 25, 2007

### humanino

I am quite surprised. Under Linux I never had any problem.

Many experimentalists use ROOT software, which is able to produce Feynman diagrams in an interactive manner, after which you can produce the code which is very similar to LaTeX actually.

Most theoreticians use JaxoDraw to draw Feynman diagrams. It also works interactively. Although I am by no way fan of WYSIWYG, I must admit that this interactivity feature is a strength in that case. But only to learn how to write the code. When one write that kind of code often, one find its more convenient to switch back to batch mode.

7. Apr 25, 2007

### nrqed

Thank you for all your help! I will check this out!

I am afraid to show my deep ignorance, but what is WinEdt? WHat is it used for?

8. Apr 25, 2007

### Hans de Vries

WinEdt is the shareware Latex editor I use:

http://www.winedt.com/

Latex is the main target but you can edit other file types as well.

http://www.winedt.com/snap.html

Regard, Hans

9. Apr 26, 2007

### nrqed

Thanks again for the help.

I installed the precompiled version and it works....up to a point. I can draw things and save in postscript format (and then look at the result using ghostview). But when I ask to save as an eps file (in order to then put it inside a Latex file), it does not work. jaxodraw saves the file but as a postscript file, not an eps file.

I have tried to save as a Latex file, but then when I tried to compile it looks for a xcolor.sty file which I tried to install but I could not unzip :rofl: You know how problems are with computers...one things leads to another to another ....

ANyway, I wanted to know how you include your Feynman diagrams in your TeX files: you save as eps or you use the TeX code with the axodraw.sty package?

Thanks again

Patrick

10. Apr 26, 2007

### Hans de Vries

I do an export (File menu) to Latex and copy and past the result in my Latex
files. This makes your document a single file which is easier and you can still
edit things like the TeX labels.

Regards, Hans

11. Apr 26, 2007

### nrqed

Ok. Thank you. You load the package axodraw.sty and xcolor.sty?

Thanks a lot, your help is very much appreciated.

12. Apr 26, 2007

### Hans de Vries

I've got these near the top of my Latex files:

Code (Text):
\usepackage{axodraw}
%\usepackage{pstricks}
\usepackage{color}
And I paste the Latex export output from Jaxodraw in the document.

I've got only axodraw.sty in my Latex directory.
http://www.nikhef.nl/~t68/axodraw/

If I comment out "color" then it doesn't work. pstricks.sty must
be somewhere in the MiKTeX distribution. It doesn't matter if
I comment it out here.

I found an explanation here about pstricks:

http://www.ursoswald.ch/LaTeXGraphics/overview/overview.html

which shows why I need to do the conversion in three steps to get the
Feynman diagrams included in the pdf. The direct conversion leaves them out.

Tex --> DVI --> PS --> PDF

The direct conversion omits the Feynman diagrams. see figure 1.
I don't care much about the three steps because they are just three
clicks on buttons close to each other in my editor. see here:
http://www.winedt.com/snap.html (LaTeX, dvi-->ps, ps-->pdf)
Mostly I use the direct conversion. When I'm editing formulas I

I prefer to do it this way but you can also try to let Jaxodraw export JPG
or PNG pictures instead of LaTeX code and include the picture like this:

Code (Text):
\begin{figure}[h]
\scalebox{1.0}{\includegraphics{my_picture.jpg}}
\caption{my_picture_text}
\label{fig:my_picure_label}
\end{figure}

Regards, Hans

Last edited: Apr 26, 2007
13. Apr 27, 2007

### AlphaNumeric

1) When compiling your .tex file into .pdf and you've got FeynMF pictures, compile it twice. I've found on both Linux and Windows that compiliing it once results in all the diagrams becoming giant capital Greek deltas, $$\Delta$$ (oh the joys of anomalous bugs!), in a similar thing to the way the contents page is often blank when you recompile, unless you compile twice.

2) The labels on FeynMF are awful. I know how to code in elaborate diagrams, with lovely loops and wiggles etc but when I put in labels, they appear at random places all over the diagram! I can't actually label particles! If anyone knows of a way around this, could they enlighten me please? I much prefer the diagrams of FeynMF over Jaxodraw and the code for FeynMF is nicer, but for the labels!!!

I'd recommend the LEd tex editing program for Windows. It does predictive text.

14. Apr 27, 2007

### nrqed

That worked!!!:tongue2:
Thank you

(for anybody else interested:

I had to include the line \usepackage{graphicx} at the top of my file

And to center, one may put the line \centering just after the line \begin{figure}
}

Thank you very much for all the help.

I still wnat to include the graphics latex code directly but I will have to figure out how to install the xcolor package and pstricks (I am using TeXnicCenter for which those packages are not provided )

15. Apr 27, 2007

### nrqed

A simple question: I draw fermions lines along the shape of arc of circles. No matter what i do, the arrows is always shown pointing counterclockwise. I sthere any trick to reverse its direction? (not in the latex code itself since I am saving as a jpg but while drawing the diagram itself on the screen)

Thank you!

16. Apr 28, 2007

### Hans de Vries

Not that I've seen. You can change line thickness and the arrow size but not
the direction of the arrow here:

Options ---> preferences ---> behavior ---> Objects.

For loops it doesn't matter. The arcs used most are the photon and gluon
which do not have an arrow. Maybe there's a way buy I didn't find it.

Regards, Hans.

17. Apr 28, 2007

### nrqed

Ok, Thank you again for your help. I needed to set the direction because I am trying to draw a diagram showing the contour used for a contour integral but I can't get the arrows in the arcs to point where I want them to point.

A related question: is it possible to add arrows to the gluon and photon lines ? That would be useful to indicate the flow of four-momentum.