[Tex/LaTex] Feynmp / metapost – labels not working

feynmanfeynmfmetapost

I am trying to draw a simple Feynman diagram with FeynMP. I use the following code to generate by .mp file – note I use the fmfgraphs environment.

\documentclass{article}
\usepackage{feynmp}
\begin{document}
    \unitlength = 1mm
    \begin{fmffile}{PandS6214}
        \begin{fmfgraph*}(40,30)
           \fmfleft{i1,i2}
           \fmfright{o1}
           \fmf{fermion, tension = 1}{i1,d1,v1}
           \fmf{fermion, tension = 1}{v1,d2,i2}
           \fmflabel{i1}{i1}
           \fmflabel{i2}{i2}
           \fmflabel{o1}{o1}
           \fmf{photon}{v1,o1}
           \fmffreeze
          \fmf{dashes}{d1,d2}
          \fmfdot{v1}
        \end{fmfgraph*}
    \end{fmffile}
\end{document}

And when I run TexStudio I get the following .mp file

% PandS6213.mp -- do not edit, generated automatically by feyneg.tex
input feynmp
require_RCS_revision "1.30";
beginchar(1, 40*2.84526pt#, 30*2.84526pt#, 0);
"feynmf: 1";
LaTeX_unitlength:=2.84526pt;
subgraph (0, 0, w, h);
vinit;
pickup pencircle scaled thin;
vleft (__i1, __i2);
vright (__o1);
vconnect ("fermion, tension = 1", __i1, __d1, __v1);
vconnect ("fermion, tension = 1", __v1, __d2, __i2);
vlabel ("i1", __i1);
vlabel ("i2", __i2);
vlabel ("o1", __o1);
vconnect ("photon", __v1, __o1);
vfreeze;
vconnect ("dashes", __d1, __d2);
vdot (__v1);
vfreeze;
vdraw;
endsubgraph;
endchar;
% the end.
end.
endinput;

I copy and paste this code in Troy Henderson's Metapost previewer: http://www.tlhiv.org/mppreview/ and the diagram shows up perfectly but the labels do not!

I compiled the tex code with TexStudio for Windows … pls let me know what I am doing wrong!

John

Best Answer

The MP file you get doesn't generate the labels, which are stored in the .t1 file connected to the picture. When feynmp includes the image, it will also place the labels getting their positions from the data in the .t1 file. So the Metapost previewer can't show them, because they aren't part of the generated picture and are added only on the LaTeX side.

Related Question