I want to draw a Feynman Diagram, for this I have written this code.

\documentclass[a4paper,12pt, border=5mm]{standalone}
\usetikzlibrary{decorations, decorations.markings, decorations.pathmorphing, arrows, graphs, graphdrawing, shapes.geometric, snakes}
\usegdlibrary{trees,force, layered}

\pgfdeclaredecoration{complete sines}{initial}
        next state=sine,
        persistent precomputation={\pgfmathsetmacro\matchinglength{
            \pgfdecoratedinputsegmentlength / int(\pgfdecoratedinputsegmentlength/\pgfdecorationsegmentlength)}
            \setlength{\pgfdecorationsegmentlength}{\matchinglength pt}
        }] {}

        decoration={complete sines, amplitude=0.15cm, segment length=0.2cm},
            mark=at position 0.5 with {\node[transform shape, xshift=-0.5mm, fill=black, inner sep=1pt, draw, isosceles triangle]{};}
        decoration={coil, aspect=0.75, mirror, segment length=1.5mm},
        bend left=90,

\graph [spring layout, anchor at={(0,-4)}, nodes=coordinate, vertical= a to d, vertical= e to f]
a -- [fermion, edge label={\tiny{$\nu_{\mu/\tau}$}}] b,
c -- [fermion, edge label={{\tiny{$\nu_{\mu/\tau}$}}}] a,
a -- [photon, edge label={\tiny{$Z'$}}] d -- [left, fermion, edge label={\tiny{$\mu^-/\tau^-$}}] e -- [left, fermion, edge label={\tiny{$\mu^-/\tau^-$}}] d,
e -- [photon, edge label={\tiny{$\gamma$}}] f,
g-- [fermion, edge label={\tiny{$p$}}] f,
f -- [fermion, edge label={\tiny{$p$}}] h;


Output is:

enter image description here

But the labeling is looking not so good, especially the $\nu_{\mu/\tau}$ (It would be better if the labeling of $\nu_{\mu/\tau}$ fermion line is looking like the labeling of $p$ line). Also the text size of the labeling is very big.

Can anyone please help me to resolve these problems?


1 Answer 1


Here's a simplified version for the scatter-event, which started with the simplified spring layout:

\feynmandiagram [vertical = c to f] {
    {a,b} -- c -- d -- e -- f -- {g,h};

In the left screenshot I marked the points in your drawing. The right one is produced by the code below.

For now it just drops the arrows for simplicity. You could work them in by splitting up the structure, e.g. like I did with the missing half arc. Looks like one shouldn't take the terms (fermion, boson etc.) too literally and use them more to obtain the desired drawing. That's why I used "fermions" for the lepton-circle.


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



\feynmandiagram [vertical = c to f] {
%   {a,b} -- c -- d -- e -- f -- {g,h}; % basic structure

    {   a [particle=\(\nu_\mu / \tau\)] ,% R
        b [particle=\(\nu_\mu / \tau\)] % L
    -- c 
    -- [boson, edge label=\(Z^{'}\)] d 
    -- [fermion, half left, edge label=\(\mu^{-}/\tau^{-}\)] e 
    -- [photon, edge label=\(\gamma\)] f 
    -- {g [particle=\(p\)],h [particle=\(p\)]};
    % adding the missing half-loop
    e -- [fermion, half left, edge label=\(\mu^{-}/\tau^{-}\)] d;


You must log in to answer this question.

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