1

I am trying to create the following (crudely drawn) Feynman diagram: hand drawn Feynman diagram but the code I currently have is running into issues. I am using tikz-feynman with version compat=1.1.0. Here is the code I currently have:

\documentclass[11pt,a4paper]{article}
\usepackage[compat=1.1.0]{tikz-feynman}
\feynmandiagram [baseline=(b.base), horizontal=a to b] {
a [particle=\(k_1\)] -- [scalar] b -- [scalar, momentum=\(k_2\)] c,
b -- [photon, momentum'=\(q\), edge label'=\(\ell\), loop, min distance=2cm] b,
d [particle=\(k_4\)] -- [scalar] e -- [scalar, momentum'=\(k_3\)] f,
e -- [photon] b,
};

\end{document}

Which does not generate the image attached. Any help or thoughts?

5
  • 2
    Welcome. // Please add the missing parts so your code will compile when we copy and try it. Thank you
    – MS-SPO
    Jan 29 at 17:36
  • 1
    @MS-SPO Thanks! I think I did what you were asking? Not sure, haven't copied code to here before. I have a lot of packages loaded in the document I am working on...
    – MathZilla
    Jan 29 at 18:01
  • Which compiler do you use? LuaLaTeX? Jan 29 at 18:16
  • @MathZilla: Fine :) // Exactly this way. If you want more orientation, have a look here, both at this checklist and the other answers: tex.meta.stackexchange.com/a/10137/245790
    – MS-SPO
    Jan 29 at 18:41
  • @JasperHabicht I am using LuaLatex yes.
    – MathZilla
    Jan 29 at 18:56

1 Answer 1

3

Since the tikz-feynman package places nodes automatically (for which you need to compile the code with LuaLaTeX), you need to think about how to position them in a way that the result is as indended. But sometimes, this automatic placement does not really help much. For example, if you want to add the straight vertical line below the loop, it might be easier to add this later using regular TikZ commands.

An approach could be:

\documentclass[border=10pt]{standalone}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}

\feynmandiagram[baseline=(b.base), horizontal=a to d]{
    o -- [photon, reversed momentum'=\(\ell\), loop, min distance=2cm] o,
    o -- [photon] a -- [scalar, reversed momentum=\(k_1\)] b,
    c -- [scalar, reversed momentum=\(k_2\)] a,
    o -- [photon] d -- [scalar, momentum=\(k_4\)] e,
    f -- [scalar, momentum=\(k_3\)] d,
};

\end{document}

enter image description here


\documentclass[border=10pt]{standalone}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}

\begin{tikzpicture}[baseline=(b.base)]
\begin{feynman}
    \diagram[horizontal=b to e]{
        a -- [scalar, momentum'=\(k_1\)] b 
          -- [scalar, momentum'=\(k_2\)] c,
        d -- [scalar, momentum=\(k_3\)] e
          -- [scalar, momentum=\(k_4\)] f,
        b -- [photon] e
    };

    \coordinate (o) at ($(b)!0.5!(e)$);
    \coordinate (p) at ($(o)+(0,1)$);

    \draw[photon] (o) -- (p) 
        edge[photon, reversed momentum'=\(\ell\), loop, min distance=2cm] (p);

\end{feynman}
\end{tikzpicture}

\end{document}

enter image description here

2
  • This is exactly what I was looking for. Would using the command "layered layout" have also worked to place nodes along the same vertical line with the loop diagram (so the 3 nodes that would create that)? This is what I tried after posting this question.
    – MathZilla
    Jan 30 at 18:24
  • 1
    I think, layered layout is better suited to draw tree-like diagrams, so I am not totally sure whether this would work with the above kind of diagram. But you could of course give it a try. Jan 30 at 18:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .