Suppose one has a simple Feynman diagram, such as the following MWE (which has to be run with -shell-escape
, I guess this is to allow compilation to "escape the shell" to run metapost).
\documentclass{article}
\usepackage{amsmath,amssymb,braket,feynmp-auto}
\newenvironment{feynman}[1]{\begin{center}\begin{fmffile}{#1}\vspace*{\baselineskip}}{\vspace*{\baselineskip}\end{fmffile}\end{center}}
\begin{document}
\begin{feynman}{01}
\begin{fmfgraph*}(110,65)
\fmfleftn{i}{2}
\fmfrightn{o}{1}
\fmf{fermion}{i1,v1,i2}
\fmf{dashes,label=$\braket{\lambda_2|T|\lambda_1}$}{v1,o1}
\fmfdotn{v}{1}
\fmfv{decoration.shape=cross,decoration.filled=empty,decoration.size=0.1w}{o1}
\fmflabel{$\lambda_2$}{i1}
\fmflabel{$\lambda_1$}{i2}
\end{fmfgraph*}
\end{feynman}
\end{document}
In the case of a large project, one wouldn't like to have all the .1
, .log
, .mp
and .t1
files to be in the main folder, but rather in a subfolder. When the name of the diagram is changed to for example diagrams/01
, by changing the 5th line to
\begin{feynman}{diagrams/01}
only the file 01.mp
appears in the subfolder diagrams, the other files aren't created (it seems the second step in creating the diagram doesn't recognize the path), with as result no output in the pdf.
Question: How can we get whatever script/program that is being run to recognize the path to the .mp
file? Or, more generally, how can we get the diagram files to be stored in a subfolder?
mpost
doesn't obey the-output-directory
that's possible to use with other TeX programs. Complain with the maintainers.feynmp-auto
, but makingmpost
run in a subdirectory would introduce heavy OS dependency. Possibly a solution is usinglatexmk
with suitable rules.feynmp-auto
about the issue? Pardon my stupidity, but how exactly wouldlatexmk
come into play here?feynmp-auto
, so you have already contacted me. ;-) And I told you this feature can't be provided withoutmpost
obeying the-output-directory
command line option. Such a change can only be done by the maintainers of Metapost. Sincelatexmk
can do postprocessing in a fairly general way, I believe it would be possible to adapt it to the task.