# Spanning a tikz node over multiple pages

I'm using TikZ to draw a box around text with a heading, and it works great if the content of the box can fit on one page, but if it doesn't, it goes past the bottom margin, into the page number, and then is simply cut off without continuing on the next page. How would I get it to tell when it reaches the end of the page and to continue on the next?

I found this example, which implements something similar, but I can't make enough sense of it to be able to implement it in my code.

\newcommand{\fancybox}[4]
{
\tikzstyle{thmbox} = [rectangle, rounded corners, draw=black, fill=#4, inner sep=15pt, drop shadow={fill=black, opacity=.5}]%
\tikzstyle{fancytitle} =[fill=white, text=black, rectangle, rounded corners, draw= black]%
\noindent%
\begin{tikzpicture}%
\node [thmbox] (box){%
\begin{minipage}{.91\textwidth}%
\textit{#3}%
\end{minipage}%
};%
\node[fancytitle, right=10pt] at (box.north west) {\textbf{#1:} #2};%
\end{tikzpicture}
\\\\
}

-

I'd suggest you try instead the mdframed package. In the latest documentation on CTAN the first box is cut right in half by a pagebreak and everything's fine (although I believe it was not intentional... :)).
mdframed loads TikZ if you ask it to. As for the documentation of TikZ... hmm, I beg to differ: I truly think there are packages out there that are more comprehensively documented. Not that TikZ weren't a great tool. – Count Zero Feb 5 '12 at 8:56