In [1]:
from snippet import *
import shutil
from IPython.display import Image

In [6]:
my_diagram=ur'''
\begin{fmfgraph*}(100,80)
    \fmfstraight
    \fmfleft{i0,i1,i2}
    \fmfright{o0,o1,o2}
    \fmf{fermion,tension=2,lab.side=left,label=$\mu$}{i1,v1}
    \fmf{fermion,tension=1,lab.side=left,label=$e$}{v1,o0}
    \fmf{photon,tension=1,label=$\Pphoton$}{o2,v1}
    \fmfblob{.2w}{v1}
\end{fmfgraph*}
'''

In [7]:
img,wd = process(my_diagram)
Image(img)


Out[7]:

In [4]:
shutil.rmtree(wd, ignore_errors=True)

This notebook is published under the GNU Affero General Public License. The workflow is certainly a quick hack nothing super proper. Be aware that the backslashes don't need to be escaped anymore!