我想创建一个类似于下图的费曼图:
但是,我不太清楚这个过程。我特别感兴趣的是捕捉图表的结构,而不是箭头样式。您能提供如何实现这一点的指导吗?
我尝试过改变这个,但是失败了:
\begin{tikzpicture}
\begin{feynman}
\diagram [vertical'=a to b] {
i1
-- [scalar] a [small, dot]
-- [draw=none] f1 ,
a -- [scalar] b [small, dot,],
i2
-- [draw=none] b
-- [scalar] f2,
};
\diagram* {
(i2) -- [scalar] (a),
(f1) -- [scalar] (b),
};
\end{feynman}
\end{tikzpicture}
生成结果:
答案1
这是一种从头开始执行的方法,无需任何 feynman 包。
主要步骤:
- 确定坐标(将你的截图保存为
udiag.png
) - 通过第一个简单的绘图检查并调整坐标
- 绘制所有连接,包括圆弧
- 在后续动作中使用装饰标记来放置箭头
如果愿意,您可以编写更密集的代码。但是,我更喜欢让它易于理解……这对于初学者来说已经有点难以理解了tikz
。
\documentclass[10pt,border=3mm,tikz]{standalone}% 1 page per tikzpicture
\usepackage{graphicx}% to include the sketch
\usepackage{tikz}% Tikz
\usetikzlibrary{arrows.meta,% for arrow shapes
decorations.markings}% to position arrows on path
\begin{document}
% ~~~ let's identify coordinates ~~~
\tikz{
\node {\includegraphics{udiag}};
\draw (-5,-4) grid (5,5);
}
% ~~~ test the coordinates ~~~~~~~
\tikz{
\coordinate (A) at (0,0);
\coordinate (B) at (3,4);
\coordinate (C) at (10,8);
\coordinate (D) at (10,0);
\coordinate (E) at (7,4);
\coordinate (F) at (0,8);
\draw (A) node{A} -- (B)node{B} -- (C)node{C};
\draw (D)node{D} -- (E)node{E} -- (F)node{F};
}
% ~~~ let's do some more ~~~~~~~
\tikz[
dash pattern=on 6mm off 4.1mm,% adjusted dash pattern
line width=2pt,% adjusted linewidth
]{
\coordinate (A) at (0,0);
\coordinate (B) at (3,4);
\coordinate (C) at (10,8);
\coordinate (D) at (10,0);
\coordinate (E) at (7,4);
\coordinate (F) at (0,8);
% ~~~ lines, semi circle and dots ~~~~~~~~~~~~~~~~
\draw (A) -- (B) -- (C);
\draw (D) -- (E) -- (F);
\draw (B) -- (E) arc[start angle=0, end angle=-180,radius=2];
% ~~~ overwriting the dash pattern defined above for the circles ~~~
\draw[fill=black,solid] (B) circle[radius=2.5mm]
(E) circle[radius=2.5mm];
}
% ~~~ finalizing with markings and postactions ~~~~~~~
\tikz[
dash pattern=on 6mm off 4.1mm,% adjusted dash pattern
line width=2pt,% adjusted linewidth
decoration={
markings,
mark=at position .25 with {\arrow{Triangle[length=1cm]}} ,
mark=at position .75 with {\arrow{Triangle[length=1cm]}} ,
}
]{
\coordinate (A) at (0,0);
\coordinate (B) at (3,4);
\coordinate (C) at (10,8);
\coordinate (D) at (10,0);
\coordinate (E) at (7,4);
\coordinate (F) at (0,8);
% ~~~ lines, semi circle and dots; arrows-decoration ~~~~~~~~~~~~~~~~
\draw[postaction={decorate}] (A) -- (B) -- (C);
\draw[postaction={decorate}] (D) -- (E) -- (F);
\draw (B) -- (E) arc[start angle=0, end angle=-180,radius=2];
% ~~~ overwriting the dash pattern defined above for the circles ~~~
\draw[fill=black,solid] (B) circle[radius=2.5mm]
(E) circle[radius=2.5mm];
}
\end{document}