[Tex/LaTex] Add text in TikZ rectangle

tikz-pgf

The code below draws three nested rectangles. Then I want to add text by using a node. Somehow the coordinates of the rectangles are not in line with the coordinates of the nodes. To place some text in the largest rectangle, I would assume, that (0.5, -0.5) would do the job. But now the text is outside of the rectangle. But why? How can I put each paragraph in the upper left corner of each rectangle? Are there better ways to do it?

\documentclass[border=10]{standalone}
\usepackage{tikz}
\usepackage{lipsum}

\begin{document}

\def\xa{(0,0)} \def\ya{(15.0,-5)}
\def\xb{(5,-0.2)} \def\yb{(14.8,-4.8)}
\def\xc{(10,-0.4)} \def\yc{(14.6,-4.6)}

\begin{tikzpicture}
    % Draw boxes
    \draw \xa rectangle \ya ;
    \draw \xb rectangle \yb;
    \draw \xc rectangle \yc;
    % DRAW LABELS 
    \node at (0.5,-0.5) [text width=4cm] {\tiny\lipsum[66]};
    \node at (6,-2) [text width=4cm] {\tiny\lipsum[66]};
    \node at (10,-2) [text width=4cm] {\tiny\lipsum[66]};
\end{tikzpicture}

\end{document}

enter image description here

Best Answer

like this?

enter image description here

for above image are used only nodes (this is more simple than draw rectangles and than nested nodes with text). text nodes are positioned relatively to each, drawing by use of library fit:

\documentclass[tikz, border=10]{standalone}
\usetikzlibrary{fit, positioning}
\usepackage{lipsum}

\begin{document}
    \begin{tikzpicture}[
    node distance = 0mm and 1mm,
box/.style = {text width=4cm, font=\tiny},  % define nodes style
                    ]
\node (n1) [box,draw] {\lipsum[66]};
\node (n2) [box,left=of n1] {\lipsum[66]};
\node (n3) [box,left=of n2] {\lipsum[66]};
%
\node (n4) [draw,fit=(n1) (n2)] {};
\node (n5) [draw,fit=(n3) (n4)] {};
\end{tikzpicture}

\end{document}

note: font size is defined in node style. by this the baseline skip in node consider the selected font size.