费曼图绘制

费曼图绘制

所以我使用 Jaxodraw 来制作费曼图。我从 Jaxodraw 导出的代码如下:

\documentclass[a4paper]{article}

\usepackage{axodraw4j}
\usepackage{pstricks}
\usepackage{color}
\usepackage{amsmath}
\usepackage{amssymb}

\setlength{\oddsidemargin}{0pt}
\setlength{\evensidemargin}{0pt}
\setlength{\topmargin}{0pt}
\setlength{\headheight}{0pt}
\setlength{\headsep}{0pt}
\setlength{\topskip}{0pt}
\setlength{\footskip}{0pt}
\setlength{\textwidth}{\paperwidth}
\addtolength{\textwidth}{-2in}
\setlength{\textheight}{\paperheight}
\addtolength{\textheight}{-2in}

\pagestyle{empty}



\begin{document}

%%JaxoComment:
%%JaxoScale{1.0}


\begin{center}
\fcolorbox{white}{white}{
  \begin{picture}(596,144) (110,-139)
    \SetWidth{1.0}
    \SetColor{Black}
    \COval(160,-80)(32,32)(0){Black}{White}
    \COval(352,-80)(32,32)(0){Black}{White}
    \COval(528,-80)(32,32)(0){Black}{White}
    \COval(656,-80)(32,32)(0){Black}{White}
    %
    % There is a postscript text here!
    % There is a postscript text here!
    \SetWidth{1.5}
    \Line[arrow,arrowpos=0.5,arrowlength=8.833,arrowwidth=3.533,arrowinset=0.2](184,-57)(208,-32)
    \Line[arrow,arrowpos=0.5,arrowlength=8.833,arrowwidth=3.533,arrowinset=0.2](182,-104)(208,-128)
    \Line[arrow,arrowpos=0.5,arrowlength=8.833,arrowwidth=3.533,arrowinset=0.2](112,-128)(138,-104)
    \Line[arrow,arrowpos=0.5,arrowlength=10.5,arrowwidth=4.2,arrowinset=0.2](112,-32)(137,-57)
    \Line[arrow,arrowpos=0.5,arrowlength=10.5,arrowwidth=4.2,arrowinset=0.2](376,-57)(400,-32)
    \Line[arrow,arrowpos=0.5,arrowlength=9,arrowwidth=3.6,arrowinset=0.2](375,-103)(400,-128)
    \Line[arrow,arrowpos=0.5,arrowlength=9,arrowwidth=3.6,arrowinset=0.2](304,-128)(331,-104)
    \Line[arrow,arrowpos=0.5,arrowlength=9,arrowwidth=3.6,arrowinset=0.2](304,-32)(329,-58)
    \Line[arrow,arrowpos=0.5,arrowlength=10.5,arrowwidth=4.2,arrowinset=0.2](480,-32)(504,-57)
    \Line[arrow,arrowpos=0.5,arrowlength=9,arrowwidth=3.6,arrowinset=0.2](480,-128)(505,-103)
    \Line[arrow,arrowpos=0.5,arrowlength=10.5,arrowwidth=4.2,arrowinset=0.2](679,-57)(704,-32)
    \Line[arrow,arrowpos=0.5,arrowlength=9,arrowwidth=3.6,arrowinset=0.2](679,-103)(704,-128)
    \Arc[arrow,arrowpos=0.5,arrowlength=10,arrowwidth=4,arrowinset=0.2,clock](592,-78.12)(46.12,152.746,27.254)
    \Arc[arrow,arrowpos=0.5,arrowlength=9,arrowwidth=3.6,arrowinset=0.2](592,-81.88)(46.12,-152.746,-27.254)
    \Text(112,-144)[lb]{\Large{\Black{$p_2$}}}
    \Text(208,-144)[lb]{\Large{\Black{$p_4$}}}
    \Text(112,-16)[lb]{\Large{\Black{$p_1$}}}
    \Text(208,-32)[lb]{\Large{\Black{$p_3$}}}
  \end{picture}
}
\end{center}

\end{document}

我运行该程序时唯一显示的是不同的 p。有人对如何显示图表有什么建议吗?

答案1

您可能使用 生成了 PDF pdflatex。要使图表正常工作,我相信您必须使用 ,latex然后dvips使用ps2pdf。具体如何操作取决于您的编辑器,如果您使用命令行编译文档,则需要执行

latex filename.tex
dvips filename.dvi
ps2pdf filename.ps

生成的 PDF 应该包含如下图表:

在此处输入图片描述

需要注意以下几点:

  • 该图表对于页面来说太宽了,因此您应该稍微缩小一点。(我不知道 Jaxodraw,所以不知道该怎么做。)
  • p_2看起来p_4有点奇怪的原因是它们被覆盖了\fcolorbox,所以我会将其删除。
  • \Large不接受参数,应该将其用作{\Large text},而不是\Large{text}
  • 一般来说,不要手动设置所有不同的边距\textwidth等,而是使用geometry包。请参阅设置精确边距举个例子。

如果您想避免通过 DVI 和 PostScript 来获取 PDF,您应该查看其他用于生成图表的软件包,例如tikztikz-feynman

答案2

这不是对你问题的回答,只是按照 Torbjørn T. 的建议做:用 tikz-feynman 重新绘制。好吧,差点,我真的无法画出一个顶点处有三条费米子线相交的图,所以我用胶子代替了一些直线。还要注意的是,你确实不是需要用 lualatex 来编译。尽管我非常尊重 Joshua Ellis 在自动放置方面所做的工作,但我发现在实践中,当图表变得更加复杂时,它往往不会产生很好的输出。

在此处输入图片描述

\documentclass[a4paper]{article}
\usepackage{tikz-feynman}
\usetikzlibrary{arrows.meta,bending}
\tikzfeynmanset{compat=1.0.0}
\begin{document}
\begin{tikzpicture}[>={[inset=0,length=8,angle'=30,bend]Stealth}, line width=.7pt]
\begin{feynman}
            \vertex (a1);
            \vertex[below right= 1.12 cm of a1](a2);
            \vertex[below=4cm of a1] (b1);
            \vertex[right= 2.12 cm of a2](a3);
            \vertex[below= 2.12 cm of a2](a4);
            \vertex[above right = 1.12 cm of a3] (a7);
            \vertex[below right=3cm of a2] (a5); 
            \vertex[below right = 1.12 cm of a5] (b2);
            \diagram* {
            (a1) -- [gluon,momentum'={[arrow style=blue]\(p_1\)}] (a2)
                -- [fermion, quarter left] (a3)
                -- [fermion, quarter left] (a5)
                -- [fermion, quarter left] (a4)
                -- [fermion, quarter left] (a2),
                (b1) -- [gluon,momentum'={[arrow style=blue]\(p_2\)}] (a4),
                (a3) -- [gluon,momentum'={[arrow style=blue]\(p_3\)}] (a7),        
                (a5) -- [gluon,momentum'={[arrow style=blue]\(p_4\)}] (b2)        
            };
\end{feynman}
\begin{feynman}[xshift=5cm]
            \vertex (a1);
            \vertex[below right= 1.12 cm of a1](a2);
            \vertex[below=4cm of a1] (b1);
            \vertex[right= 2.12 cm of a2](a3);
            \vertex[below= 2.12 cm of a2](a4);
            \vertex[below right=3cm of a2] (a5); 
            \vertex[right=2cm of a5] (a6); 
            \vertex[right=3cm of a3] (r3);
            \vertex[right=3cm of a5] (r5);
            \vertex[right=2cm of r3] (r2);
            \vertex[right=2cm of r5] (r4);
            \vertex[above right= 1.12 cm of r2](f1);
            \vertex[below right= 1.12 cm of r4](f2);
            \diagram* {
            (a1) -- [gluon,momentum'={[arrow style=blue]\(p_1\)}] (a2)
                -- [fermion, quarter left] (a3)
                -- [fermion, quarter left] (a5)
                -- [fermion, quarter left] (a4)
                -- [fermion, quarter left] (a2),
                (b1) -- [gluon,momentum'={[arrow style=blue]\(p_2\)}] (a4),
                 (a3) -- [gluon,quarter left] (r3),        
                 (a5) -- [gluon,quarter right] (r5)
                 -- [fermion, quarter left] (r3)
                -- [fermion, quarter left] (r2)
                -- [fermion, quarter left] (r4)
                -- [fermion, quarter left] (r5),
                (r2) -- [gluon,momentum'={[arrow style=blue]\(p_3\)}] (f1),        
                (r4) -- [gluon,momentum'={[arrow style=blue]\(p_4\)}] (f2)        
            };
\end{feynman}
\end{tikzpicture}
\end{document}

答案3

首先,我建议你看一下这个有趣的文档:http://mirror.ibcp.fr/pub/CTAN/graphics/axodraw/axodraw.pdf

其次,您还可以测试我的 LaTeX 代码。

    \documentclass[a4paper]{article}
    \usepackage{axodraw4j}
    \usepackage{pstricks}
    \usepackage{xcolor}
    \usepackage{amsmath}
    \usepackage{amssymb}
    \usepackage{tikz} % I use it to place a grid with tikz grid command
    \pagestyle{empty}

    \begin{document}
    \begin{center}\begin{picture}(300,56)(0,0)
    \Vertex(180,10){1.5}
    \Vertex(120,10){1.5}
    \SetColor{Red}
    \ArrowLine(100,10)(200,10)
    \SetColor{Green}
    \LongArrowArc(150,10)(20,60,120)
    \SetColor{Brown}
    \PhotonArc(150,10)(30,0,180){4}{8.5}   % 8.5 wiggles
    \end{picture}
    \end{center}

    \begin{center}
    \fcolorbox{white}{white}{
    \begin{picture}(596,144) (110,-139)
    \SetWidth{1.0}
    \SetColor{Black}
    \Gluon(100,-200)(200,0){50}{8}   
    \end{picture}
    }

   \begin{picture}(162,39) (0,0)
   \Line[arrow,arrowlength=5,arrowwidth=2](0,19)(48,19)
   \Arc[arrow,arrowlength=5,arrowwidth=2](80,43)(40,-143.13,-36.87)
   \Line(112,19)(160,19)
   \GluonArc(80,-5)(40,37,143){3.5}{6}
   \Text(112,-16)[lb]{\Large{\Black{$p_1$}}}
   \Text(208,-32)[lb]{\Large{\Black{$p_3$}}}
   \tikz{\draw[step=1.0,black,thin] (0.5,0.5) grid (5.5,4.5);}
   \end{picture}%
   \end{center}

   \end{document}

我建议您手动编辑您的 LaTeX 代码,因为问题的根源似乎是 Jaxodraw 软件,而不是 LaTeX 本身。

相关内容