Open Turgon-Aran-Gondolin opened 5 years ago
It would be nice if you could add a full working minimal example (MWE) which will make it much easier to see the issue and than hopefully provide a solution or fix.
This should reproduce what I described:
\documentclass{article}
\usepackage{amsmath}
\usepackage[compat=1.1.0]{tikz-feynman}
\usepackage{shellesc}
\usetikzlibrary{external}
\tikzexternalize[shell escape=-enable-write18,prefix=./,system call={lualatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"},up to date check=md5]
\begin{document}
\begin{align}
\begin{tikzpicture}
\begin{feynman}
\node[dot] (a);
\node[right=1 in of a,dot] (b);
\diagram*{
(a) -- (b);
};
\end{feynman}
\end{tikzpicture}
\end{align}
\end{document}
align
(like all AMS environments) evaluates its body twice, with \ifmeasuring@
being true the first time and false the second, so probably you want to avoid the external calls on the second pass.
Thanks for pointing this out. Do you have a solution for this? I'm not really familiar with options of the external library and I'm not sure which one can achieve this.
After updated to 3.15a, there's a new problem. If there're multiple figures in one math environment, the first one will get evaluated every single pass despite it remains unchanged.
MWE:
\RequirePackage{luatex85}
\documentclass{article}
\usepackage{amsmath}
\usepackage[compat=1.1.0]{tikz-feynman}
\usetikzlibrary{external}
\tikzexternalize[shell escape=-enable-write18,prefix=./,system call={lualatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"},up to date check=diff]
\begin{document}
\begin{align}
\feynmandiagram{
a -- b[dot];
};\qquad & \int \qquad
\feynmandiagram{
a[dot] -- b;
};
\end{align}
\end{document}
Also all figures inside one math environment got merged into the first figure file (one figure per page). And all except the first figure files are still generated normally.
Okay, it looks like this has become unusable. I will revert the fix and publish a new release.
I was using the following code to externalize the
tikz-feynman
diagramsWhen the diagrams are in figure environment everything works fine. But those in
align
environment were generated twice. So my working dir is now filled with duplicated figures. While the md5 of those duplicated figures are exactly the same, they continue to exist and the compiling effort is doubled. Is there any way to resolve this?