feynmp - ! Missing $inserted I'm trying to execute the code: \documentclass{article} \usepackage{feynmp} \begin{document} \unitlength = 1mm % determine the unit for the size of diagram. \begin{fmffile}{fmfile}{simple_tree} \begin{fmfgraph}{50,35} \fmfleft{i1,i2} \fmfright{o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11} \fmf{fermion}{i1,v1,o1} \fmf{gluon}{v1,v2} \fmf{fermion}{o2,v2,v3} \fmf{fermion}{v3,v4,v5,o3} \fmf{fermion}{v5,v6} \fmf{fermion}{o4,o5} \end{fmffile} \end{document}  However, I get an error that begins with ! Missing$ inserted


May I ask where I am going wrong here?

Edit: I've changed the code as follows, with the feynmp-auto and graph corrections:

\documentclass{article}
\usepackage{feynmp-auto}

\begin{document}
\unitlength = 40mm
% determine the unit for the size of diagram.

\begin{fmffile}{simple_tree}
\begin{fmfgraph}(50,35)
\fmfleft{i1,i2}
\fmfright{o1,o2,o3,o4,o5}
\fmf{fermion}{i1,v1,o1}
\fmf{gluon}{v1,v2}
\fmf{fermion}{o2,v2,v3}
\fmf{fermion}{v3,v4,v5,o3}
\fmf{gluon}{v5,v6}
\fmf{fermion}{o4,v6,o5}
\end{fmfgraph}
\end{fmffile}
\end{document}


Now however I get the error:

! LaTeX Error: File feynmp-auto.sty' not found.


from Texmaker. I used command line and get the same thing.

-
The \$-complaint references the use of _ in simple_tree. However, your minimal document won't compile for other reasons as well. For example, the environment fmfgraph is never closed. –  Werner Mar 20 '13 at 19:07
You have several errors: \begin{fmffile}{simple_tree} (an argument too many); \begin{fmfgraph}(50,35) (parentheses rather than braces); an \end{fmfgraph} is also missing. –  egreg Mar 20 '13 at 19:12

The syntax of the fmffile environment is

\begin{fmffile}{<filename>}


so with your code the file name is fmfile and LaTeX doesn't know what to do with {simple_tree} and so tries to typeset it.

The file name is that of the output Metapost file; if you want to call it simple_tree, say

\begin{fmffile}{simple_tree}


There's an error also in the following line, which should be

\begin{fmfgraph}(50,35)


with parentheses rather than braces.

Finally, \end{fmfgraph} is missing. Correct code:

\documentclass{article}
\usepackage{feynmp}

\begin{document}
\setlength{\unitlength}{1mm}
% determine the unit for the size of diagram.

\begin{fmffile}{simple_tree}
\begin{fmfgraph}(50,35)
\fmfleft{i1,i2}
\fmfright{o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11}
\fmf{fermion}{i1,v1,o1}
\fmf{gluon}{v1,v2}
\fmf{fermion}{o2,v2,v3}
\fmf{fermion}{v3,v4,v5,o3}
\fmf{fermion}{v5,v6}
\fmf{fermion}{o4,o5}
\end{fmfgraph}
\end{fmffile}
\end{document}


Note

Compiling this with Metapost gives errors:

feynmf: warning: dangling vertex v6' colliding with v5'.
feynmf: Have you seen the warning messages above?
They are usually caused by misspelling a vertex'
name and can trigger errors further below!
Fix the typos and run LaTeX and Metafont again.


Fix the code before trying.

Suggestion

If you have an up-to-date TeX distribution you can change

\usepackage{feynmp}


into

\usepackage{feynmp-auto}


that will take care of the Metapost run (two LaTeX runs are necessary anyway if the code in the fmffile environment is changed).

-
I entered the code, but it compiles and gives a completely white pdf document- is there something wrong with the line colour? –  Bracket Mar 20 '13 at 19:32
You have to run Metapost over the produced simple_tree.mp file. If you have an updated TeX distribution, you can try changing \usepackage{feynmp} with \usepackage{feynmp-auto}, which will take care of this auxiliary step (two LaTeX runs are needed). But there are errors in the fmgraph` code that you should correct beforehand. –  egreg Mar 20 '13 at 20:24