\usepackage{feynmp} % macro to compile Feynman graphs without extra scripts \DeclareGraphicsRule{*}{mps}{*}{} \makeatletter \def\endfmffile{ \fmfcmd{\p@rcent\space the end.^^J end.^^J endinput;} \if@fmfio \immediate\closeout\@outfmf \fi \ifnum\pdfshellescape>\z@ \immediate\write18{mpost \thefmffile} \fi} \makeatother