1

Consider the folowing code:

\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-feynman}
\begin{document}
\begin{tikzpicture}[baseline=(current  bounding  box.center)]
\begin{feynman}
\vertex (x);
\vertex[right=of x] (y);
\vertex[above left=of x] (a);
\vertex[below left=of x] (b);
\vertex[above right=of y] (c);
\vertex[below right=of y] (d);

\diagram*{
    (x) --[fermion, half left] (y)
    (x) --[fermion, half right] (y)
    (x) --[fermion] (a)
    (x) --[fermion] (b)
    (y) --[fermion] (c)
    (y) --[fermion] (d)
};
\end{feynman}
\end{tikzpicture}
\end{document}

The output is enter image description here

but what I desired is the below one!

enter image description here

It seems that the half right command is not working. How can I fix this issue?

1 Answer 1

3

You forgot the comma's after each edge in in \diagram*.

MWE:

\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-feynman}
\begin{document}
\begin{tikzpicture}[baseline=(current  bounding  box.center)]
\begin{feynman}
\vertex (x);
\vertex[right=of x] (y);
\vertex[above left=of x] (a);
\vertex[below left=of x] (b);
\vertex[above right=of y] (c);
\vertex[below right=of y] (d);

\diagram*{
    (x) --[fermion, half left] (y),
    (x) --[fermion, half right] (y),
    (x) --[fermion] (a),
    (x) --[fermion] (b),
    (y) --[fermion] (c),
    (y) --[fermion] (d),
};
\end{feynman}
\end{tikzpicture}
\end{document}

Result:

enter image description here

You must log in to answer this question.

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