I am using the mdframed package to mark specific paragraphs with vertical lines in the left and right page margin. This works well but if such a paragraph spans two pages, i.e. has a page break in between, for some reason the last line on the first page is empty.

The effect can be seen in the picture of this question (it also provides a MWE but no solution to my problem as far as I can see): mdframed box spanning over page break: prevent images in between

Any idea/suggestion how I can ensure that this line is not "wasted"?

Thanks a lot in advance!

  • are you sure a line would fit at the bottom? Jun 1, 2017 at 15:40
  • Well, it surely looks like it given the amount of vertical space and, given that mdframed extends the vertical lines down to the very bottom of the page, this also suggests (at least to me) that it considers this as a line internally. In any case, the output doesn't look nice. Jun 1, 2017 at 15:42
  • @tex almost never works in "lines" with the default raggedbottom setting then if there is say 90% of the height of a line left at the bottom you have a space of that size but with mdframed the frame comes to the bottom of the page so extends below the last line. Jun 1, 2017 at 15:49

1 Answer 1


I advise you to use tcolorbox instead of mdframed if you want breakable frames – it is much more stable.

Beside this: The space is controlled by the key splitbottomskip. You can set it to 0pt (the default is 10pt, even if the documentation says otherwise):





enter image description here

You must log in to answer this question.

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