I am using the package glossaries for a collection of terms, definitions, explanations to various subjects loosely related to my phd thesis. In some entries I also want to include feynman diagrams that I currently create with feynmp.
The problem is, that in order to generate the diagrams I need to put the code into a
\begin{fmffile}{name}
\end{fmffile}
environment that, in order to be compiled by latex, has to be inside of the
\begin{document}
\end{document}
environment.
However, all entries for glossaries are in the preamble before the
\begin{document}
.
With fmfkeep and fmfreuse I can still generate the feynman diagrams within the document and then refer to them in the entries in glossaries. But this means that I have some extra pages where I have all Feynman diagrams - at the moment I need to do this in order to have the Feynman diagrams in an entry...
In order to write the diagrams directly at the place of the entry I would have to create and use a new *.mp file in each entry in the glossary. With dozens of entries and much more diagrams it will be way to complicated since it means that each time I run latex I would have to mpost each *.mp file individually...
As far as I understand feynmf safes the diagrams as eps files. Is there any way that I can convert the diagrams to eps and then include them with \includegraphics ? In that case I would probably loose all labels, since they are stored in a different file.
Are there other possibilities such that I don't have these extra pages with Feynman diagrams?
Are there other packages that are more compatible with glossaries that I can use to generate the Feynman Diagrams? Or are there other packages to generate a glossary that are more compatible with feynmf? But I suppose with feynmf and glossaries I already have the two most widely used packages for these purposes?
Thank you in advance already for any advice :)
Ok, here is the MWE. I added a bit of text and hope it is not disturbing but rather explaining the problem I have...
\documentclass{article}
\usepackage{feynmp}
\listfiles
\usepackage{datatool}
\usepackage{glossaries}
\makeglossaries
\longnewglossaryentry{minimal}{name={minimal}}{I would like to have a Feynman diagram here :) \\
I can either open fmffile here \\~\\
\begin{fmffile}{minimal01}
\begin{fmfgraph*}(125,100)
\fmfkeep{directphoton01}\fmfleftn{l}{2} \fmfrightn{r}{2}
\fmf{fermion,tension=1.5}{v1,l1}\fmf{fermion,tension=1.5}{l2,v2}\fmf{fermion,tension=2}{v2,v1}
\fmf{phantom,tension=1.5}{v1,r1}
\fmf{photon,tension=1.5}{r2,v2}\fmflabel{\(\bar{q}\)}{l1} \fmflabel{\(q\)}{l2} \fmflabel{\(\gamma\)}{r2} \fmflabel{\(g\)}{r1}
\fmfdotn{v}{2}
\fmffreeze \fmf{plain,tension=4}{v1,m1}\fmf{gluon,tension=0.5}{m1,m2}\fmf{plain,tension=4}{m2,r1}
\end{fmfgraph*}
\end{fmffile}
~\\~\\ and then close it here which means one fmffile for each entry... \\
Or I can use fmfreuse{directphoton02} which allows me to have all diagrams in one fmffile, but generates that additional diagram above header Glossary, which is part of the maintext, since glossary is put at the end of the document...\\~\\
\fmfreuse{directphoton02}
}
\begin{document}
\begin{fmffile}{minimal02}
\begin{fmfgraph*}(125,100)
\fmfkeep{directphoton02}\fmfleftn{l}{2} \fmfrightn{r}{2}
\fmf{fermion,tension=1.5}{v1,l1}\fmf{fermion,tension=1.5}{l2,v2}\fmf{fermion,tension=2}{v2,v1}
\fmf{phantom,tension=1.5}{v1,r1}
\fmf{photon,tension=1.5}{r2,v2}\fmflabel{\(\bar{q}\)}{l1} \fmflabel{\(q\)}{l2} \fmflabel{\(\gamma\)}{r2} \fmflabel{\(g\)}{r1}
\fmfdotn{v}{2}
\fmffreeze \fmf{plain,tension=4}{v1,m1}\fmf{gluon,tension=0.5}{m1,m2}\fmf{plain,tension=4}{m2,r1}
\end{fmfgraph*}
\end{fmffile}
\glsaddall%\makeglossary\makeglossary
\printglossaries
\end{document}
\documentclass{...}
and ending with\end{document}
. In particular, how do you generate the glossary entries? There are ways (withglossaries
) to do this outside of the preamble, but there might be other issues.