[Tex/LaTex] Specify width/height of rectangle around text using tikz

text;tikz-pgf

I'm attempting to use tikz to draw text with a rectangle of a specified size (the text may or may not fill the specified space). I can get it to draw the text/rectangle at the specified location and I can specify the width of the text (which is good), but the rectangle just auto fits around the size of the text. I'd like to define the draw portion size separate from the text width. The defined size can vary throughout the document, so I can't necessarily define it globally.

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\node[draw,text width=4cm] at (2,-2) {some text spanning three lines with automatic line breaks};
\end{tikzpicture}

\end{document}

Best Answer

You can use minimum width and minimum height keys.

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node[draw,text width=4cm,minimum height=6cm,minimum width=10cm] at 
     (2,-2) {some text spanning three lines with automatic line breaks};
\end{tikzpicture}
\end{document}