1

When mdframed breaks a page, it appears that there is no vertical justification on the page before the page break. Compiling the code sample below for example, it can be seen that there is more vertical space left between the frame and the page number on page 2 than on page 1.

Is there a setting that can vertically justify the content in the frame, such that the page before the break is filled?

\documentclass{article}
\usepackage{mdframed}
\usepackage{lipsum}
\usepackage{colortbl}

\definecolor{lightgrey}{RGB}{229,229,229}

\mdfsetup{
 backgroundcolor=lightgrey,
 linewidth=0pt,
 skipabove=12pt,
 skipbelow=12pt,
 leftmargin=0pt,
 rightmargin=0pt,
 innertopmargin=10pt,
 innerbottommargin=10pt,
 innerleftmargin=10pt,
 innerrightmargin=10pt,
 splittopskip=2\topsep
 }

\begin{document}

\begin{mdframed}

\lipsum
\lipsum[1]
\begin{equation}
    c^2 = a^2 + b^2
\end{equation}
\lipsum[2]
\begin{equation}
    r^2 = x^2 + y^2
\end{equation}
\lipsum[3]

\end{mdframed}

\end{document}
  • 2
    Use tcolorbox instead of mdframed - it handles breaking much better. – Ulrike Fischer Mar 1 at 19:33
  • This is good advice. – woeterb Mar 1 at 22:21

Your Answer

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

Browse other questions tagged or ask your own question.