2

I tried to use TikZ-Feynman package to plot Feynman diagram as shown in here.

I used:

\documentclass{article}
\usepackage{tikz}
\usepackage[compat=1.0.0]{tikz-feynman}
\begin{document}

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

\end{document}

it should give me

enter image description here

but I got:

enter image description here

what is the problem?

1
  • You should have a warning like this in your .log file: "LuaTeX is required if you wish to have vertices automatically placed." Commented Mar 6, 2023 at 10:39

1 Answer 1

6

This probably happens because of the TeX engine: if I compile your code with LuaLaTeX I get the expected output, but if I compile it with pdfLaTeX I get the same problematic output as you. As stated in the package's documentation, the automatic calculation of the vertices' positions is done with a Lua script, so it requires LuaTeX.

If you don't want to use LuaTeX, another solution would be to place vertices manually, as explained in section 2.4.3 of the documentation.

1
  • Indeed the problem is because of the TeX engine. I solved it by setting ``` % !TeX TS-program = lualatex``` in the top of the Tex file
    – Bekaso
    Commented Mar 6, 2023 at 7:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .