1

I want to get this Feynman diagram: enter image description here

I have following code, however when I add \(g(b,\overline a)\) , I get many errors. Could you please tell me how should I get desired result?

\begin{center}
\feynmandiagram[horizontal=a to b]{
    i1[particle=\(u(r)\)] -- [anti fermion] a -- [anti fermion] i2[particle=\(u(b)\)],
    a -- [gluon, edge label= \(g\)] b,
};
\end{center}
2
  • @campa Awesome, it worked! Thanks a lot. Oct 7 '21 at 16:23
  • 1
    I was exactly answering this. @somerandomguest also please make your MWE compilable right away (I had to guess that you used tikz-feynman from your other question, I’ve never used that before), the standalone class is quite nice for this. ;)
    – Archange
    Oct 7 '21 at 16:27
3

This is due to parsing issue with the comma, you have to use braces {}:

\documentclass{standalone}

\usepackage{tikz-feynman}

\begin{document}

\feynmandiagram[horizontal=a to b]{
    i1[particle=\(u(r)\)] -- [anti fermion] a -- [anti fermion] i2[particle=\(u(b)\)],
    a -- [gluon, edge label= {\(g,\overline a\)}] b,
};

\end{document}

The output: feynman

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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