我正在使用tikz-feynman绘制费曼图的包。考虑以下图表
我使用以下代码绘制的:
\begin{center}
\begin{tikzpicture}
\begin{feynman}
\vertex (h1) ;
\vertex at ($(h1) + (0.5cm, -1.0cm)$) (i1);
\vertex at ($(i1) + (0.5cm, -1.0cm)$) (m1);
\vertex at ($(m1) + (-0.5cm, -1.0cm)$) (i2);
\vertex at ($(i2) + (-0.5cm, -1.0cm)$) (h2);
\vertex [right= 2.5 cm of m1] (m2);
\diagram* {
(h1) -- [anti fermion, edge label=\(p'\)] (i1) -- [anti fermion, edge label=\(k'k+q\)] (m1) -- [anti fermion, edge label=\(k\)] (i2) -- [anti fermion, edge label=\(p\)] (h2),
(m2) -- [photon, momentum=q] (m1),
(i2) -- [photon, half left, momentum=p-k] (i1),
};
\end{feynman}
\end{tikzpicture}
\end{center}
我无法将其中一条线标记为 k'=k+q。图中未显示等号。
你能帮我吗?
编辑:
代码扩展:
\documentclass{article}
\usepackage{amsmath,amsfonts,amsthm,amssymb}
\usepackage{setspace}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{extramarks}
\usepackage{chngpage}
\usepackage{soul}
\usepackage[usenames,dvipsnames]{color}
\usepackage{graphicx,float,wrapfig}
\usepackage{ifthen}
\usepackage{listings}
\usepackage{slashed}
\usepackage{courier}
\usepackage[utf8]{inputenc}
\usepackage[]{amsmath}
\usepackage[]{xcolor}
\usepackage[]{enumitem}
\usepackage[]{graphicx}
\usepackage{mathtools}
\usepackage{simplewick}
\usepackage{bbold}
\usepackage{bm}
\usepackage{tikz-feynman}
\tikzfeynmanset{compat=1.1.0}
\allowdisplaybreaks
\begin{document}
%all the missing code here is the code I pasted above which draws the feynman diagram%
\end{document}
答案1
您必须将包含等号的表达式括在括号中,否则等号会与分隔关键字和值的等号混淆。
[anti fermion, edge label={\(k'=k+q\)}]
\documentclass[border=2mm]{standalone}
\usepackage{tikz-feynman}
\begin{document}
\begin{tikzpicture}
\begin{feynman}
\vertex (h1) ;
\vertex at ($(h1) + (0.5cm, -1.0cm)$) (i1);
\vertex at ($(i1) + (0.5cm, -1.0cm)$) (m1);
\vertex at ($(m1) + (-0.5cm, -1.0cm)$) (i2);
\vertex at ($(i2) + (-0.5cm, -1.0cm)$) (h2);
\vertex [right= 2.5 cm of m1] (m2);
\diagram* {
(h1) -- [anti fermion, edge label=\(p'\)] (i1)
-- [anti fermion, edge label={\(k'=k+q\)}] (m1)
-- [anti fermion, edge label=\(k\)] (i2)
-- [anti fermion, edge label=\(p\)] (h2),
(m2) -- [photon, momentum=q] (m1),
(i2) -- [photon, half left, momentum=p-k] (i1),
};
\end{feynman}
\end{tikzpicture}
\end{document}