# Feynman-diagram with tikz - vertically

I have a Feynman diagram. Is it possible to make the time arrow (right in the image) some centimeters from the Feynman-diagram? And is it possible to make the \draw[fermion] longer and the node above smaller?

Code is based on an answer from Harish Kumar.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\usepackage{pgfplots}
\usepackage{xparse}
\usepackage[left=1cm,right=1cm,top=2cm,bottom=2cm]{geometry}

\usetikzlibrary{positioning,arrows,patterns}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{calc}

\tikzset{
photon/.style={decorate, decoration={snake}, draw=black},
fermion/.style={draw=black, postaction={decorate},decoration={markings,mark=at position .55 with {\arrow{>}}}},
}

\begin{document}
\pagestyle{empty}

\iffalse
\begin{equation*}
\left ( 2 \pi \right )^4 \int \left [ \bar{v}^{(s_2)} \left ( p _3 \right ) \left (i \sqrt{4 \pi \alpha}\gamma^\mu \right ) v^{(s_1)} \left ( p _1 \right ) \right ] \frac{i g_{\mu\nu}}{q^2} \left [ \bar{v}^{(s_4)} \left ( p _4 \right ) \left ( i \sqrt{4 \pi \alpha}\gamma^\mu \right ) v^{(s_2)} \left ( p _2 \right ) \right ] \times \delta ^{(4)} \left (p _1 - p _3 - q \right ) \delta ^{(4)} \left ( p _2 + q - p _4 \right ) d^4 q
\end{equation*}
\fi

\begin{figure}
\centering
\begin{tikzpicture}[node distance=1cm and 1cm]
\coordinate[] (v1);
\coordinate[right=of v1] (v2);
\coordinate[right=of v2] (v3);
\coordinate[right=of v3] (v4);
\coordinate[above right=of v4,label=right:$\mu$] (f1);
\coordinate[below right=of v4,label=right:$\mu$] (f2);
\coordinate[above left =of v1,label=left :$e$] (e1);
\coordinate[below left =of v1,label=left :$e$] (e2);
%The fermion
\draw[fermion] (v1) -- (e1) node[midway, sloped, above=0.1cm] {$p_3, s_3$};
\draw[fermion] (e2) -- (v1) node[midway, sloped, below=0.1cm] {$p_1, s_1$};
\draw[fermion] (v4) -- (f1) node[midway, sloped, above=0.1cm] {$p_4, s_4$};
\draw[fermion] (f2) -- (v4) node[midway, sloped, below=0.1cm] {$p_2, s_2$};
%The proton
\draw[photon] (v1) -- (v4) node[midway,below=0.1cm] {$\gamma$} node[midway, above=0.1cm]{$q$};
%the timeline
\draw[arrows=->,line width=1.2pt] (f2) -- (f1) node[midway, sloped, above=-0.05cm, rotate=180] {time};
\end{tikzpicture}
\end{figure}

\end{document}


Kind regards!

You have to adjust the dimensions in

\coordinate[above right= 3cm and 3cm of v4,label=right:$\mu$] (f1);
\coordinate[below right= 3cm and 3cm of v4,label=right:$\mu$] (f2);
\coordinate[above left = 3cm and 3cm of v1,label=left :$e$] (e1);
\coordinate[below left = 3cm and 3cm of v1,label=left :$e$] (e2);


to make \draw[fermion] longer. To make node text smaller, use font=\footnotesize (or any size). Further to shift the time arrow use xshift as in

\draw[arrows=->,line width=1.2pt,] ([xshift=1cm]f2) -- ([xshift=1cm]f1) node[midway, sloped, above=-0.05cm, rotate=180] {time};


Code:

\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\usepackage{pgfplots}
\usepackage{xparse}
\usepackage[left=1cm,right=1cm,top=2cm,bottom=2cm]{geometry}

\usetikzlibrary{positioning,arrows,patterns}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{calc}

\tikzset{
photon/.style={decorate, decoration={snake}, draw=black},
fermion/.style={draw=black, postaction={decorate},decoration={markings,mark=at position .55 with {\arrow{>}}}},
}

\begin{document}

\begin{figure}
\centering
\begin{equation*}
\left ( 2 \pi \right )^4 \int \left [ \bar{v}^{(s_2)} \left ( p _3 \right ) \left (i \sqrt{4 \pi \alpha}\gamma^\mu \right ) v^{(s_1)} \left ( p _1 \right ) \right ] \frac{i g_{\mu\nu}}{q^2} \left [ \bar{v}^{(s_4)} \left ( p _4 \right ) \left ( i \sqrt{4 \pi \alpha}\gamma^\mu \right ) v^{(s_2)} \left ( p _2 \right ) \right ] \times \delta ^{(4)} \left (p _1 - p _3 - q \right ) \delta ^{(4)} \left ( p _2 + q - p _4 \right ) d^4 q
\end{equation*}

\begin{tikzpicture}[node distance=1cm and 1cm]
\coordinate[] (v1);
\coordinate[right=of v1] (v2);
\coordinate[right=of v2] (v3);
\coordinate[right= of v3] (v4);
\coordinate[above right= 3cm and 3cm of v4,label=right:$\mu$] (f1);
\coordinate[below right= 3cm and 3cm of v4,label=right:$\mu$] (f2);
\coordinate[above left = 3cm and 3cm of v1,label=left :$e$] (e1);
\coordinate[below left = 3cm and 3cm of v1,label=left :$e$] (e2);
\draw[fermion] (v1) -- (e1) node[midway, sloped, above=0.1cm,font=\footnotesize] {$p_3, s_3$};
\draw[fermion] (e2) -- (v1) node[midway, sloped, below=0.1cm,font=\footnotesize] {$p_1, s_1$};
\draw[photon] (v1) -- (v4) node[midway,below=0.1cm] {$\gamma$} node[midway, above=0.1cm]{$q$};
\draw[fermion] (v4) -- (f1) node[midway, sloped, above=0.1cm,font=\footnotesize] {$p_4, s_4$};
\draw[fermion] (f2) -- (v4) node[midway, sloped, below=0.1cm,font=\footnotesize] {$p_2, s_2$};
\draw[arrows=->,line width=1.2pt,] ([xshift=1cm]f2) -- ([xshift=1cm]f1) node[midway, sloped, above=-0.05cm, rotate=180] {time};
\end{tikzpicture}
\end{figure}

\end{document}


• @BasiliusSapientia You are welcome. :-) – user11232 Mar 11 '15 at 1:02