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

I used:


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


it should give me

enter image description here

but I got:

enter image description here

what is the problem?

  • 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


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.

  • 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 .