6

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.

  • 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 3 '13 at 11:16
  • You may have a look at this post: 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 3 '13 at 11:42
  • Your painting looks hilarious (no offense)! :D – pushpen.paul May 3 '17 at 5:21
8

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.