Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
    
Do you get the labels in your document? If so, this is a problem in the online Metapost previewer. –  egreg Jan 21 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 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 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 at 10:36

1 Answer 1

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.

share|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 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 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 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 at 18:17
    
Okay - thanks. That is WELL beyond my capability! –  JohnB Jan 22 at 7:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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