8

I've created a chain of nodes. In each of those nodes, I want to put other rectangles with text inside. This is how I want each chained node to look like (please excuse my touchpad drawing):

enter image description here

I tried to get this result by nesting nodes, but the node content seems to be in text mode, so that didn't work.

Tim N
  • 10,219
  • 13
  • 63
  • 88
  • May be you can chain matrix nodes, but I've never tried. The matrix will be your cyan square and nodes inside your yellow and violet boxes. – Ignasi May 03 '13 at 11:16
  • You may have a look at this post: http://tex.stackexchange.com/questions/7814/nested-tikz-nodes It sounds very similar to your problem. But I don't know if it works with the chain. – Dave May 03 '13 at 11:42
  • Your painting looks hilarious (no offense)! :D – hola May 03 '17 at 05:21

1 Answers1

9

You can look at the link given by Dave but here another solution :

\documentclass[11pt]{scrartcl}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\node[fill=blue!30,text depth = 3cm,minimum width=3cm,font=\Large] (main){TEXT};
\node[draw,fill=yellow!30] at (main.center){$2+3$};
\node[draw,fill=orange!30] at ([yshift=2em]main.south){$5$};
\end{tikzpicture}
\end{document}

enter image description here

Alain Matthes
  • 95,075