I use TikZ to create pictures in LaTeX. My picture consists of a rectangle with nine split parts. Every part has its own text inside the node, for example, "local variables, and temporaries":
\nodepart{eight} \structtwenty Saved registers, local variables, and temporaries
My problem is the text is not centered in the node, but on top and bottom of the node, can any help, below is the whole TeX file:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{shapes,arrows,positioning}
\def\structforty{\vrule depth 4cm width 0pt}
\def\structsix{\vrule depth 0.14cm width 0pt}
\def\struceleven{\vrule depth 1.1cm width 0pt}
\def\strucfourteen{\vrule depth 1.1cm width 0pt}
\def\structtwenty{\vrule depth 1.9cm width 0pt}
\begin{document}
\begin{tikzpicture}[auto,
rect/.style={
rectangle split, rectangle split parts=9,
draw,rectangle split part align=center,draw, thick,
text width=3cm,
text centered, %minimum height=26em,
% font=\ttfamily,
align=center, rectangle split part align={center,left},
rectangle split part align=midway,
rectangle split part fill={gray!30, blue!20, blue!15, blue!20,blue!15,blue!15,green!15,green!20,green!30}
}]
\node (stack) [rect] {
\nodepart {one}\structforty $\vdots$
\nodepart {two}\struceleven $\vdots$
\nodepart{three}\structsix Argument n
\nodepart{four} \struceleven $\vdots$
\nodepart{five} \structsix Argument 1
\nodepart{six} \structsix Return Address
\nodepart{seven} \structsix Saved \%ebp
\nodepart{eight} \structtwenty Saved registers, local variables, and temporaries
\nodepart{nine} \strucfourteen Argument build area
};
\end{tikzpicture}
\end{document}
\struct...
? If you remove them, it will work. You can define the vertical spacing withinner ysep=
.inner ysep
apply to all parts of the node? Apparently the OP wants to have each part with a different vertical spacing between the border and the contents.inner sep
applies to all. I said that because I didn't understand that @vampire wanted different vertical spacing.