I'd like to position some nodes in TiKZ around a given node. I could do that manually, by setting each node position, but why not looking for an easier way that looks better?
I thought about using a path and stick the nodes to the path but I have no idea about doing this, and I also wonder: is the path the best solution?
An example would be the following where the base node is A (there is a node below it, but it's not a problem; also note that if you don't include the arrows in your answer, it's ok, I know that part):
My code so far has reached this stage (if you think some option in the code could be changed to make things easier or better, please let me know):
\documentclass{minimal}
\usepackage{tikz}
\usepackage{verbatim}
\usetikzlibrary{arrows,positioning}
\tikzset{
%Define standard arrow tip
>=stealth',
%Define style for boxes
punkt/.style={
rectangle,
rounded corners,
draw=black, thin,
text width=6.5em,
minimum height=2em,
text centered},
% Define arrow style
pil/.style={
->,
thin,
shorten <=2pt,
shorten >=2pt,}
}
\begin{document}
\center\begin{tikzpicture}[node distance=5mm,
terminal/.style={
% The shape:
rectangle,minimum size=6mm,rounded corners=3mm,
% The rest
very thick,draw=black!50,
top color=white,bottom color=black!20,
font=\ttfamily}]
\node (nodezero) [terminal] {another node below A};
\node (a) [terminal, above=3em of nodezero] {A};
\node (01) [terminal] {1};
\node (02) [terminal] {2};
\node (03) [terminal] {3};
\node (04) [terminal] {4};
\node (05) [terminal] {5};
\node (06) [terminal] {6};
\node (07) [terminal] {7};
\node (08) [terminal] {8};
\node (09) [terminal] {9};
\end{tikzpicture}
\end{document}
Best Answer
You may want to use the
trees
library in tikz, which in this situation would provide, up to me, a rather easy syntax. I made a small example for you.Which gives as result: