我正在尝试绘制像本文和tikz-feynman
:
我不知道如何让这些边从直线变成波浪形。我想我可以将它们分成两条边,但这样看起来很丑:
这是用
\documentclass[tikz]{standalone}
\usepackage{tikz-feynman}
\begin{document}
\feynmandiagram [layered layout, horizontal=b to c] {
a -- b -- [boson] c
-- [boson, quarter left] d -- [quarter left] e
-- [half left] c,
e -- [boson] f -- g,
};
\end{document}
答案1
请找到分析和两个可能的解决方案。第三个可以联系包裹的作者tikz-feynman
并索要组合粒子,不管那意味着什么。
解决方案 1:这错位来自此包使用的自动放置算法,该算法故意相当“愚昧”定位请求。详情请参阅此链接:https://tex.stackexchange.com/a/377291/245790以及截图右上部分的费曼图(已调整环形手册中的示例,使用中间点 bb)。
不幸的是,这个nail at
选项对我不起作用,而 起作用nudge down
了。为了协助进行手动调整,我设置了一个帮助网格来估计所需的微调。
解决方案 2:您始终可以使用 手动绘制此类图表tikz
(搜索此网站时您会找到许多示例)。请参阅费曼图下方的一些示例,并参考 pgf 手册中的第 24.4 章。虽然这些路径是直线,但您也可以使用弧线,选择您喜欢的箭头,并将它们放置在应有的位置。
\documentclass[10pt]{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing, decorations.pathreplacing, decorations.shapes}
\usepackage{tikz-feynman}
\begin{document}
\tikz{
% help grid
\draw[help lines] (0,0) grid (5,5);
% see placement problems at https://tex.stackexchange.com/a/377291/245790
\feynmandiagram [layered layout, horizontal=b to c] {
a -- [photon, momentum=\(p\)] b
-- [fermion, quarter left] bb [nudge down=1cm]% as suggested
-- [photon, quarter left, momentum=\(k\)] c
-- [fermion, half left, momentum=\(k-p\)] b,
c -- [photon, momentum=\(p\)] d,
};
% ~~~ for reference: adjustedloops example from manual ~~~~
\feynmandiagram [layered layout, horizontal=b to c] {
a -- [photon, momentum=\(p\)] b
-- [fermion, quarter left] bb% <<< intermediate coordinate
-- [photon, quarter left, momentum=\(k\)] c
-- [fermion, half left, momentum=\(k-p\)] b,
c -- [photon, momentum=\(p\)] d,
};
}
% ~~~ an alternative, doing it all manually ~~~~~~~~~~
% ~~~ allows you to introduce and place arrow tip as needed ~~~
% ~~~ path can also be an arc etc.
\begin{tikzpicture}
\draw (0, 2.5) -- (3, 2.5);% line
\draw [ decorate,
decoration={coil, aspect=0,
pre length=2cm}] % see chp. 24.4 in pgf-manual
(0, 2) -- (3, 2);% sin. w. pre length
\draw [ decorate,
decoration={coil, aspect=0,
pre length=1cm}]
(0, 1.5) -- (3, 1.5);% sin. w. pre length
\draw [ decorate,
decoration={coil, aspect=1}]
(0, 1) -- (3, 1);% extended spring
\draw [ decorate,
decoration={coil, aspect=0}]
(0, .5) -- (3, .5);% sinosoidal
\end{tikzpicture}
\end{document}