You can draw Feynman diagrams using LaTeXiT. This is an easy way to put diagrams in Keynote slides, etc..
You need to have the following items installed.
![[LaTeXiT Configuration pane]](img/latexit_feynmp_config.jpg)
\usepackage{feynmp}
in the preamble. Write the feynmf/feynmp source code in the usual editing area underneath.
You can copy and paste from here, too.
\begin{fmffile}{feyngraph}
\begin{fmfgraph}(110,60)
\fmfleft{i1,i2}
\fmfright{o1,o2}
\fmf{fermion}{i1,v1,o1}
\fmf{fermion}{i2,v2,o2}
\fmf{photon}{v1,v2}
\end{fmfgraph}
\end{fmffile}
Make sure you start with
\begin{fmffile}{feyngraph}
because "feyngraph" is the file name you specified in the middle-processing script for "feynmp" configuration.
(You can use this same name for different diagrams, since it is just a
temporary file name.)
#first, extract all fmffiles of the input text file
FMFFILES=`cat "${INPUTTEXFILE}" | grep "begin{fmffile}" | sed "s/.*\\begin{fmffile}{\([^}]*\)}/\1/g"`
#run mpost for each fmffile
for i in ${FMFFILES}; do
mpost $i
done
#re-run latex now that mpost has been run
latex ${INPUTTEXFILE}
dvipdf ${OUTPUTDVIFILE}
Updated 2013-12-09, Taku Yamanaka