I would like to define a shape for nodes in tikz using another tikzpicture. For instance, I would like to make the following into a node shape called monoid
\begin{tikzpicture}
\node (m) [circle,scale=.5,draw] at (0, 0) {};
\node (i1) at (-1,.5){};
\node (i2) at (-1,-.5){};
\node (o) at (1,|-m){};
\draw [-] (m) to (o);
\draw [-] (i1) to [out=0, in=135] (m);
\draw [-] (i2) to [out=0, in=-135] (m);
\end{tikzpicture}
and be able to use it in another tikzpicture. For example, doing something like
\begin{tikzpicture}
\node(M)[monoid]at(0,0){};
\draw (-1,0)[out=0,in=180]to(M.i1);
\end{tikzpicture}
If someone could point me to the part of the manual that I need to read in order to do this, it would be great. Thanks a lot in advance!
Elena

picdoesn't have anchors thatpositioningdoesn't work. – Henri Menke May 15 '20 at 09:47\matrix, you can position it to some extent. This is because the matrix wraps a rectangle node around it, and this is what's meant by a boundary path. Yet, technically one really needs only thewestand so on anchors, as you say. – May 15 '20 at 16:26