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.

    \unitlength = 1mm
           \fmf{fermion, tension = 1}{i1,d1,v1}
           \fmf{fermion, tension = 1}{v1,d2,i2}

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";
subgraph (0, 0, w, h);
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);
vconnect ("dashes", __d1, __d2);
vdot (__v1);
% the end.

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!


  • Do you get the labels in your document? If so, this is a problem in the online Metapost previewer. – egreg Jan 21 '14 at 8:40
  • I used TexStudio to compile the Metapost and then run GSView to view the .ps file, with Ghostview. I get the same output as with the previewer – JohnB Jan 21 '14 at 9:34
  • If I do latex+mpost+latex+dvips+ps2pdf or pdflatex+mpost+pdflatex I get the labels (I'm not on Windows, though). – egreg Jan 21 '14 at 9:50
  • Hmm - interestingly on TexStudio there are two files it gives me after I run MetaPost. I get a *.1 file and a *.t1. The *.t1 file contains the labels. However, I can't seem to compile both of them together to get the labels and diagrams to show. Either way I would expect that the Previewer would display the lables as it comes direct from Metapost .... – JohnB Jan 21 '14 at 10:36

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.

| improve this answer | |
  • Got it - makes sense. Is there a way I can include them in .1 file or will this outcome always be the case. As an aside I did: latex+mpost+latex+dvips+psview to get the image in TexStudio and it worked ... – JohnB Jan 21 '14 at 13:49
  • @JohnB I don't think so; it's the way feynmp chose in order to have matching fonts in the diagrams with the text fonts. – egreg Jan 21 '14 at 14:18
  • Just another thought -- in the mp file the labels are included. See the vlabel ... code ...i.e., the labels are generated from running mpost, creating the .1 .t1 files -- in those it makes sense the labels are separate. However, in the .mp file the labels seem to be there. – JohnB Jan 21 '14 at 17:51
  • I think they're used just to get the coordinates that are written in the .t1 file. Maybe one can redefine vlabel to add the label to the Postscript output. Do you want to try? ;-) – egreg Jan 21 '14 at 18:17
  • Okay - thanks. That is WELL beyond my capability! – JohnB Jan 22 '14 at 7:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.