5

I am attempting to draw the following diagram using TikZ-Feynman (CTAN) enter image description here

But I am having difficulty keeping the fermion legs straight after attaching the photons. Using feynmp there is a workaround using \fmffreeze but I am unable to manipulate the angles of the labels in feynmp and would prefer to continue working with Tikz-Feynman. Any suggestions?

  • 1
    Please, include into your question a small, complete document (Minimal Working Example) with \documentclass{...} on its beginning and ending by \end{document}, which will generate your image. – Zarko Mar 13 '17 at 6:43
7

I saw your question on Github, and I was about to answer when you posted your question here. Sorry I couldn't get to you on Github first (though here's probably better because there's more exposure).

Anyway to answer your question, there's unfortunately no direct equivalent to \fmffreeze in TikZ-Feynman (CTAN).

Having said that, there are alternatives. One way to do it is to create a first diagram using the automatic placement, and then just tacking on extra vertices. Here's an example where I highlight the edges placed automatically in red, and the remaining black edges are added manually afterwards:

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

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

\begin{document}
\begin{tikzpicture}
  \begin{feynman}
    \diagram [vertical'=a to b, edges={red}] {
      i1 -- [fermion] a -- [fermion] f1,
      a -- [photon] b,
      i2 -- [fermion] b -- [fermion] f2,
    };

    \vertex [above right=of f1] (k1);
    \vertex [below right=of f1] (p1);
    \vertex [below right=of f2] (k2);
    \vertex [above right=of f2] (p2);

    \diagram* {
      (f1) -- [fermion] (k1),
      (f1) -- [photon] (p1),
      (f2) -- [fermion] (k2),
      (f2) -- [photon] (p2),
    };
  \end{feynman}
\end{tikzpicture}
\end{document}

First example

Note that the with second \diagram* command, the * allows for existing vertices to be referenced, and this is then done by surrounding them with parenthesis.

In your particular case though, this won't work really well because your initial diagram is quite simple (it's a straight line). So it is actually just as easy to manually place everything:

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

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

\begin{document}
\begin{tikzpicture}
  \begin{feynman}
    \vertex [blob] (f1) {};
    \vertex [above right=1cm and 4cm of f1] (f4);

    \diagram* {
      (f1) -- [fermion] (f4),
    };
  \end{feynman}
\end{tikzpicture}

\begin{tikzpicture}
  \begin{feynman}
    \vertex [blob] (f1) {};
    \vertex [above right=1cm and 4cm of f1] (f4);
    \vertex (f2) at ($(f1)!0.33!(f4)$);
    \vertex (f3) at ($(f1)!0.67!(f4)$);

    \vertex [below=of f4] (k1) {\(k_{1}\)};
    \vertex [below=of k1] (k2) {\(k_{2}\)};

    \diagram* {
      {[edges={fermion}]
        (f1) -- (f2) -- (f3) -- (f4),
      },
      (f2) -- [photon] (k2),
      (f3) -- [photon] (k1),
    };
  \end{feynman}
\end{tikzpicture}

\begin{tikzpicture}
  \begin{feynman}
    \vertex [blob] (f1) {};
    \vertex [above right=1cm and 4cm of f1] (f4);
    \vertex (f2) at ($(f1)!0.33!(f4)$);
    \vertex (f3) at ($(f1)!0.67!(f4)$);

    \vertex [below=of f4] (k1) {\(k_{1}\)};
    \vertex [below=of k1] (k2) {\(k_{2}\)};

    \diagram* {
      {[edges={fermion}]
        (f1) -- (f2) -- (f3) -- (f4),
      },
      (f2) -- [photon] (k1),
      (f3) -- [photon] (k2),
    };
  \end{feynman}
\end{tikzpicture}
\end{document}

enter image description here

enter image description here

enter image description here

Note that I'm subdividing the fermion line in three using the coordinate

($(A)!D!(B)$)

which means

Fraction D of the distance from node (A) to node (B).

This means that D = 0 corresponds to (A), D = 0.5 is the midpoint between (A) and (B), and D = 1 corresponds to (B).

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.