1

If I use scalebox, the labels of the vertices are too big compared to those of the particles.

    \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^-$],
    };
    }

How can I fix that (still using scalebox) ?

1
  • 1
    While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. Apr 29, 2017 at 7:31

2 Answers 2

3

I'm not actually sure what you are intending to do; however, it is possible to adjust the font size within the \scalebox using the \fontsize command. For example, if you wanted to scale the diagram by 2 but keep the original font size the same, you could do:

\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}

output

The \fontsize{0.5em}{0.5em} essentially halves the font size within the scalebox so that, after being scaled up by a factor of 2 it is the same as it was to begin with.

Note that I'm not sure why the font sizes of the superscripts and subscripts isn't scaled appropriately, but I'm sure another question on this site addresses this.

1

I would not use scalebox for scaling, but let tikz do it's job

\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}

enter image description here

1
  • Yes but then there is a too big gap between external lines and the associated particle label.
    – ketherok
    May 22, 2017 at 21:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .