JP-Ellis / tikz-feynman

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

blob not centered as it should #61

Open zhyiyu opened 5 years ago

zhyiyu commented 5 years ago

Hi, I was drawing a blob at a vertex, but it is not centered

\begin{feynman}

\vertex (a1);
\vertex[right = 3 cm of a1] (a2);
\vertex[above = 4 cm of a1] (a3);
\vertex[above right = 4 cm and 3 cm of a1] (a4);
\vertex[above right = 2 cm and 1.5 cm of a1, blob] (b) {};

\diagram*{
(a1) -- [fermion, edge label = \scriptsize{$p$}] (b),
(a2) -- [fermion, edge label' = \scriptsize{$p'$}] (b),
(b) -- [fermion, edge label' = \scriptsize{$k$}] (a3),
(b) -- [fermion, edge label = \scriptsize{$k'$}] (a4),

};
\end{feynman}

The blob is apparently not centered, which makes the whole diagram looks weird.

jmarucha commented 2 years ago

I don't know if you're there yet, but I found a workaround Adding anchor=center to the vertex options after blob does the trick.

zhyiyu commented 2 years ago

Thank you! I also figured out not long ago that if I set explicitly the coordinate for the very first vertex, then everything is fine:

\begin{feynman}

\vertex (a1) at (0.0, 0.0) {}; %% The first vertex has to have explicit coordinate!
\vertex[right = 3 cm of a1] (a2);
\vertex[above = 4 cm of a1] (a3);
\vertex[above right = 4 cm and 3 cm of a1] (a4);
\vertex[above right = 2 cm and 1.5 cm of a1, blob] (b) {};

\diagram*{
(a1) -- [fermion, edge label = \scriptsize{$p$}] (b),
(a2) -- [fermion, edge label' = \scriptsize{$p'$}] (b),
(b) -- [fermion, edge label' = \scriptsize{$k$}] (a3),
(b) -- [fermion, edge label = \scriptsize{$k'$}] (a4),

};
\end{feynman}