2

I have a tikz-feynman diagram that has a wide aspect ratio, and I'd like to change the aspect ratio to be more square.

cascade.txt:

\documentclass[tikz]{standalone}
\def\axisdefaultwidth{12cm}
\def\axisdefaultheight{9cm}
\usepackage{tikz-feynman}
\begin{document}
\feynmandiagram [small, layered layout, vertical=a to b] {
  alpha -- [photon, edge label=\(\gamma_o\)] a0,
  a0 -- [anti fermion, edge label=\(e^{+}\)] a1 ,
  a0 -- [fermion, edge label=\(e^{-}\)] a2 ,
  a1 -- [photon, edge label=\(\gamma\)] a3 ,
  a1 -- [anti fermion, edge label=\(e^{+}\)] a4 ,
  a2 -- [photon, edge label=\(\gamma\)] a5 ,
  a2 -- [fermion, edge label=\(e^{-}\)] a6 ,
  a3 -- [anti fermion, edge label=\(e^{+}\)] a7 ,
  a3 -- [fermion, edge label=\(e^{-}\)] a8 ,
  a4 -- [photon, edge label=\(\gamma\)] a9 ,
  a4 -- [anti fermion, edge label=\(e^{+}\)] a10 ,
  a5 -- [anti fermion, edge label=\(e^{+}\)] a11 ,
  a5 -- [fermion, edge label=\(e^{-}\)] a12 ,
  a6 -- [photon, edge label=\(\gamma\)] a13 ,
  a6 -- [fermion, edge label=\(e^{-}\)] a14 ,
  a7 -- [photon, edge label=\(\gamma\)] a15 ,
  a7 -- [anti fermion, edge label=\(e^{+}\)] a16 ,
  a8 -- [photon, edge label=\(\gamma\)] a17 ,
  a8 -- [fermion, edge label=\(e^{-}\)] a18 ,
  a9 -- [anti fermion, edge label=\(e^{+}\)] a19 ,
  a9 -- [fermion, edge label=\(e^{-}\)] a20 ,
  a10 -- [photon, edge label=\(\gamma\)] a21 ,
  a10 -- [anti fermion, edge label=\(e^{+}\)] a22 ,
  a11 -- [photon, edge label=\(\gamma\)] a23 ,
  a11 -- [anti fermion, edge label=\(e^{+}\)] a24 ,
  a12 -- [photon, edge label=\(\gamma\)] a25 ,
  a12 -- [fermion, edge label=\(e^{-}\)] a26 ,
  a13 -- [anti fermion, edge label=\(e^{+}\)] a27 ,
  a13 -- [fermion, edge label=\(e^{-}\)] a28 ,
  a14 -- [photon, edge label=\(\gamma\)] a29 ,
  a14 -- [fermion, edge label=\(e^{-}\)] a30 ,
};
\end{document}

Which is compiled via:

$ lualatex cascade.tex

Which renders to this: cascade.pdf which has to be shrunk too much to fit on an A4 page. I can force the width and height when I include it in my main document, but that also skews the text labels, making it look pretty bad.

How can I make the aspect ratio more square without distorting the text labels?

  • With \documentclass[tikz]{standalone} your snippet does not compile on my machine, but with \documentclass[tikz]{article} it does. – marmot Jan 19 '18 at 21:24
  • One needs \RequirePackage{luatex85} as the very first instruction, with a recent TeX distribution. – egreg Jan 19 '18 at 23:24
  • @egreg Updated my answer, mille grazie! – marmot Jan 19 '18 at 23:52
1

You can change the aspect ratio simply by adding xscale and yscale.

\RequirePackage{luatex85}
\documentclass[tikz]{standalone}
\usepackage{tikz-feynman}
\begin{document}
\feynmandiagram [small, tree layout,xscale=0.5] {
  alpha[particle=\(\gamma_0\)] -- [photon] a0,
  a0 -- [anti fermion, edge label=\(e^{+}\)] a1 ,
  a0 -- [fermion, edge label=\(e^{-}\)] a2 ,
  a1 -- [photon, edge label=\(\gamma\)] a3 ,
  a1 -- [anti fermion, edge label=\(e^{+}\)] a4,
  a2 -- [photon, edge label=\(\gamma\)] a5,
  a2 -- [fermion, edge label=\(e^{-}\)] a6 ,
  a3 -- [anti fermion, edge label=\(e^{+}\)] a7 ,
  a3 -- [fermion, edge label=\(e^{-}\)] a8 ,
  a4 -- [photon, edge label=\(\gamma\)] a9 ,
  a4 -- [anti fermion, edge label=\(e^{+}\)] a10 ,
  a5 -- [anti fermion, edge label=\(e^{+}\)] a11 ,
  a5 -- [fermion, edge label=\(e^{-}\)] a12 ,
  a6 -- [photon, edge label=\(\gamma\)] a13 ,
  a6 -- [fermion, edge label=\(e^{-}\)] a14,
  a7 -- [photon] a15[particle=\(\gamma\)] ,
  a7 -- [anti fermion] a16[particle=\(e^{+}\)] ,
  a8 -- [photon] a17[particle=\(\gamma\)] ,
  a8 -- [fermion] a18[particle=\(e^{-}\)] ,
  a9 -- [anti fermion] a19[particle=\(e^{+}\)] ,
  a9 -- [fermion] a20[particle=\(e^{-}\)] ,
  a10 -- [photon] a21[particle=\(\gamma\)] ,
  a10 -- [anti fermion] a22[particle=\(\gamma\)] ,
  a11 -- [photon, edge label=\(\gamma\)] a23 ,
  a11 -- [anti fermion] a24[particle=\(e^{+}\)] ,
  a12 -- [photon] a25[particle=\(\gamma\)] ,
  a12 -- [fermion] a26[particle=\(e^{-}\)] ,
  a13 -- [anti fermion] a27[particle=\(e^{+}\)] ,
  a13 -- [fermion] a28[particle=\(e^{-}\)] ,
  a14 -- [photon] a29[particle=\(\gamma\)] ,
  a14 -- [fermion] a30[particle=\(e^{-}\)] ,
};
\end{document}

I also put the initial and final state particles away from the edges, which removes the overlapping labels. (BTW, your vertical=a to b had no effect because there are no nodes a, b in your diagram, so I dropped this.) EDIT: Changed the document class back to standalone, Mille grazie @egreg!

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.