非停止模式下的文件错误

非停止模式下的文件错误

我正在尝试使用制作费曼图feynmf。我的代码是

\documentclass[a4paper,11pt]{article}

\usepackage{xcolor}
\usepackage{amsthm}
\theoremstyle{definition}
\newtheorem{exe}{Exercise}
\newcommand*{\mybox}[2]{\colorbox{#1!30}{\parbox[t]{.88\linewidth}{#2}}}

%~~~~~~~~~~~~~~~~~~~~Feynman Diagramms~~~~~~~~~~~~~~~~~~~~~~~~~~
\usepackage{feynmp}
\DeclareGraphicsRule{.1}{mps}{.1}{}
%\DeclareGraphicsRule{*}{mps}{*}{}
%
\makeatletter
\def\endfmffile{%
  \fmfcmd{\p@rcent\space the end.^^J%
          end.^^J%
          endinput;}%
  \if@fmfio
    \immediate\closeout\@outfmf
  \fi
  \ifnum\pdfshellescape=\@ne
    \immediate\write18{mpost \thefmffile}%
  \fi}
\makeatother

\begin{document}

\begin{exe}\mybox{gray}{Show that $g_{\mu\nu}g^{\mu\nu}=4$}\\

\noindent\textbf{Solution:} \unitlength = 1mm

\begin{figure}[H]
\centering
\begin{fmffile}{pair}   %file.mf will be created for this feynman diagram  
  \fmfframe(1,7)(1,7){  %Sets dimension of Diagram
   \begin{fmfgraph*}(70,45) %Sets size of Diagram
    \fmfleft{i1}    %Sets there to be 2 sources 
    \fmfright{o1,o2}    %Sets there to be 2  outputs
    \fmflabel{$\gamma$}{i1} %Labels one of the left sources
%    \fmflabel{$e^-$}{i1} %Labels one of the left sources
    \fmflabel{$e^-$}{o1} %Labels one of the right outputs
    \fmflabel{$e^+$}{o2} %Labels one of the right outputs
    \fmf{photon}{i1,v1} %Connects the sources with a vertex.
%    \fmf{fermion}{i1,v1} %Connects the outputs with a vertex.
%    \fmf{fermion}{v1,v2} %Labels the conneting line.
    \fmf{fermion}{v1,o1}
    \fmf{fermion}{v1,o2}
   \end{fmfgraph*}
  }
\end{fmffile}\caption{Feynman Diagram}
\end{figure}

\end{exe}
\end{document}

一旦我运行此代码,*.mp就会生成一个文件。我运行 metapost,然后再次运行 LaTeX。问题是没有生成 feynman,我得到了*.txt一个

This is MetaPost, Version 1.005 (MiKTeX 2.8) (preloaded mem=mpost 2013.3.11)  11 MAR 2013 16:56
**C:\Users\thanos\Documents\^^d6^^d4^^c5\2nd Semester\Elementary Particle Physi
cs\Homework\testMF\pair.mp

! Emergency stop.
<*> C:\Users\thanos\Documents\^^d6^^d4^^c5\2nd
                                               Semester\Elementary Particle ...
*** (job aborted, file error in nonstop mode)

我曾经使用相同的程序来创建此类图表,并且一切都运行正常。您知道这是怎么回事吗?

相关内容