3

I have the following code which draws a Feynman diagram using the tikz-feynman package.

\feynmandiagram [baseline={(current bounding box.center)},medium, vertical=b to f] {
        a [nudge=(-30:5mm)]
        -- [photon, edge label=\(p_{1}\)] b [label=190:\(\mu_{1}\)]
        -- [fermion, edge label=\(k_{2}\)] c,
        d[nudge=(210:5mm)] -- [photon, edge label'=\(p_{2}\)] c [label=-30:\(\mu_{2}\)],
        c -- [fermion, edge label=\(k_{3}\)] e [label=0:\(\mu_{3}\)] -- [fermion, edge label=\(k_{4}\)] f [label=180:\(\mu_{4}\)] -- [ fermion, edge label=\(k_{1}\)] b,
        g [nudge=(-30:5mm)] -- [photon, edge label'=\(p_{3}\)] e,
        h [nudge=(-30:5mm)] -- [photon, edge label'=\(p_{4}\)] f,
    };

Here is the diagram which can be drawn using the code.

How do I make the bottom two wavy external lines the same length as the top two wavy external lines?

I would like to make the diagram symmetrical.

3

You are nudging all the vertices, but all in the same direction. That is, you are pushing all of the outer vertices by 5mm at an angle of -30° (that is, to the right and slightly down). If you remove the nudging, the diagram looks symmetric:

enter image description here

\documentclass[tikz]{standalone}

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

\begin{document}
\feynmandiagram [baseline={(current bounding box.center)},medium, vertical=b to f] {
  a
    -- [photon, edge label=\(p_{1}\)] b [label=180:\(\mu_{1}\)]
    -- [fermion, edge label=\(k_{2}\)] c,
  d -- [photon, edge label'=\(p_{2}\)] c [label=0:\(\mu_{2}\)],
  c -- [fermion, edge label=\(k_{3}\)] e [label=0:\(\mu_{3}\)]
    -- [fermion, edge label=\(k_{4}\)] f [label=180:\(\mu_{4}\)]
    -- [fermion, edge label=\(k_{1}\)] b,
  g -- [photon, edge label'=\(p_{3}\)] e,
  h -- [photon, edge label'=\(p_{4}\)] f,
};
\end{document}

If you want to keep the nudging (not sure why?), then make sure to adjust the direction of the nudging accordingly:

enter image description here

\documentclass[tikz,border=10pt]{standalone}

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

\begin{document}
\feynmandiagram [baseline={(current bounding box.center)},medium, vertical=b to f] {
  a [nudge=(135:1cm)]
    -- [photon, edge label=\(p_{1}\)] b [label=180:\(\mu_{1}\)]
    -- [fermion, edge label=\(k_{2}\)] c,
  d [nudge=(45:1cm)]
    -- [photon, edge label'=\(p_{2}\)] c [label=0:\(\mu_{2}\)],
  c -- [fermion, edge label=\(k_{3}\)] e [label=0:\(\mu_{3}\)]
    -- [fermion, edge label=\(k_{4}\)] f [label=180:\(\mu_{4}\)]
    -- [fermion, edge label=\(k_{1}\)] b,
  g [nudge=(-45:1cm)]
    -- [photon, edge label'=\(p_{3}\)] e,
  h [nudge=(-135:1cm)]
    -- [photon, edge label'=\(p_{4}\)] f,
};
\end{document}
  • I want to keep the nudging to make the photon lines shorter. – nightmarish Feb 18 '17 at 1:17
  • All good, then in my second example, instead of using positive distances (1cm), use a negative distance: -0.5cm. Obviously adjust until you get the desired output :) If want to be really specific about where nodes are, you can specify them manually relative to other nodes. Check out the documentation for examples :) – JP-Ellis Feb 18 '17 at 4:25
  • It took me a while to notice that there should not be any parenthesis around the name of a vertex for [label=180:\(\mu_{1}\)] to work. – zyy Jun 22 '17 at 20:50

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.