Is it possible to get a (breakable) frame like this with mdframed? Or as a more general question. Can one access the coordinates of the frame that is drawn with TikZ?

With a pagebreak in it:


I build this example with the following code.
\documentclass{scrartcl}
\usepackage{environ}
\usepackage{tikz}
\usetikzlibrary{calc}
\NewEnviron{excursustikz}{%
\par
\vspace{0.5\baselineskip}%
\noindent
\begin{tikzpicture}%
\node (body) [%
text width=\textwidth-4pt-2ex,
inner sep=0pt,
] {\BODY};
\draw [
line width=4pt,
blue,
line cap=round,
rounded corners=2ex,
->
] ($(body.south west)+(5em,-2ex)$) -| ($(body.west)+(-2ex,0)$) |- %
($(body.north)+(-12em,2ex)$) .. controls +(0:10em) and +(190:5em) .. ++(20em,2ex);
\node [blue,fill=white] at ($(body.north west)+(3.5em,2.36ex)$) {\sffamily\bfseries Excursus};
\end{tikzpicture}%^
\par
\vspace{0.25\baselineskip}%
}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{excursustikz}
\lipsum[2]
\end{excursustikz}
\lipsum[3]
\end{document}
The node that I imagine to use is body, but I’m not sure if mdframed uses a node internally. Furthermore one has to care about a page spanning frame. In that case the line at the right should be broken, as if you cut the path in two parts.
\tikzmark, but handing the page crossing boundary is a bit more difficult. – Peter Grill Mar 10 '12 at 17:57mdframedwhich handles the breaks very well and uses (can use) TikZ to draw the frames – Tobi Mar 10 '12 at 18:24mdframedknows how to break text when it encounters a page boundary, but not how to place material on a page before the start of anmdframed, which is the case you point out where the frame begins on a subsequent page. If you are only interested in the case where themdframedbegins on the same page as the text you want to point to, but that the text box can span pages, that is different. – Peter Grill Mar 10 '12 at 18:28mdframedfor the computing and the lines can be drawn by the predefined coordinatesOandP. For the settings inmdframed.styI recommendtopline=true,leftline=true,bottomline=true,rightline=false. – Marco Daniel Mar 10 '12 at 19:48