3

How can I draw curved lines outside the main diagram?

enter image description here

I've already drawn the diagram (white), but I need to add the red curved lines, how can I do it? My (amazing) code is, compiled with LuaLaTeX, and using atom with the LaTex package I get this diagram, which is different from the diagram generated on overleaf using the same code:

\documentclass{standalone}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}

    \begin{tikzpicture}
        \begin{feynman}
            \vertex (a);
            \vertex (b);
            \vertex (c);
            \vertex (d);
            \vertex (e);
            \diagram[thick, horizontal= a to e]{
                a -- [fermion]b[dot],
                c--[anti fermion]b,
                d--[anti fermion]b,
                e--[fermion]b,
            };
            \vertex[below=1em of a]{$a$};
            \vertex[below=1em of b]{$b$};
            \vertex[below=1em of c]{$c$};
            \vertex[below=1em of d]{$d$};
            \vertex[below=1em of e]{$e$};

        \end{feynman}
    \end{tikzpicture}
\end{document}

and this it is my output:

enter image description here

6
  • 2
    Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Aug 22, 2021 at 17:16
  • 3
    You also need to keep your code minimal to a certain extend. Surely externalisation and beautiful colors are not relevant for your problem!? tex.meta.stackexchange.com/questions/228/… Aug 22, 2021 at 18:00
  • 2
    Remove duplicate packages from preamble and check if your code compiles. Aug 22, 2021 at 19:00
  • 2
    @john: with this preamble (removing duplicate packages), your code work \documentclass{standalone} \usepackage{tikz} \usepackage[compat=1.1.0]{tikz-feynman} \begin{document} However, it gives a picture that is much different with the picture you posted.
    – Black Mild
    Aug 22, 2021 at 19:42
  • 1
    @BlackMild Excuse me. I have read now your message. I was improving the code of the user.
    – Sebastiano
    Aug 22, 2021 at 19:47

2 Answers 2

2

Compile with LuaLaTeX

\documentclass[tikz, border=1cm]{standalone}
\pagecolor{black}
\usetikzlibrary{calc}
\usepackage[]{tikz-feynman}
\begin{document}
    \begin{tikzpicture}[rotate=45, white]
        \begin{feynman}
            \vertex (a);
            \vertex (b);
            \vertex (c);
            \vertex (d);
            \vertex (e);
            \diagram[thick, horizontal= a to e]{
                a -- [fermion]b[dot],
                c--[anti fermion]b,
                d--[anti fermion]b,
                e--[fermion]b,
            };
            \vertex[below=1em of a]{$a$};
            \vertex[below=1em of b]{$b$};
            \vertex[below=1em of c]{$c$};
            \vertex[below=1em of d]{$d$};
            \vertex[below=1em of e]{$e$};
            \draw[->, thick, red, shorten <=0.4 cm, shorten >=0.4 cm] ($ (a)!0.1!(c) $) to[out=0, in=270] ($ (a)!0.9!(c) $) ;     
            \draw[->, thick, red, shorten <=0.4 cm, shorten >=0.4 cm] ($ (d)!0.1!(e) $) to[out=90, in=180] ($ (d)!0.9!(e) $) ;     
        \end{feynman}
    \end{tikzpicture}
\end{document}

Feynman diagram with two curved arrows

4
  • This looks like what I need. Later I'll try and let you know. The command "draw" is from tikz right? So I can look at documentation
    – john
    Aug 23, 2021 at 10:36
  • Yes feynman is within TikZ, so everything works the same. You can also use the solution from @Black Mild, you just need to shift the \draw to the correct position e.i. centered at (b). Aug 23, 2021 at 10:57
  • I tried to compile, with LuaLatex using atom, but I get this (removed the color) imgur.com/a/OOfTKpK . I'm start thinking the problem is with my editor and the compiler, since I had problems also with vertex positioning. I'll try it on overleaf too
    – john
    Aug 23, 2021 at 11:50
  • Apparently the problem was with my setup: I installed only "LaTex core", which probably didn't contained all the necessary packages. Anyway now it work, thank you very much!
    – john
    Aug 23, 2021 at 16:32
3

A quick solution.

enter image description here

\documentclass[tikz,border=5mm]{standalone}
\pagecolor{black}
\begin{document}
\begin{tikzpicture}[scale=.5,thick,rotate=-45,cap=rect]
\foreach \i in {0,1,2,3}{
\begin{scope}[rotate=90*\i,white]
\draw[->] (0,0)--(2,0);
\draw (2,0)--(3.5,0);   
\end{scope}
}

\begin{scope}[red,smooth]
\draw[<-] plot[domain=1/3:3] (\x,1/\x);     
\draw[->] plot[domain=-1/3:-3] (\x,1/\x);   
\end{scope}
\end{tikzpicture}
\end{document}
1
  • Looks nice, but I need to do it using the "tikz-feynman" package. Also, colors are just here to make clear what I've already drawn and what I need to draw. I'll compile at the end with my own colors.
    – john
    Aug 23, 2021 at 8:08

You must log in to answer this question.

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