JP-Ellis / tikz-feynman

Feynman Diagrams with TikZ
http://www.jpellis.me/projects/tikz-feynman
Other
146 stars 20 forks source link

half of the diagram is mirror image #47

Closed luc-j-bourhis closed 4 years ago

luc-j-bourhis commented 6 years ago

Consider

\feynmandiagram[baseline=(v.base), vertical=v to w]{
ei [particle=$e^-$] -- [fermion] q -- [fermion] v -- [fermion] r -- [fermion] ef [particle=$e^-$],
pi [particle=$p$] -- [fermion] w -- [fermion] pf [particle=$p$],
q -- [photon] r,
v -- [photon] w,
};

This renders to the following with version 1.1.0 (coming from MacTeX 2016) mirrored-feyn

The fermion lines in the bottom are the mirror image of what they should be, aren't they? Or the fermion lines in the top are the mirror image of what they should be.

JP-Ellis commented 6 years ago

The algorithm really has no notion of preferred direction. All it knows is that ei is connected to q, q to v, etc. With this information, the algorithm then creates a random layout as an initial seed and then tries to spread it out as best as possible. It doesn't remember which of ei or ef was specified first.

What you can do is flip half of the diagram by replacing vertical with vertical' and/or switch some fermion to anti fermion lines.