Update
Thanks to @marmot's answer (below), I was able to localize the problem I had with rectangle split horizontal
. There seem to be two missing anchor node names shown byN
and S
in the following code:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart}
\begin{document}
\begin{tikzpicture}
\node[%
name=s,
shape=rectangle split,
rectangle split parts=4,
rectangle split horizontal,
draw,text width=2in,draw=lightgray, line width=20pt,%shape example,
inner ysep=0.75cm]
{\nodepart{text}text\nodepart{two}two
\nodepart{three}three\nodepart{four}four};
\foreach \anchor/\placement in
{text/left, text east/above, text west/above,
two/left, two north/above, two south/below,
three/left, three north/above, three south/below,
four/left, four north/above, four south/below,
text split/left, text split east/right, text split west/left,
two split/left, two split north/above, two split south/below,
three split/left, three split north/above, three split south/below,
north/below, south/above, east/below, west/below,
north west/above, north east/above, south west/below, south east/below, center/above, mid/above, base/below}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\coordinate (stextsplitnorth) at (s.two north -| s.text split); %% <nodname>.text split north ?
\coordinate (stextsplitsouth) at (s.two south -| s.text split); %% <nodname>.text split south ?
\node[blue] at (stextsplitnorth) {N};
\node[red] at (stextsplitsouth) {S};
\end{tikzpicture}
\end{document}
These anchors are easily located as demonstrated in the code, but it was a considerable source of frustration (I'm using only two splits) that they appear not to be defined. It is, of course, perfectly possible that I have used the incorrect incantation (tried several, actually -- the most likely appear in the sample code). I would be glad to know the correct one. If you look at @marmot's corrected graphic below, you will see that they are missing there as well -- this seems to apply only to the first and second splits. Is this a bug?
Original question
The TikZ manual (page 729, version 3.0.1a) gives the following code:
% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = XeLaTeX
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart}
\begin{document}
\Huge
\begin{tikzpicture}
\node[%
name=s,
shape=rectangle split,
rectangle split parts=4,
%rectangle split horizontal,
draw,text width=2in,draw=lightgray, line width=20pt,%shape example,
inner ysep=0.75cm]
{\nodepart{text}text\nodepart{two}two
\nodepart{three}three\nodepart{four}four};
\foreach \anchor/\placement in
{text/left, text east/above, text west/above,
two/left, two east/above, two west/above,
three/left, three east/below, three west/below,
four/left, four east/below, four west/below,
text split/left, text split east/above, text split west/above,
two split/left, two split east/above, two split west/above,
three split/left, three split east/below, three split west/below,
north/above, south/below, east/below, west/below,
north west/above, north east/above, south west/below, south east/below, center/above, 70/above, mid/above, base/below}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{document}
and essentially yields the following (I expanded the shape example
style for simplicity):
Uncommenting rectangle split horizontal
gives this:
Clearly, the naming convention for rectangle split horizontal
alters the names of the anchors of the split parts. I looked at pgflibraryshapes.multipart.code.tex
but (after considerable experimentation) did not find the solution. What are the node anchor names for rectangle split horizontal
?