Tikz-Feynman:顶点标签太大

Tikz-Feynman:顶点标签太大

如果我使用比例盒,顶点的标签与粒子的标签相比太大。

    \scalebox{2.5}{
    \feynmandiagram [horizontal=a to b] {
    i1 [node font=\tiny, particle=$e^-$] -- [fermion, arrow size=0.8pt, momentum={[arrow shorten=0.3, node font=\tiny]$k_1$}] a [label=${\mu}$]-- [fermion, arrow size=0.8pt, rmomentum={[arrow shorten=0.3, node font=\tiny]$k_2$}] i2 [node font=\tiny, particle=$e^+$],
    a -- [photon,node font=\tiny, edge label=\(\gamma\), momentum'={[arrow shorten=0.3, node font=\tiny]$q$}] b [label=$\nu$],
    f1 [node font=\tiny, particle=$\mu^+$] -- [fermion, arrow size=0.8pt, rmomentum'={[arrow shorten=0.3, node font=\tiny]$p_2$}] b -- [fermion, arrow size=0.8pt, momentum'={[arrow shorten=0.3, node font=\tiny]$p_1$}] f2 [node font=\tiny, particle=$\mu^-$],
    };
    }

我该如何修复该问题(仍然使用 scalebox)?

答案1

我实际上不确定你打算做什么;但是,可以使用\scalebox命令调整字体大小\fontsize。例如,如果你想将图表缩放 2 倍但保持原始字体大小不变,你可以这样做:

\RequirePackage{luatex85}
\documentclass[border=10pt]{standalone}

\usepackage[compat=1.1.0]{tikz-feynman}

\begin{document}
\scalebox{2}{
  \fontsize{0.5em}{0.5em}
  \feynmandiagram [horizontal=a to b] {
    i1 [particle=\(e^-\)]
    -- [fermion, arrow size=0.8pt, momentum={[arrow shorten=0.3]\(k_1\)}] a [label=\({\mu}\)]
    -- [fermion, arrow size=0.8pt, rmomentum={[arrow shorten=0.3]\(k_2\)}]
    i2 [particle=\(e^+\)],
    a -- [photon, edge label=\(\gamma\), momentum'={[arrow shorten=0.3]\(q\)}]
    b [label=\(\nu\)],
    f1 [particle=\(\mu^+\)]
    -- [fermion, arrow size=0.8pt, rmomentum'={[arrow shorten=0.3]\(p_2\)}] b
    -- [fermion, arrow size=0.8pt, momentum'={[arrow shorten=0.3]\(p_1\)}] f2 [particle=\(\mu^-\)],
  };
}
\end{document}

输出

本质上将比例框内的字体大小减半\fontsize{0.5em}{0.5em},这样,在按 2 倍比例放大后,它就和一开始一样了。

请注意,我不确定为什么上标和下标的字体大小没有适当缩放,但我确信该网站上的另一个问题可以解决这个问题。

答案2

我不会用它scalebox来缩放,但让它tikz做它的工作

\documentclass{article}

\usepackage{tikz-feynman}
\usepackage{luatex85}

\begin{document}
  \feynmandiagram[scale=2.5][horizontal=a to b] {
    i1 [particle=\(e^-\)]
    -- [fermion, arrow size=0.8pt, momentum={[arrow shorten=0.3]\(k_1\)}] a [label=\({\mu}\)]
    -- [fermion, arrow size=0.8pt, rmomentum={[arrow shorten=0.3]\(k_2\)}]
    i2 [particle=\(e^+\)],
    a -- [photon, edge label=\(\gamma\), momentum'={[arrow shorten=0.3]\(q\)}]
    b [label=\(\nu\)],
    f1 [particle=\(\mu^+\)]
    -- [fermion, arrow size=0.8pt, rmomentum'={[arrow shorten=0.3]\(p_2\)}] b
    -- [fermion, arrow size=0.8pt, momentum'={[arrow shorten=0.3]\(p_1\)}] f2 [particle=\(\mu^-\)],
  };
\end{document}

在此处输入图片描述

相关内容