0

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? – David Carlisle Jun 1 '17 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. – andyknownasabu Jun 1 '17 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. – David Carlisle Jun 1 '17 at 15:49
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):

\documentclass{scrbook}
\usepackage{lipsum}
\usepackage{mdframed}
\usepackage[demo]{graphicx}

\begin{document}
\mainmatter\chapter{MWE}
\lipsum[1-4]

\begin{mdframed}[splitbottomskip=0cm]
\lipsum[4-6]
\end{mdframed}%

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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