I am trying to produce a scattering diagram with TikZ but I have become stuck.
The Desired Structure
I am trying to achieve this layout of lines, including their arrow directions. In my diagram.
Minimum Working Example
\documentclass[11pt]{article}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{trees}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}
\begin{document}
\tikzset{
photon/.style={decorate, decoration={snake}, draw=red},
particle/.style={draw=blue, postaction={decorate},
decoration={markings,mark=at position .5 with {\arrow[draw=blue]{>}}}},
antiparticle/.style={draw=blue, postaction={decorate},
decoration={markings,mark=at position .5 with {\arrow[draw=blue]{<}}}},
gluon/.style={decorate, draw=black,
decoration={coil,amplitude=4pt, segment length=5pt}}
}
\begin{tikzpicture}[
thick,
% Set the overall layout of the tree
level/.style={level distance=1.5cm},
level 2/.style={sibling distance=3.5cm},
]
\coordinate
child[grow=down]{
edge from parent [antiparticle]
child {
node{$E$}
edge from parent [particle]
}
child {
node{$D$}
edge from parent [gluon]
}
node [above=3pt] {$C$}
}
% I have to insert a dummy child to get the tree to grow
% correctly to the right.
child[grow=right, level distance=0pt] {
child {
node{$A$}
edge from parent [gluon]
}
child {
node{$B$}
edge from parent [particle]
}
};
\end{tikzpicture}
\end{document}
Output
So far, I have the basic structure, except one of my lines is 'wandering'. The one that's labelled $A$
should be 'reflected' from where it is by 180 degrees.
Edit
Using @GonzaloMedina's approach, and with his helpful suggestion to the TikZ lirary, I found I can get the following diagram, which is very close to what I wanted:
\begin{document}
\tikzset{
particle/.style={thick,draw=blue, postaction={decorate},
decoration={markings,mark=at position .5 with {\arrow[blue]{triangle 45}}}},
gluon/.style={decorate, draw=black,
decoration={coil,aspect=0}}
}
\tikzset{
particle/.style={thin,draw=blue, postaction={decorate},
decoration={markings,mark=at position .5 with {\arrow[blue]{stealth}}}},
gluon/.style={decorate, draw=black, decoration={snake=coil}}
}
\begin{tikzpicture}[node distance=1cm and 1.5cm]
\coordinate[label=left:$G$] (e1);
\coordinate[below right=of e1] (aux1);
\coordinate[above right=of aux1,label=right:$N$] (e2);
\coordinate[below=1.25cm of aux1] (aux2);
\coordinate[below left=of aux2,label=left:$N$] (e3);
\coordinate[below right=of aux2,label=right:$G$] (e4);
\draw[gluon] (e1) -- (aux1);
\draw[particle] (aux1) -- (e2);
\draw[particle] (e3) -- (aux2);
\draw[gluon] (aux2) -- (e4);
\draw[particle] (aux2) -- node[label=right:$N$] {} (aux1);
\end{tikzpicture}
\end{document}
I looked in the TikZ manual (on page 95) and found how to make a coil (like a spring), but it didn't seem to work.
grow=right
instead ofgrow=up
(and switching the children)? That being said, I think thetikz-cd
package might be something you would be interested in, although your picture seems to be about chemistry. How complex do these kind of diagrams get? Maybe a plain-TikZ approach would be easier.feynmp
andtikz
).