3

This question already has an answer here:

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.

marked as duplicate by egreg tikz-pgf Jan 26 '18 at 14:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 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.) – marmot Jan 26 '18 at 14:21
3

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.