Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
         \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:


   \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)
            \node[draw,minimum width=20pt] at (-1,1) {node};

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

share|improve this question

closed as unclear what you're asking by Joseph Wright Aug 4 '13 at 19:40

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

Welcome to TeX.SX. A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}). For your target, I would consider first if TikZ-UML satisfies your needs. –  Claudio Fiandrino Dec 22 '12 at 14:49
May I ask you why TikZ-UML is not what you need? Also nesting tikz pictures in this context is kind of looking for trouble since most of your nodes won't inherit/inherit wrong options. –  percusse Dec 22 '12 at 15:39
Instead of execute at begin node and \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 a double border? Do you want to fit an 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
No real reply to the points above: 'unclear'. –  Joseph Wright Aug 4 '13 at 19:41

Browse other questions tagged or ask your own question.