TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I tried to create a child frame inside a parent frame by mdframed as





enter image description here

Question1: How to wrap text around the child frame? Filling the empty space on the left with the text of parent frame.

Question2: The child frame title will conquer the parent frame title. Thus, we will not have the parent frame title, but an induced copy of the child frame title. How to keep the frame titles independently?

share|improve this question
Question2: according to the package author, this is impossible with the current version: see mdframed nested frametitle bug. – Gonzalo Medina Apr 19 '12 at 22:16
Do you need page breaking for your "child"? – Marco Daniel Apr 20 '12 at 9:12
@MarcoDaniel yes, it is a useful feature of mdframed which I do not want to miss. The content of child frame may be long flowing to the next page. Moreover, we do not know where the parent frame starts, maybe it's the bottom of page; thus, child can continue to the next page, – All Apr 20 '12 at 11:40
up vote 4 down vote accepted

To both requests I have to answer with no.

The first one can be implemented but I'm not able to do the second one. I have no idea how to solve the following problem.

To illustrate my problem here is an example:

\setbox\mybox\vsplit\mybox to 3cm

\setbox\mybox\vsplit\mybox to 3cm

EDIT: If you don't need a page break inside the nested mdframed environment you can use the following code which uses the package cutwin.




The result of the first page will be

enter image description here

share|improve this answer
I understand the situation. I hope to find a solution for this, making mdframed more powerful. This is of particular importance, as this behavior is practically missed in all latex packages (no practical solution). What is your solution to build child frames without pagebreak? This is what wrapfig does, but I prefer mdframed as it has better features to play on. – All Apr 20 '12 at 11:55
@Ali: Do you want to know a solution where no page break is needed for the child? Do I understand you correct? – Marco Daniel Apr 20 '12 at 11:57
Yes, it is better than nothing. I am currentling using minipage within wrapfig to do so. It is better to do everything with mdframed as the parent is already mdframed. – All Apr 20 '12 at 12:01
@Ali: I edited my answer. – Marco Daniel Apr 20 '12 at 12:39
Thanks, it's an interesting solution, but I doubt if it can be practical. You are indeed attaching two independent frames with cutwin; not dealing with the child frame within the parent framework. This is not suitable for complicated documents having several mdframed parent frames. What I like about mdframed is that it somehow keeps the frame separate from the reset of the document. – All Apr 20 '12 at 13:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.