4

I am trying to wrap the following diagram in a circle and I am facing some problems. I am using the some codes from, Wrapping a Feynman diagram in an ellipse or a circle? , but I cannot make the lower line touch the perimeter. How can I make it look nice and symmetric?

\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{positioning,arrows,fit}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

\begin{document}

\tikzset{
particle/.style={thick,draw=blue, postaction={decorate},
    decoration={markings,mark=at position .5 with {\arrow[blue]{triangle 45}}}},
gluon/.style={decorate, draw=black,
    decoration={coil,aspect=0}}
 }

\begin{tikzpicture}[node distance=1.5cm and 1.5cm]
\coordinate[label={[xshift=-2pt]left:$e^{-}$}] (e1);
\coordinate[below right=of e1] (aux1);
\coordinate[above right=of aux1,label={[xshift=6pt]right:$e^{-}$}] (e2);
\coordinate[below=2cm of aux1] (aux2);


\draw[particle] (e1) -- (aux1);
\draw[particle] (aux1) -- (e2);

\draw[gluon] (aux1) -- node[label=right:$\gamma$] {} (aux2);
\node[draw,line width=2pt,circle,fit=(e1)(e2) (aux2),inner sep=.5\pgflinewidth] {};
\end{tikzpicture}
\end{document}

Any help would be useful.

2 Answers2

3

The fit command fits the text box inside the circle node, which is rectangular in shape and only coincides with the circle outline at its corners (try replacing circle with rectangle in your code to see the shape of the text area).

You could work around this by drawing the circle manually using some trigonometry:

\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{positioning,arrows,fit}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

\begin{document}

\tikzset{
particle/.style={thick,draw=blue, postaction={decorate},
    decoration={markings,mark=at position .5 with {\arrow[blue]{triangle 45}}}},
gluon/.style={decorate, draw=black,
    decoration={coil,aspect=0}}
 }

\begin{tikzpicture}[node distance=1.5cm and 1.5cm]
\coordinate[label={[xshift=-2pt]left:$e^{-}$}] (e1);
\coordinate[below right=of e1] (aux1);
\coordinate[above right=of aux1,label={[xshift=6pt]right:$e^{-}$}] (e2);
\coordinate[below=1/cos(45)*1.5cm of aux1] (aux2);


\draw[particle] (e1) -- (aux1);
\draw[particle] (aux1) -- (e2);

\draw[gluon] (aux1) -- node[label=right:$\gamma$] {} (aux2);
\draw  [ultra thick] (aux1) circle [radius=sqrt(1.5cm^2+1.5cm^2)];
\end{tikzpicture}
\end{document}
Jake
  • 232,450
1

This can be done with the new tikz-feynman package (see also the project page), based on this answer. The only requirement for using automatic positioning of the vertices is to compile the document with lualatex:

\documentclass[tikz]{standalone}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}
\tikzfeynmanset{
  every fermion={blue},
  every anti fermion={blue},
}

\begin{tikzpicture}
  \begin{feynman}
    \vertex (a);
    \vertex [above left=of a] (b) {\(\textup{e}^{-}\)};
    \vertex [above right=of a] (c) {\(\textup{e}^{-}\)};
    \vertex [below=of a] (d);
    \diagram*{
      (b) -- [fermion] (a),
      (c) -- [anti fermion] (a),
      (a)  -- [photon,edge label=\(\gamma\)] (d),
    };
    \draw[red,thick] (a) circle (1.518);
  \end{feynman}
\end{tikzpicture}
\end{document}

enter image description here

giordano
  • 8,486