I'm trying to set up a node style that allows me to draw nodes like UML2 components diagrams, etc.
What I consider as a good idea for a syntax is:
\node {node}
child{
\node {other node}
};
which is good, but I don't know how I can format this as rectangle, and place component symbols in the north east corner.
tikz-uml is not what I need, because it has an interface that is different than that of TikZ.
I've also tried to typeset it as:
\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[remember picture]
\node[draw, execute at begin node = \begin{tikzpicture}, execute at end node = \end{tikzpicture}] at (-1,-1)
{
\node[draw,minimum width=20pt] at (-1,1) {node};
};
\node[draw] at (1,1)
{
\begin{tikzpicture}
\node[draw,minimum width=20pt] at (-1,1) {node};
\end{tikzpicture}
};
\end{tikzpicture}
\end{document}
But there is a problem with nested nodes.
The problem is that execute at begin node affects sub-nodes.
I'm searching for something that allows me easly to make a node that is a UML2 component. No matter how, but I want to create it writing:
\node [umlcomponent] ...
or by
\umlcomponent[fill=red...] at (2,2) {damn UML component} ...
\draw (1,1) umlcomponent {damn uml component} ...
So there is my question:
How can I define a custom TikZ command/macro/something that allows me to reach the syntax
Nested node class with pictogram decoration
{}). For your target, I would consider first if TikZ-UML satisfies your needs. – Claudio Fiandrino Dec 22 '12 at 14:49execute at begin nodeand\begin{tikzpicture}inside of the node, you could just write\tikz\node …, which is at least shorter. On that node: Why do you want to place a node inside another one anyway? Do you want adoubleborder? Do you want tofitan outer node around the inner one? What is your graphical goal here? The image of your linked question does look like something for a multi-part node. – Qrrbrbirlbel Dec 22 '12 at 23:02