- Produce the Metapost file using the appropriate latex code.
- Manually give it to Metapost (I tried to put it in the preprocessor directive of PDFLaTeX output profile, but to no avail)
- Separately print on a PDF file the diagrams I need
- Insert them in the document via \includegraphics.
General ⇒ feynmp | Integration into TeXnicCenter
feynmp | Integration into TeXnicCenter
I'm trying to make some Feynman diagrams with the feynmp package, but I can't manage to get it to work properly with TeXnicCenter. I can produce them, but they don't get automatically included in the PDF. What I do now is:
Last edited by dandus on Mon Nov 21, 2011 7:58 pm, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.
feynmp | Integration into TeXnicCenter
Done!
Since I couldn't find any answer on how to make texnic center interact with feynmp, I thought about asking how to make kile work with it instead. Turns out the solution is surprisingly fast, and works just fine with texnic center too.
As you can see here
http://tex.stackexchange.com/questions/ ... -or-feynmp, by using the code
and twice launching pdftex with the -enable-write18 option, everyithing worked. I post it in case it can be of any help to someone, which i think it will since I had a very hard time googling it.
Since I couldn't find any answer on how to make texnic center interact with feynmp, I thought about asking how to make kile work with it instead. Turns out the solution is surprisingly fast, and works just fine with texnic center too.
As you can see here
http://tex.stackexchange.com/questions/ ... -or-feynmp, by using the code
Code: Select all
\usepackage{feynmp}
\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
feynmp | Integration into TeXnicCenter
By the way, it appears that the feynman diagrams appear in the wrong order using these method. You can avoid this using one metapost file per diagram. I automated the process by defining a new environment
which accepts as an argument the name of the diagram, used both for the filenamea and for the sake of the \fmfkeep command.
Code: Select all
\newenvironment{feynman}[1][1]{
\begin{fmffile}{fey_#1}
\begin{fmfgraph}(40,25)\fmfkeep{#1}
\fmfpen{thin}
}{
\end{fmfgraph}
\end{fmffile}
}