This issue is fixed in version 1.6b
mdframed at github

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

        \begin{mdframed}[ frametitle={frame3}]

(mdframed v1.4)

  • First time I see such a using. ;-). Note that this can't be splitted well. Mar 21, 2012 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, 2012 at 11:54

2 Answers 2


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


enter image description here

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.

I will think about this request and maybe I will change the implementation.

This is the best answer I can provide so far

  • In some other questions I had several answers that used a global stack. Maybe you can use the interpretations it as a quick and easy solution? (simply push the title on the "stack" on each nesting then pop them when ready to use)
    – Uiy
    Apr 14, 2012 at 23:02
  • @Uiy: Do you have a link? Apr 14, 2012 at 23:02
  • tex.stackexchange.com/questions/51070/… My guess is, any time you use the title text, just convert to using the stack... need to push it at the start of the environment and then pop it and use it right when it is displayed... this should reduce all issues unless you have to deal with measuring issues in which case you might try poping it and using it right before the geometrical calculations.
    – Uiy
    Apr 14, 2012 at 23:17
  • 1
    @Uiy: I remember this question. I will think about this tomorrow. Apr 14, 2012 at 23:25
  • @Uiy: Please see my update. Apr 27, 2012 at 23:14

I also had problems with nested boxes using mdframed inside a beamerposter document (nested boxes are quite common on posters). I decided to give tcolorbox a try, and it has no problems with arbitrarily nested boxes (this is example is stolen from the CTAN package example file):

\section{Boxes in boxes}
  every box/.style={fonttitle=\bfseries},title=Box]
    title=Box inside box,drop fuzzy shadow]
    \begin{tcolorbox}[beamer,colframe=blue!50!black,title=Box inside box inside box]
      An now for something completely different: Boxes!\par\medskip
      \newtcbox{\mybox}{nobeforeafter,tcbox raise base,colframe=green!50!black,colback=green!10!white,arc=0pt}
      \mybox{This} \mybox{is} \mybox{another} \mybox{box.}

Nested boxes using tcolorbox

Have a look at the beautiful documentation with lots of examples. Especially noteworthy are the available skins, e.g. the "enhanced" skin which uses TikZ internally. With this, you can create box designs you would not have thought are possible in Latex, have a look here.

So while this might not solve your problem, it provides a good alternative for typesetting nested framed boxes in Latex.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .