1

I'd like to use TikZ-Feynman to have some nice Feynman-Diagrams in my paper. I have no experience with LuaTex, which TikZ-Feynman needs (and i currently don't really have the time to get used to LuaTex).

Is there a way to use TikZ-Feynman yet compile with pdfLaTex?

I know that there is TikZ-FeynHand, which works without LuaTex, but the positioning of verteces has to be done manually, which is one of the main points of TikZ-Feynman.

A possible solution (at least i think it is a solution for this problem) is described here but for some reason that doesn't work for me. I get the error ! I can't write on file `pgf-img/document-figure0.md5'. For some reason that file isn't being created, if I create it manually i get the error

! Package tikz Error: Sorry, the system call 'lualatex -halt-on-error -interaction=batchmode -jobname="pgf-img/document-figure0" "\def\tikzexternalrealjob{document}\input{document}" || rm "pgf-img/document-figure0.pdf"' did NOT result in a usable output file 'pgf-img/document-figure0' (expected one of .pdf:.jpg:.jpeg:.png:). Please verify that you have enabled system calls. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or something like that. Or maybe the command simply failed? Error messages can be found in 'pgf-img/document-figure0.log'.

A pgf-img/document-figure0.log isn't created either. A this point I don't know how to help myelf.

Any other ways to use TikZ-Feynman with pdfLaTex or help with the errors above would be awesome!

I use TexMaker on Ubuntu with TexLive 2019.

MWE:

\documentclass[a4paper,11pt]{article}

\usepackage[compat=1.0.0]{tikz-feynman}

%workaround from link
\usetikzlibrary{external}
\immediate\write18{mkdir -p pgf-img}
\tikzexternalize[
  prefix=pgf-img/,
  system call={
    lualatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname="\image" "\texsource" || rm "\image.pdf"
  },
]

\begin{document}

% simple s-channel diagram
\feynmandiagram [horizontal=a to b] {
  i1 -- [fermion] a -- [fermion] i2,
  a -- [photon] b,
  f1 -- [fermion] b -- [fermion] f2,
};

\end{document}
4
  • 1
    I'm not a big fan of Unicode engines like luatex or xetex, but there is really no issue in "hav[ing] the time to get used to it". There is almost nothing to get used to.
    – campa
    Jul 28, 2021 at 10:46
  • Can you please enter some minimal code, which produces your error and observation (MWE)? E.g. I'd like to see which packages you use etc. // Perhaps it's a matter of settings. Which editor or engine or program do you use?
    – MS-SPO
    Jul 28, 2021 at 11:04
  • Info added! ( and a few more characters so i can post this :) ) Jul 28, 2021 at 15:16
  • @campa. True, for some reason it looked a lot more effort at first.... should probably give it a try. Jul 29, 2021 at 5:35

0

You must log in to answer this question.

Browse other questions tagged .