Background
When labels are shown with feynmp, they extend beyond the box of the graph. One can use \fmfframe to allocate an invisible frame to accommodate these, but it seems like you need to manually adjust all of the parameters.
Question
Is there an easy way of automatically placing ones Feynman graphs in an appropriate frame?
Specifically, I would like to be able to use graphs naturally in equations with minimal manual intervention. The following example works, but has the following issues:
- I use
\raisebox{-0.5\height}{}to vertically center the graph, but this does not quite work properly. How do I fix this? One can use
\fmfframe(<left>,<top>)(<right>,<bottom>){}to "pad" the graph, but the only way I can see to get these values is to manually adjust (using a frame with\fboxso I can see what I am doing).Note: All the numbers in
()are in terms of the\unitlengthdefined byfeynmp(default is1pt).- One ugly "feature" of
\fmfframeis that is precludes blank lines in its argument (which can be useful for spacing out one's graph definitions). Any easy fix?
Here is a minimal working example:
\documentclass{minimal}
\usepackage{feynmp}
% Needed to interpret generated *.1, *.2 etc. as ps files.
\DeclareGraphicsRule{*}{mps}{*}{}
\setlength{\fboxsep}{0pt}
\begin{document}
\begin{fmffile}{fgraphs}
\begin{equation}
5\times
\raisebox{-0.5\height}{ % 1: center vertically -- does not quite work.
\fbox{ % Draw fram so we can tweak the fmfframe
\fmfframe(5,17)(20,17){ % 2: Had to manually guess these.
\begin{fmfgraph*}(40,30)
% Note that the size is given in normal parentheses
% instead of curly brackets in units of \unitlength
% (1pt by default)
\fmfleft{i1,i2} % Define external vertices from bottom to top
\fmfright{o1,o2}
\fmf{fermion}{i1,v1,o1}
\fmf{fermion}{i2,v2,o2}
\fmf{photon,tension=0.3}{v1,v2}
% 3: Blank lines not allowed in fmfframe!
\fmflabel{$\vec{p}$}{i1}
\fmflabel{$\vec{q}$}{i2}
\fmflabel{$\vec{p}+\vec{k}$}{o1}
\fmflabel{$\vec{p}-\vec{k}$}{o2}
\end{fmfgraph*}
}
}
}
= 5i V_k.
\end{equation}
\end{fmffile}
\end{document}
Compile this with:
pdflatex tst
mpost fgraphs
pdflatex tst
pdflatex tst
to get:


