The way I normally handle Feynman diagrams is just to include \usepackage{feynmf-auto} and to write the whole fmffile code int he main tex file.

However, I saw that some people manage to create a separate tex file for each graph, and to somehow produce a pdf-picture of that graph. Later they embed these pdf-pictures into the main file using includegraphics.

My question is how to produce these standalone pdfs with feynman graphs using feynmp?

Consider for example the following code

\usepackage[usenames]{color} %used for font color
\usepackage{amssymb} %maths
\usepackage{amsmath} %maths
\usepackage[utf8]{inputenc} %useful to type directly diacritic characters
\usepackage{feynmp} %Feynman diagrams
    \fmflabel{$b, \mu$}{r1}

Somehow this gets converted into a picture with only the diagram, but if I try to compile it, I get an A4 page with the graph at the bottom

  • 2
    When I compile your code I have an empty pdf with no errors. With that said, is it possible to use \documentclass[10pt]{standalone}?
    – Pouya
    Jun 10, 2015 at 13:01
  • 3
    If I replace article with standalone, load feynmp-auto instead of feynmp and remove the align* environment, I get what seems to be the expected result (after the second LaTeX run, of course).
    – egreg
    Jun 10, 2015 at 14:18

1 Answer 1


Comments to this post helped me to come up with this template for producing standalone feynmf graphs

\RequirePackage[l2tabu, orthodox]{nag} % Issues warnings if deprecated packages are used

% my standard packages


% new style definitions come here

% commas in feynmp sometimes lead to strange errors, use \comma instead

\fmfframe(5,20)(10,15){% adjust the padding here to avoid labels being out of bounds
% the actual graph
  • That worked for me, once I adjusted to my system peculiar demand that I keep the fmfframe closing brace on the same line as the end fmfgraph line (never know what a Windows system will do to you). Nov 1, 2019 at 19:56

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.