# mdframed nested frametitle bug

When nesting frames the inner most frametitle is used. The frametitle for all these is frame3.

\documentclass{book}
\usepackage{mdframed}
\begin{document}
\begin{mdframed}[frametitle={frame1}]
asdf
\begin{mdframed}[frametitle={frame2}]
134
\begin{mdframed}[ frametitle={frame3}]
asdf1324
\end{mdframed}
\end{mdframed}
\end{mdframed}
\end{document}


(mdframed v1.4)

-
 First time I see such a using. ;-). Note that this can't be splitted well. – Marco Daniel Mar 21 '12 at 10:31 Not sure what you mean that it can't be splitted well? Everything seems to work but the title(may not be perfect but works for what I'm trying to do). I suppose basically whatever function is not "reentrant" in that it uses a "global variable" for the frame title. What happens is the inner frame ends up overwriting the outer frame which is displayed after(for some reason, possibly to get the size right) the content of the frame. Should be an easy fix by just putting the title in a "local variable". – Uiy Mar 21 '12 at 11:54

EDIT: I uploaded a new test version to github. Please check it out.

https://github.com/marcodaniel/mdframed

With the current version you can't change this behavior. To assign the frame title I am using a group and the contents is saved in a box. To get a global access to the box I need the command \global. So in your case I overwrite the last frame title.