4

I am using the tikz-feynman package to draw feynman diagrams. Consider the following diagram

a busy cat

which I drew using the following piece of code:

    \begin{center}
    \begin{tikzpicture}
        \begin{feynman}
            \vertex (h1) ;
            \vertex at ($(h1) + (0.5cm, -1.0cm)$) (i1);
            \vertex at ($(i1) + (0.5cm, -1.0cm)$) (m1);
            \vertex at ($(m1) + (-0.5cm, -1.0cm)$) (i2);
            \vertex at ($(i2) + (-0.5cm, -1.0cm)$) (h2);
            \vertex [right= 2.5 cm of m1] (m2);
            \diagram* {
                (h1) -- [anti fermion, edge label=\(p'\)] (i1) -- [anti fermion, edge label=\(k'k+q\)] (m1) -- [anti fermion, edge label=\(k\)] (i2) -- [anti fermion, edge label=\(p\)] (h2),
                (m2) -- [photon, momentum=q] (m1),
                (i2) -- [photon, half left, momentum=p-k] (i1),
            };
        \end{feynman}
    \end{tikzpicture}
    \end{center}

I am not able to label one of the lines as k'=k+q. The equals sign does not show in the diagram.

Can you help me with this?

Edit:

Code extended:

\documentclass{article}
\usepackage{amsmath,amsfonts,amsthm,amssymb}
\usepackage{setspace}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{extramarks}
\usepackage{chngpage}
\usepackage{soul}
\usepackage[usenames,dvipsnames]{color}
\usepackage{graphicx,float,wrapfig}
\usepackage{ifthen}
\usepackage{listings}
\usepackage{slashed}
\usepackage{courier}
\usepackage[utf8]{inputenc}
\usepackage[]{amsmath}
\usepackage[]{xcolor}
\usepackage[]{enumitem}
\usepackage[]{graphicx}
\usepackage{mathtools}
\usepackage{simplewick}
\usepackage{bbold}
\usepackage{bm}
\usepackage{tikz-feynman}
\tikzfeynmanset{compat=1.1.0}
\allowdisplaybreaks

\begin{document}

%all the missing code here is the code I pasted above which draws the feynman diagram%
\end{document}
3
  • 1
    Preamble should be loaded only relevant package, not all which you use in your document. Next time, please be so kind and provide small, complete document, starting with documentclass{...} and ending with end{document} and not two separate code snippets as is the case now. Help us to help you!
    – Zarko
    Feb 8, 2017 at 0:04
  • I understand what you are trying to say, but I would not know if some package I loaded is causing the problem, hence I would rather type all the packages I used in my code, so the problem could be better troubleshooted. Feb 8, 2017 at 0:07
  • 1
    You should suspect, that with your problem is related only one package (tikz-feynman) , since other have nothing with image. Constructing MWE many time discover problem with which you faced in your document.
    – Zarko
    Feb 8, 2017 at 0:41

1 Answer 1

6

You have to enclose the expression that contains the equality sign in braces, otherwise the equality sign is mixed up with the equality signs separating keywords and values.

[anti fermion, edge label={\(k'=k+q\)}]

enter image description here

\documentclass[border=2mm]{standalone}
\usepackage{tikz-feynman}
\begin{document}
    \begin{tikzpicture}
        \begin{feynman}
            \vertex (h1) ;
            \vertex at ($(h1) + (0.5cm, -1.0cm)$) (i1);
            \vertex at ($(i1) + (0.5cm, -1.0cm)$) (m1);
            \vertex at ($(m1) + (-0.5cm, -1.0cm)$) (i2);
            \vertex at ($(i2) + (-0.5cm, -1.0cm)$) (h2);
            \vertex [right= 2.5 cm of m1] (m2);
            \diagram* {
                (h1) -- [anti fermion, edge label=\(p'\)] (i1)
                     -- [anti fermion, edge label={\(k'=k+q\)}] (m1)
                     -- [anti fermion, edge label=\(k\)] (i2)
                     -- [anti fermion, edge label=\(p\)] (h2),
                (m2) -- [photon, momentum=q] (m1),
                (i2) -- [photon, half left, momentum=p-k] (i1),
            };
        \end{feynman}
    \end{tikzpicture}
\end{document}

You must log in to answer this question.

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