feynMF - Drawing Feynman Diagram
feynMFis a tool made by Thorsten Ohl to draw Feynman diagrams in LaTeX.
There are three parts of official tutorials on feynMF:
Part 1,
Part 2 and
Part 3.
I have also written several examples.
A more comprehensive and pedagogical manual comes with the package
that you will download next.
How to install feynMF
- Download the entire directory of feynmf stuffs from
CTAN site.
Not all the sites have feynmf, but one of the sites which has fynmf is
ftp.dante.de.
- Expand the downloaded feynmf.tar.gz if necessary.
- From Terminal, go into the feynmf directory, and type
% make
- Next, copy 4 files into specific directories.
If you are the only person who uses feynmf,
you can copy them under your home directory.
% mkdir -p ~/texmf/tex/feynmf
% mkdir -p ~/texmf/metafont/feynmf
% mkdir -p ~/texmf/metapost/feynmf
% cp feynmf.sty ~/texmf/tex/feynmf
% cp feynmp.sty ~/texmf/tex/feynmf
% cp feynmf.mf ~/texmf/metafont/feynmf
% cp feynmp.mp ~/texmf/metapost/feynmf
% mktexlsr
How to use feynMF
- Try running template.tex, by following the 3 commands shown
at the beginning of the file. This should create template.dvi
which has a simple diagram.
- mf command should be run from Terminal, but latex can be
run from TeXShop by hitting "Typeset" button as usual.
- Read manual.ps in the downloaded package for instructions.
- For each diagram, you should give a file name (without extension) as an argument for fmffile, such as:
\begin{fmffile}{tree1}
....
\end{fmffile}
\begin{fmffile}{penguin1}
....
\end{fmffile}
- Typeset once to make mf files. For each diagram, you will get
a mf file with extension, '.mf', such as
tree1.mf and penguin1.mf .
- For diagrams which contain lables on particles or vertices,
run mf such as:
% mf '\mode:=localfont;' input tree1
% mf '\mode:=localfont;' input penguin1
This makes several files, such as:
tree1.600gf, tree1.600pk, tree1.log, tree1.tfm, etc..
- For diagrams which do not contain labels on particles or vertices,
you do not have to run mf command.
- Typeset again to load the created metafont showing diagrams.
- If you edit a diagram, make sure that you at least delete
the corresponding
".600pk" file before running mf.
Otherwise, the diagram will not be updated
- Do not put space characters between vertecies.
You should write like
\fmfleft{v1,v2,v3}
, and not like
\fmfleft{v1, v2, v3}
.
Otherwise, you will get get a message like:
feynmf: warning: dangling vertex `v1' colliding with `v2'.
feynmf: Have you seen the warning messages above?
when you run mf.
More examples
Here are more samples (PDF),
and a LaTeX source code
fmfsamples.tex.tar which was used to create
the samples.
It starts from basic examples, and then describes several tips to
create common diagrams.
June 8, 2004, Taku Yamanaka