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.

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

How do you include a Feynman diagram in a beamer presentation?

\usepackage{amsmath, amsthm, amssymb,latexsym}
\mode<presentation> {
\subsection{The diagram}
    \frametitle{the title etc}
        here is the feynmp code....\end{fmfgraph*}


The Feynman diagram doesn't show up for me. What am I doing wrong, any suggestions?

share|improve this question
This is just a guess, but you probably have to declare your frame as fragile. – Jubobs Nov 2 '13 at 12:38
Ok I'll try that. Ehhm how would one declare that exactly? – Faq Nov 2 '13 at 12:42
@Jubobs It didn't work man, it is all white and the diagram is not shown. Although I am sure the Feynman diagram is created. This should have a widely known answer but apparently it doesn't. :( – Faq Nov 2 '13 at 12:51
@Jubobs Maybe you know a way to import an already finished feynmp figure? What would that code be then? – Faq Nov 2 '13 at 13:00
\includegraphics?? – Harish Kumar Nov 2 '13 at 13:18
up vote 4 down vote accepted

This works:


\mode<presentation> {


\subsection{The diagram}

\frametitle{the title etc}

  \fmfleft{i1,i2} \fmfright{o1,o2}
  \fmf{fermion}{i1,v1,o1} \fmf{fermion}{i2,v2,o2}
  \fmf{photon,label=$q$}{v1,v2} \fmfdot{v1,v2}



Compile twice.

enter image description here

share|improve this answer
Yes! That actually worked, bravo, thank you so much! – Faq Nov 2 '13 at 13:45
@LoveLearning feynmp-auto is only for convenience: with it instead of feynmp you don't need to run Metapost separately. – egreg Nov 2 '13 at 13:47
yes I read that in the manual, cool. – Faq Nov 2 '13 at 13:51

I recently included a feynmp graph in a beamer presentation and it worked. I think I remember having had some trouble with this, but for me including


in the preamble did the trick. This is also the only obvious difference between our source files. With this you can just use feynmp as usual, where "usual" for me is: compile your code, run metapost on the produced files in a terminal, then recompile. If you already produced the files it might be enough to just recompile.

share|improve this answer
So where do you write this and what do you do next? Do you import your already finished F-diagrams or do you rebuild them with \begin{fmffile}{}...etc? Please be more clear. Thanks! – Faq Nov 2 '13 at 13:21
I put it in the preamble somewhere after the \usepackage{} stuff... Then I did the normal feynmp procedure (compile, run metapost in the terminal, compile again) and it worked. – fifaltra Nov 2 '13 at 13:25
Do you use \begin{fmffile}{}..etc later or do you import stuff? In that case what file do you import? – Faq Nov 2 '13 at 13:26
And yes, \begin{fmffile}{} and all that is still in my code. This is especially important if you have labels, because if you look at the files produced by metapost you won't find any labels there. (I think I tried to just include the file via \includegraphics at first but had to abandon the idea because of the labels) – fifaltra Nov 2 '13 at 13:29

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.