我正在尝试使用 Latex 中的 TikZ-Feynman 包创建 Feynman-Diagra。
有没有办法调整 TikZ 中动量箭头的位置?目前,光子线的两个动量箭头在图中重叠,看起来不太好看。我想让动量箭头更靠近光子线的边缘。我该怎么做?
\begin{tikzpicture}
\begin{feynman}
\diagram [baseline={(current bounding box.center)},vertical'=a to b] {
i1[particle=\(e^{-}\)] -- [anti fermion, rmomentum'={[arrow style=white,label style=black]\(p^\prime\)}]
a -- [draw=none]
f1[nudge=(-45:0.5cm),particle=\(\gamma\)],
a -- [anti fermion, rmomentum'={[arrow style=white,label style=black]\(p-k^\prime\)}] b,
i2[particle=\(e^{-}\)] -- [fermion,rmomentum={[arrow style=white,label style=black]\(p\)}]
b -- [draw=none]
f2[nudge=(45:0.5cm), particle=\(\gamma\)], };
\diagram* {
(a) -- [photon,rmomentum={[arrow shorten=0.15mm,arrow distance=3mm]\(k\)}] (f2),
(b) -- [photon,momentum'={[arrow shorten=0.15mm,arrow distance=3mm]\(k\)}] (f1),
};
\end{feynman}
\end{tikzpicture}
答案1
我觉得有点拖延,所以就开始吧。
如果你用宏手动定义坐标,这很容易\vertex
。(见第 2.4.3 节手动放置请参阅手册中的说明,以供参考。)
\documentclass{article}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}
\begin{tikzpicture}[
arrowlabel/.style={
/tikzfeynman/momentum/.cd, % means that the following keys are read from the /tikzfeynman/momentum family
arrow shorten=#1,arrow distance=1.5mm
},
arrowlabel/.default=0.4
]
\begin{scope}[local bounding box=part A]
\begin{feynman}
% first define the coordinates
\vertex (a);
\vertex [right=of a] (b1);
\vertex [above=1cm of b1] (b2);
\vertex [above=1cm of b2] (b3);
\vertex [above=1cm of b3] (b4);
\vertex [right=of b4] (c);
% then draw connections
\diagram* {
(a) -- [boson, momentum={[arrowlabel]$k$}] (b2),
(b1) -- [fermion, edge label'=$p$] (b2)
-- [fermion, edge label'=$p+k$] (b3)
-- [fermion, edge label=$p'$] (b4),
(b3) -- [boson, momentum'={[arrowlabel]$k'$}] (c),
};
\end{feynman}
\end{scope}
\node [right=3mm of part A] (plus) {$+$};
\begin{scope}[local bounding box=part B, shift={([xshift=3mm]plus.east |- part A.south)}]
\begin{feynman}
\vertex (a);
\vertex [right=of a] (b1);
\vertex [above=1cm of b1] (b2);
\vertex [above=1cm of b2] (b3);
\vertex [above=1cm of b3] (b4);
\vertex [right=of b4] (c);
\diagram* {
(a) -- [boson, momentum={[arrowlabel=0.42]$k$}] (b3),
(b1) -- [fermion, edge label'=$p$] (b2)
-- [fermion] (b3)
-- [fermion, edge label=$p'$] (b4),
(b2) -- [boson, momentum'={[arrowlabel=0.42]$k'$}] (c),
};
\end{feynman}
\end{scope}
\end{tikzpicture}
\end{document}