Recently I have known how to use tikz-feynman with pdf-latex but I missunderstand one moment. I have used:
\usetikzlibrary{external} %% Load the `external` library
\immediate\write18{mkdir -p pgf-img} %% Create `pgf-img` directory
\tikzexternalize[ %% Activate externalization
prefix=pgf-img/, %% Avoid cluttering the directory
system call={ %% Use lualatex in system call
lualatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname="\image" "\texsource"
},
]
but, unfortunately, compilation produces a lot of errors. As I understand, these errors doesn't give any problems, but I would like to clarify it.
For instance, I will try to give a sample of code which works but produces errors.
\documentclass[a4paper,11pt]{article}
\usepackage{tikz}
\usetikzlibrary{external} %% Load the `external` library
\immediate\write18{mkdir -p pgf-img} %% Create `pgf-img` directory
\tikzexternalize[ %% Activate externalization
prefix=pgf-img/, %% Avoid cluttering the directory
system call={ %% Use lualatex in system call
lualatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname="\image" "\texsource"
},
]
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}
\begin{tikzpicture}[baseline=-\the\dimexpr\fontdimen22\textfont2\relax]
\begin{feynman}
\vertex (v1);
\vertex[right=0.7cm of v1] (v2);
\vertex[above right=0.7cm of v2] (v3);
\vertex[below right=0.7cm of v2] (v4);
\diagram*{(v1)--[boson](v2),(v2)--[fermion](v3),(v4)--[fermion](v2)};
\end{feynman}
\end{tikzpicture}
\end{document}
