JP-Ellis / tikz-feynman

Feynman Diagrams with TikZ
http://www.jpellis.me/projects/tikz-feynman
Other
146 stars 20 forks source link

Momentum labels on arc #37

Closed hongwanliu closed 7 years ago

hongwanliu commented 7 years ago

Hi,

When I try to add momentum labels to an arc, it creates a label at every quarter of a circle:

\begin{tikzpicture}
  \begin{feynman}
    \vertex (a1);
    \vertex[right=2cm of a1] (a2); 
    \vertex[right=2cm of a2] (a3);
    \draw [scalar, momentum'=\(k\)] (a1) -- (a2); 
    \draw [scalar] (a2) -- (a3);
    \draw [scalar, momentum'=\(p\)] (a2) arc [start angle=-90, end angle=270, radius=0.7cm];
  \end{feynman}
\end{tikzpicture}

Is there anyway to control the labelling?

Thanks!

JP-Ellis commented 7 years ago

This is interesting. It seems like the arc uses multiple individual paths which, unfortunately, all have an additional momentum arrow. Changing the angle spanned by the arc shows quite clearly when TikZ changes from having one, two, three or four individual segments.

I'm not sure how to fix this as I did not envisage the arc to create such a behaviour. I can offer an alternative if you don't mind the loop not being perfectly circular:

\documentclass[tikz, border=10pt]{standalone}

\usepackage[compat=1.1.0]{tikz-feynman}

\begin{document}
\begin{tikzpicture}
  \begin{feynman}
    \vertex (a1);
    \vertex[right=2cm of a1] (a2);
    \vertex[right=2cm of a2] (a3);
    \draw [scalar, momentum'=\(k\)] (a1) -- (a2);
    \draw [scalar] (a2) -- (a3);
    \draw [scalar, momentum'=\(p\)] (a2) to [bend angle=45, distance=2cm] (a2);
  \end{feynman}
\end{tikzpicture}
\end{document}

hong-1

If you really want a circular loop, you might have better luck over on the TeX StackExchange.