The way I normally handle Feynman diagrams is just to include \usepackage{feynmf-auto}
and to write the whole fmffile
code int he main tex file.
However, I saw that some people manage to create a separate tex file for each graph, and to somehow produce a pdf-picture of that graph. Later they embed these pdf-pictures into the main file using includegraphics
.
My question is how to produce these standalone pdfs with feynman graphs using feynmp
?
Consider for example the following code
\documentclass[10pt]{article}
\usepackage[usenames]{color} %used for font color
\usepackage{amssymb} %maths
\usepackage{amsmath} %maths
\usepackage[utf8]{inputenc} %useful to type directly diacritic characters
\usepackage{feynmp} %Feynman diagrams
\begin{document}
\begin{align*}\begin{fmffile}{feyngraph}
\begin{fmfgraph*}(110,80)
\fmfleft{l1,l2}
\fmfright{r1}
\fmf{fermion,label=$k_1$}{l2,v1}
\fmf{fermion,label=$k_2$}{v1,l1}
\fmflabel{$j$}{l1}
\fmflabel{$i$}{l2}
\fmf{photon,label=$k_3$}{v1,r1}
\fmflabel{$b, \mu$}{r1}
\end{fmfgraph*}
\end{fmffile}
\end{align*}
\end{document}
Somehow this gets converted into a picture with only the diagram, but if I try to compile it, I get an A4 page with the graph at the bottom
Best Answer
Comments to this post helped me to come up with this template for producing standalone feynmf graphs