I am trying to do a array diagram with Tikz. So far, my results looks like this:
As you can see, I have two problems: The boxes are proportional to the content of the node and I do not have a overall box size.(Take the last three boxes as example) Furthermore, the text "k-elements" is between the array diagram and brace. It should be below brace.
Code:
\begin{tikzpicture}
[
-{Stealth[length=2.5pt]},
MyStyle/.style={draw, text width=25pt, text height=10pt, text centered},
my arrow/.style={shape=single arrow, rotate=90, inner sep=5pt, outer sep=0pt, single arrow head extend=0pt, minimum height=7.5pt, text width=0pt, draw=blue!50, fill=blue!25}
]
\begin{scope} [start chain, node distance=0pt]
\node [MyStyle,on chain] (1) {$1$};
\node [MyStyle,on chain] (2) {$2$};
\node [MyStyle,on chain] (3) {$3$};
\node [MyStyle,on chain] (4) {$4$};
\node [MyStyle,on chain] (5) {$\cdots$};
\node [MyStyle,on chain] (6) {$k$};
\node [MyStyle,on chain] (7) {$\cdots$};
\node [MyStyle,on chain] (8) {$n-2$};
\node [MyStyle,on chain] (9) {$n-1$};
\node [MyStyle,on chain] (10) {$n$};
\end{scope}
\draw (1.north) [out=25, in=155] to (2.north);
\draw (1.north) [out=30, in=155] to (3.north);
\draw (1.north) [out=35, in=155] to (4.north);
\draw (1.north) [out=40, in=155] to (6.north);
\draw [decorate,decoration={brace,amplitude=10pt,mirror},xshift=-4pt,yshift=0pt]
(0.7,-0.27) -- (6.6,-0.27)node[black,midway,xshift=9pt] {$k$-elements} ;
\end{tikzpicture}
(code is based on Array with arrows and a cell outside and Draw Curly Braces in TikZ )
And a other questions: Is there a good introduction to Tikz? Or is the Documentation the best starting point?
Thank you guys for the help!