4

I'm getting used to the very nice TikZ-Feynman package! I'm trying to figure out how to add styles to a vertex, when using manual placement. For example I'd like the "blob" in the following to actually be a blob, not the word:

\documentclass[border=4mm]{standalone}
\usepackage{tikz} 
\usetikzlibrary{shapes,arrows,positioning,automata,backgrounds,calc,er,patterns}
\usepackage[compat=1.1.0]{tikz-feynman}

\begin{document}
\begin{tikzpicture}
\begin{feynman}
\vertex (pf) {$\underline{p}$};
\vertex [right=1cm of pf] (qf1) {$\underline{q}_1$};
\vertex [right=1cm of qf1] (qf2) {$\underline{q}_2$};
\vertex [right=1cm of qf2] (qf3) {$\underline{q}_3$};
\vertex [right=1cm of qf3] (qf4) {$\underline{q}_4$};

\vertex [below=5cm of pf] (pi) {$p$};
\vertex [right=1cm of pi] (qi1) ;
\vertex [right=1cm of qi1] (qi2) {$q_1$};
\vertex [right=1cm of qi2] (qi3) {$q_2$};
\vertex [right=1cm of qi3] (qi4);

\vertex [below=2.5cm of qf2] (c) {blob} ;

\diagram*{
 (pi) -- [scalar] (c) -- [scalar] (pf),
 {(qi2),(qi3)} -- (c),
 (c) -- {(qf1),(qf2),(qf3),(qf4)},
};


\draw [decoration = {brace} , decorate] (qf1.north west) -- (qf4.north east) node [pos = 0.5 , above = 0.125cm] {\underline{\alpha}};

\draw [decoration = {brace} , decorate] (qi3.south east) -- (qi2.south west) node [pos = 0.5 , below = 0.125cm] {\alpha};

\end{feynman}
\end{tikzpicture}

\end{document}

This produces:

diagram

I tried various things with the usual TikZ node syntax, but no luck. I like the default "blob" in TikZ-feynman but would be happy to just manually draw a big shaded-in circle in there. Thanks!

6

Looks like you can just add the usual keys to the options of the \vertex macro, e.g. \vertex [below=2.5cm of qf2,blob] (c) {blob};. The blob style is defined by tikz-feynman.

\documentclass[border=4mm]{standalone}    
\usepackage{tikz} 
\usetikzlibrary{shapes,arrows,positioning,automata,backgrounds,calc,er,patterns}
\usepackage[compat=1.1.0]{tikz-feynman}

\begin{document}
\begin{tikzpicture}
\begin{feynman}
\vertex (pf) {$\underline{p}$};
\vertex [right=1cm of pf] (qf1) {$\underline{q}_1$};
\vertex [right=1cm of qf1] (qf2) {$\underline{q}_2$};
\vertex [right=1cm of qf2] (qf3) {$\underline{q}_3$};
\vertex [right=1cm of qf3] (qf4) {$\underline{q}_4$};

\vertex [below=5cm of pf] (pi) {$p$};
\vertex [right=1cm of pi] (qi1) ;
\vertex [right=1cm of qi1] (qi2) {$q_1$};
\vertex [right=1cm of qi2] (qi3) {$q_2$};
\vertex [right=1cm of qi3] (qi4);

\vertex [below=2.5cm of qf2,blob] (c) {blob} ;

\diagram*{
 (pi) -- [scalar] (c) -- [scalar] (pf),
 {(qi2),(qi3)} -- (c),
 (c) -- {(qf1),(qf2),(qf3),(qf4)},
};


\draw [decoration = {brace} , decorate] (qf1.north west) -- (qf4.north east) node [pos = 0.5 , above = 0.125cm] {\underline{\alpha}};

\draw [decoration = {brace} , decorate] (qi3.south east) -- (qi2.south west) node [pos = 0.5 , below = 0.125cm] {\alpha};

\end{feynman}
\end{tikzpicture}

\end{document}

enter image description here

  • 3
    Indeed, you can use all the usual keys with \vertex. Also, you probably don't want to have the word 'blob' inside the blob, so you can just have \vertex [below=2.5cm of qf2,blob] (c) {}; or even better, just \vertex [below=2.5cm of qf2,blob] (c);, though in the last instance, there is a bug which I am yet to fix (but I'll get around to it someday!) – JP-Ellis May 29 '16 at 14:42
  • Aha! Thanks to both of you (and JP for writing this awesome package). That explains it: I had tried \vertex [below=2.5cm of qf2,blob] (c); but I guess I needed SOME kind of text {} :) – twoform May 29 '16 at 15:12

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.