单独字幕

单独字幕

我试图将两个费曼图并排放置,但无论我做什么,3 点循环图都无法与 4 点循环图正确对齐!这是我的代码

\begin{center}
\begin{figure}[H]
\begin{tikzpicture}
\begin{feynman}
\feynmandiagram [layered layout, horizontal=b to c] {
a -- [scalar, edge label = $H$] b [dot,black]
-- [fermion, half left,edge label = $f$] c [dot,black]
-- [fermion, half left,edge label = $\bar{f}$] b,
c -- [scalar,  edge label = $H$ ] d,
};
\end{feynman}
\end{tikzpicture}
\setlength{\belowcaptionskip}{0cm}
\hspace{3.4cm}
\centering
\begin{tikzpicture}
\begin{feynman}
\feynmandiagram [layered layout, horizontal=b to c] {
a -- [scalar, edge label = $H$] b [dot,blue]
-- [scalar, min distance=3cm, edge label = $\phi_i$] b 
-- [scalar,  edge label = $H$ ] c,
};
\end{feynman}
\end{tikzpicture}
\captionof{figure}{Higgs self-energy diagram}  
\end{figure}

答案1

最简单的方法是将它们放在同一个 中tikzpicture,然后将其用于\diagram [xshift=5cm ..第二个。如果要将第二个向下移动,请,yshift=-1cm在 后添加xshift

一些评论:

  • \feynmandiagram启动它自己的tikzpicture环境,所以不要在 中使用它tikzpicture。要么使用

    \feynmandiagram ...
    

    或使用

    \begin{tikzpicture}
    \begin{feynman}
    \diagram ...
    \end{feynman}
    \end{tikzpicture}
    
  • 拥有\begin{center} .. \end{center} 外部环境figure实际上没什么用。它不会使图形居中,而是增加了额外的垂直空间,并且使用任何其他浮动说明符,H图形可能会浮在它外面。相反,请将\centering其放在\begin{figure}

  • \captionof{figure}{..}当你在环境中时,不需要使用figure,这样\caption{..}就足够了。

代码输出

\documentclass{article}
\usepackage{tikz-feynman}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{feynman}
\diagram [layered layout, horizontal=b to c] {
a -- [scalar, edge label = $H$] b [dot,black]
-- [fermion, half left,edge label = $f$] c [dot,black]
-- [fermion, half left,edge label = $\bar{f}$] b,
c -- [scalar,  edge label = $H$ ] d,
};

\diagram [xshift=5cm,layered layout, horizontal=b to c] {
a -- [scalar, edge label = $H$] b [dot,blue]
-- [scalar, min distance=3cm, edge label = $\phi_i$] b 
-- [scalar,  edge label = $H$ ] c,
};
\end{feynman}
\end{tikzpicture}
\caption{Higgs self-energy diagram}  
\end{figure}
\end{document}

单独字幕

要获得单独的字幕,请使用两个\feynmandiagrams。对于子字幕,请加载subcaption包并将每个字幕放置\feynmandiagramsubfigure环境中,如下例所示。

如果您不想要子标题,请使用基本上完全相同的语法,但用subfigure替换minipage

\documentclass{article}
\usepackage{tikz-feynman}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\centering

\begin{subfigure}[t]{0.45\linewidth}
\centering
\feynmandiagram [layered layout, horizontal=b to c] {
a -- [scalar, edge label = $H$] b [dot,black]
-- [fermion, half left,edge label = $f$] c [dot,black]
-- [fermion, half left,edge label = $\bar{f}$] b,
c -- [scalar,  edge label = $H$ ] d,
};
\caption{Something}
\end{subfigure}
\begin{subfigure}[t]{0.45\linewidth}
\centering

\feynmandiagram [layered layout, horizontal=b to c] {
a -- [scalar, edge label = $H$] b [dot,blue]
-- [scalar, min distance=3cm, edge label = $\phi_i$] b 
-- [scalar,  edge label = $H$ ] c,
};
\caption{Something else}
\end{subfigure}
\caption{Higgs self-energy diagram}  
\end{figure}

\begin{figure}
\centering

\begin{minipage}[t]{0.45\linewidth}
\centering
\feynmandiagram [layered layout, horizontal=b to c] {
a -- [scalar, edge label = $H$] b [dot,black]
-- [fermion, half left,edge label = $f$] c [dot,black]
-- [fermion, half left,edge label = $\bar{f}$] b,
c -- [scalar,  edge label = $H$ ] d,
};
\caption{Something}
\end{minipage}
\begin{minipage}[t]{0.45\linewidth}
\centering

\feynmandiagram [layered layout, horizontal=b to c] {
a -- [scalar, edge label = $H$] b [dot,blue]
-- [scalar, min distance=3cm, edge label = $\phi_i$] b 
-- [scalar,  edge label = $H$ ] c,
};
\caption{Something else}
\end{minipage}
\end{figure}
\end{document}

相关内容