I want to draw a Feynman Diagram, for this I have written this code.
\documentclass[a4paper,12pt, border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations, decorations.markings, decorations.pathmorphing, arrows, graphs, graphdrawing, shapes.geometric, snakes}
\usegdlibrary{trees,force, layered}
\pgfdeclaredecoration{complete sines}{initial}
{
\state{initial}[
width=+0pt,
next state=sine,
persistent precomputation={\pgfmathsetmacro\matchinglength{
\pgfdecoratedinputsegmentlength / int(\pgfdecoratedinputsegmentlength/\pgfdecorationsegmentlength)}
\setlength{\pgfdecorationsegmentlength}{\matchinglength pt}
}] {}
\state{sine}[width=\pgfdecorationsegmentlength]{
\pgfpathsine{\pgfpoint{0.25\pgfdecorationsegmentlength}{0.5\pgfdecorationsegmentamplitude}}
\pgfpathcosine{\pgfpoint{0.25\pgfdecorationsegmentlength}{-0.5\pgfdecorationsegmentamplitude}}
\pgfpathsine{\pgfpoint{0.25\pgfdecorationsegmentlength}{-0.5\pgfdecorationsegmentamplitude}}
\pgfpathcosine{\pgfpoint{0.25\pgfdecorationsegmentlength}{0.5\pgfdecorationsegmentamplitude}}
}
\state{final}{}
}
\tikzset{
photon/.style={
decoration={complete sines, amplitude=0.15cm, segment length=0.2cm},
decorate
},
fermion/.style={
decoration={
markings,
mark=at position 0.5 with {\node[transform shape, xshift=-0.5mm, fill=black, inner sep=1pt, draw, isosceles triangle]{};}
},
postaction=decorate
},
gluon/.style={
decoration={coil, aspect=0.75, mirror, segment length=1.5mm},
decorate
},
left/.style={
bend left=90,
looseness=1.75
}
}
\begin{document}%
\begin{tikzpicture}
\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;
};
\end{tikzpicture}
\end{document}
Output is:
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?