0

I'm trying to produce the following with tikz:

enter image description here

I have written:

\documentclass[border=3mm, varwidth=141mm]{standalone}
\usepackage{tikz-feynman}

\begin{document}


\begin{tikzpicture}[baseline]
\begin{feynman}
    \node[] (m) at ( 0, 0) {};
    \vertex (a) at ( 225:2cm) {};% <<< changed y-coordinate
    \vertex (b) at ( -45:2cm) {};%<<< switched to polar: -60 deg, 1 cm radius
    \vertex (c) at (135:2cm) {};
    \vertex (d) at (45:2cm) {};
    \diagram* {
        (a) -- [photon,color=red] (m) % <<< funny bend
            -- [photon,color=red] (c),
        (b) -- [plain] (m) %<<< some color
            -- [plain] (d),
      };
\end{feynman}
\end{tikzpicture}
+
\begin{tikzpicture}[baseline]
\begin{feynman}
    %\node[shape=circle,draw=black,inner sep=0pt,minimum size=20pt] (m) at (0, 0) {};
    \node[shape=rectangle,fill=black,draw=black] (m) at (0, 0) {\rule{0.5cm}{0.5cm}};
    \vertex (a) at (225:2cm) {};
    \vertex (b) at (-45:2cm) {};
    \vertex (c) at (135:2cm) {};
    \vertex (d) at (45:2cm) {};
    %\vertex (e) at ($(n) + (-45:2cm)$) {};
    %\vertex (f) at ($(n) + (45:2cm)$) {};

    \diagram*{
    (a) -- [photon,color=red] (m)
    -- [photon,color=red] (c),
    %(n) -- [bend left=45, edge label=$\pi^-(K^-)$] (m)
   % -- [bend left=45, edge label=$\pi^+(K^+)$] (n),
    %(e) -- (n) -- (f),
    };
 \end{feynman}
 \end{tikzpicture}

 \end{document}

which gives:

enter image description here

I have two problems:

  1. In my left-hand side diagram the lines don't cross.

  2. In my right-hand side diagram, I couldn't make the red lines horizontal and also make inside the box white (fill = white doesn't work) and also to remove the right edge of the box.

Any help is greatly appreciated.

1 Answer 1

0

Instead of defining node \node[] (m) at ( 0, 0) {}; rather define \coordinate (m);

\documentclass[border=3mm, varwidth=141mm]{standalone}
\usepackage{tikz-feynman}

\begin{document}


\begin{tikzpicture}[baseline]
\begin{feynman}
    \coordinate (m);
    \vertex (a) at ( 225:2cm) {};% <<< changed y-coordinate
    \vertex (b) at ( -45:2cm) {};%<<< switched to polar: -60 deg, 1 cm radius
    \vertex (c) at (135:2cm) {};
    \vertex (d) at (45:2cm) {};
    \diagram* {
        (a) -- [photon,color=red] (m) % <<< funny bend
            -- [photon,color=red] (c),
        (b) -- [plain] (m) %<<< some color
            -- [plain] (d),
      };
\end{feynman}
\end{tikzpicture}
+
\begin{tikzpicture}[baseline]
\begin{feynman}
    %\node[shape=circle,draw=black,inner sep=0pt,minimum size=20pt] (m) at (0, 0) {};
    \node[shape=rectangle,fill=black,draw=black] (m) at (0, 0) {\rule{0.5cm}{0.5cm}};
    \vertex (a) at (225:2cm) {};
    \vertex (b) at (-45:2cm) {};
    \vertex (c) at (135:2cm) {};
    \vertex (d) at (45:2cm) {};
    %\vertex (e) at ($(n) + (-45:2cm)$) {};
    %\vertex (f) at ($(n) + (45:2cm)$) {};

    \diagram*{
    (a) -- [photon,color=red] (m)
    -- [photon,color=red] (c),
    %(n) -- [bend left=45, edge label=$\pi^-(K^-)$] (m)
   % -- [bend left=45, edge label=$\pi^+(K^+)$] (n),
    %(e) -- (n) -- (f),
    };
 \end{feynman}
 \end{tikzpicture}

 \end{document}

enter image description here

2
  • @Samane, huh, one problem in question please :-). Sorry I overlooked the second question. Sorry, but I don't completely understand what is the problem ....
    – Zarko
    Apr 17 at 13:13
  • @Samane, oh after editing of question now is clear what you after. I will provide answer at new question.
    – Zarko
    Apr 17 at 13:31

You must log in to answer this question.