I try to use multipart nodes in matrix and draw lines with cell name. Below code report error:(use pure text works fine)
Package pgf Error: No shape named `m-1-1' is known.
See the pgf package documentation for explanation.
Type H <return> for immediate help.
...
l.19 \draw (m-1-1.north west)
-- (m-1-2.north east) -- (m-1-2.south east...
code:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes.multipart, matrix,fit,backgrounds}
\tikzset{
box/.style={
shape=rectangle split, rectangle split parts=4
},
}
\newcommand{\parts}[4] {
\node[box] {\nodepart{one} #1 \nodepart{two} #2 \nodepart{three} #3 \nodepart{four} #4};
}
\begin{document}
\begin{tikzpicture}
\matrix[matrix of nodes,column sep=-\pgflinewidth, row sep=-\pgflinewidth,
draw,align=center] (m)
{
\parts{AAA}{BBB}{CCC}{DDD} & \node{EEEEEE}; \\
};
\draw (m-1-1.north west) -- (m-1-2.north east) -- (m-1-2.south east) -- (m-1-1).north west) -- cycle;
\end{tikzpicture}
\end{document}
(m-1-1)
and the name(m-1-2)
are not applied i.e. even in the case where there is no multipart shape involved. Don't use\node ... ;
if you want to use the(<name>-<row>-<col>)
of thematrix
library.tikzmark
). Personally, I'm not keen on the multipart nodes in TikZ, but maybe that's just me. They never seem to work as I want them to ;).