I'm trying to draw some Feynman diagrams with LaTeX. So I'm using the TikZ-Feynman package. But my code below:
\documentclass[tikz]{standalone}
\usepackage{tikz-feynman}
\begin{document}
\feynmandiagram [large, vertical=e to f] {
a -- [fermion] b -- [photon, momentum=\(k\)] c -- [fermion] d,
b -- [fermion, momentum'=\(p_{1}\)] e -- [fermion, momentum'=\(p_{2}\)] c,
e -- [gluon] f,
h -- [fermion] f -- [fermion] i;
};
\end{document}
produces the following disfigured diagram!
What should I do?

pdflatex/xelatex, orlualatex? You need to uselualatexfor the more advanced placement algorithms. – Torbjørn T. Feb 03 '17 at 08:01externalizelibrary for TikZ-Feynman. Have a look at this snippet, though you'll probably want to change theexternal/mode(refer TikZ manual for information about the options). – JP-Ellis Feb 03 '17 at 14:19