Tikz-Feynman:强制不同的边平行

Tikz-Feynman:强制不同的边平行

我的代码目前是:

\feynmandiagram[layered layout, horizontal=i1 to f1] {
    i1 [particle=\(\mu^{-}\)] -- [fermion] a -- [fermion] f1 [particle=\(\nu_{\mu}\)],
    i2 [particle=\(u\)] -- [fermion] b -- [fermion] f2 [particle=\(d\)],
    i3 [particle=\(u\)] -- [fermion] f3 [particle=\(u\)],
    i4 [particle=\(d\)] -- [fermion] f4 [particle=\(d\)],
    {[same layer] a -- [boson, edge label='\(W^{-}\)] b},
};

输出结果如下:

在此处输入图片描述

不过,我更想做的事情是: 在此处输入图片描述

我该如何做呢?

答案1

left=我使用 TikZ 顶点来更精确地定义元素的位置。您可以尝试使用、right=和的值below=来根据需要调整图形。

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

\begin{document}
\begin{tikzpicture}
  \begin{feynman}
  % define vertices
    % first line
    \vertex (mu-) {\(\mu^{-}\)};
    \vertex [right=4em of mu-.east] (f1);
    \vertex [right=0em of f1] (b1);
    \vertex [right=8em of f1] (numu) {\(\nu_{\mu}\)};
    \vertex [left=4em of numu.west] (f2);

    % second line
    \vertex [below=4em of mu-.east, anchor=east] (u) {$u$};
    \vertex [below=4em of numu.west, anchor=west] (d) {$d$};
    \vertex [right=4em of u.east] (f3);
    \vertex [left=7em of d.west] (f4);
    \vertex [right=2em of f4.west] (b2);
    
    % third line
    \vertex [below=2em of u.east, anchor=east] (u1) {$u_1$};
    \vertex [below=2em of d.west, anchor=west] (d1) {$d_1$};
   
    % fourth line
    \vertex [below=2em of u1.east, anchor=east] (u2) {$u_2$};
    \vertex [below=2em of d1.west, anchor=west] (d2) {$d_2$};
    
    \diagram* {
      (mu-) -- [fermion] (f1) -- (f2) -- [fermion] (numu),
      (u) -- [fermion] (f3) -- (f4) --[fermion] (d),
      (b1) -- [boson, edge label'=\(W^{-}\)] (b2), 
      (u1) -- [fermion] (d1),
      (u2) -- [fermion] (d2),
    };
  \end{feynman}
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容