3

I want to make a Feynman diagram using the Tikz-Feynman package, that is aligned horizontally. The command I use looks like:

\documentclass{book}
\usepackage{tikz-feynman}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning,automata,backgrounds,calc,er,patterns}
\tikzfeynmanset{compat=1.0.0}
\begin{document}
\begin{center}
\feynmandiagram[horizontal=a to b]{
  i1 -- [fermion] a -- [fermion] i2,
  a -- [photon] b,
  f1 -- [fermion] b -- [fermion] f2,
};
\end{center}
\end{document}

According to the documentation, this should look like this: enter image description here

but instead it looks like this:

enter image description here

How do I fix this?

PS: I am using a Sharelatex installation on my own server to compile the document.

egreg
  • 1,121,712
CrustyPeanut
  • 95
  • 10
  • 1
    Do you compile with lualatex? (If I compile with lualatex, I get the desired result, if I compile with xelatex I reproduce your result.) –  Jan 26 '18 at 14:21

1 Answers1

3

The problem was, that my compiler was set to pdfLatex by default. Changing it to LuaLatex makes it work the intended way.

CrustyPeanut
  • 95
  • 10