TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to draw a feynman diagram using feynmf in TXC. I use the following code

    \unitlength = 1mm
    % determine the unit for the size of diagram.
    ... here comes an example with feynmf
     \begin{fmffile}{one}   %one.mf will be created for this feynman diagram  
       \fmfframe(1,7)(1,7){     %Sets dimension of Diagram
       \begin{fmfgraph*}(110,62) %Sets size of Diagram
        \fmfleft{i1,i2} %Sets there to be 2 sources 
        \fmfright{o1,o2}    %Sets there to be 2  outputs
        \fmflabel{$e^-$}{i1} %Labels one of the left sources
        \fmflabel{$e^+$}{i2} %Labels one of the left sources
        \fmflabel{${\ensuremath{\erlpm}}$}{o1} %Labels one of the right outputs
        \fmflabel{${\ensuremath{\erlpm}}$}{o2} %Labels one of the right outputs
        \fmf{fermion}{i1,v1,i2} %Connects the sources with a vertex.
        \fmf{fermion}{o1,v2,o2} %Connects the outputs with a vertex.
        \fmf{photon,label=$\gamma/Z^0$}{v1,v2} %Labels the conneting line.

The thing is, that no error occurs, however no diagram is printed. Searching the web I found that I have to run LaTeX, then run metafont and run LaTeX again. Somehow I have to pre-produce the file "ome.mf" and run, I don't know how to do it, though. Any ideas?

share|improve this question
one.mf is produced by the first compilation with latex, so you need the sequence latex -- mf -- latex; apparently, texniccenter doesn't know that ... but i don't know how one might persuade it to do what's necessary. – wasteofspace Mar 20 '12 at 15:22
@wasteofspace: you should turn your comment into an answer (perhaps explaining some more how to process the .mf on a terminal?). – Gonzalo Medina Mar 21 '12 at 13:33
I found a "script" that works on kile. I tried to use it on TeXNiC center but it doesn't work. No error occurs, no feynman appears though. What can I do? – Thanos Mar 22 '12 at 9:12
@Thanos Did you try running Metafont from a DOS shell? – egreg Jun 2 '12 at 21:10
Also see How to run Metafont in TeXnicCenter – Tobias Kienzler May 2 '13 at 6:32
up vote 3 down vote accepted

Running (pdf)latex on the file should produce a file called one.mf in the same directory as your main .tex file.

You need to open a command window (or DOS shell, or whatever it's called) cd to the directory and issue

mf one.mf

However, you can say


which will create one.mp. You'd run

mpost one.mp

This is vastly more efficient than the Metafont method.

For even more convenience, use the feynmp-auto package, which will automatically run mpost (for this to work with MikTex you have to add the -enable-write18 switch to the argument list of (pdf)latex)

share|improve this answer
In TXC, you can add pre- and post-processor instructions to an output profile, including a "File path without extension" parameter, so adding the post-processor mpost "%bm.mp", probably followed by another (pdf)latex run, should do the trick. If you add this to your default output profile make sure you add some error catching, since a non-existent .mp file will otherwise cause TXC to believe compilation failed and refuse to "compile & show" (it will compile, but due to the error won't show the result) – Tobias Kienzler May 2 '13 at 6:23

Your Answer


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.