1

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!

enter image description here

What should I do?

JP-Ellis
  • 8,929
  • 2
  • 33
  • 49
Credo
  • 111
  • 2
    Welcome to TeX.SE. Thank you for adding your work as MWE. Actually, I don't understand the exact problem. (Maybe due to the fact, that I am not a physician and hence are not able to see the problem at once.) Could you please be so kind, to add a sketch of the diagram, what you want to achieve? Just a quick pencil sketch shot with your handy cam and inserted as image would be sufficient. – Jan Feb 03 '17 at 07:51
  • Well, the TikZ-Feynman package is supposed to give upright diagrams like the ones in the following page:http://tex.stackexchange.com/questions/86588/package-for-typesetting-feynman-diagrams-efficiency-of-feynmp-and-tikz?newreg=447955660fac46bdb7d08e447b4ddd20 – Credo Feb 03 '17 at 07:53
  • 2
    And physician means a doctor in medicine, we're called physicists, ;). – Credo Feb 03 '17 at 07:54
  • thank you for your information. I am neither a physician nor a physicist, but willing to learn :-) In my opinion, your diagram is also upright. Still don't know, what may be wrong with that. – Jan Feb 03 '17 at 07:59
  • Please scroll down that page and take a look at the one with the comment %Penguin diagram with momentum arrows, that's the result I'm supposed to get(same code), that's how we draw these diagrams. – Credo Feb 03 '17 at 08:00
  • 1
    Are you compiling with pdflatex/xelatex, or lualatex? You need to use lualatex for the more advanced placement algorithms. – Torbjørn T. Feb 03 '17 at 08:01
  • 1
    Cool to see more people using Tikz-Feynman! This is actually a duplicate of this issue :). I'll vote to close it. – JP-Ellis Feb 03 '17 at 08:06
  • But there is another problem. Because I want to use xepersian, It seems I need to use xtex to compile my code. Is it possible to compile a code using xepersian, with lualatex? – Credo Feb 03 '17 at 08:14
  • I'll just compile the diagrams separately and include them in my main code using \includegraphics. – Credo Feb 03 '17 at 08:54
  • Sorry, I didn't see you follow up comment. Compiling the diagrams separately is one way to do it; alternatively, you might want to look at the externalize library for TikZ-Feynman. Have a look at this snippet, though you'll probably want to change the external/mode (refer TikZ manual for information about the options). – JP-Ellis Feb 03 '17 at 14:19

0 Answers0