5

I created an mdframed-based theorem environment as follows:

\newmdtheoremenv[outerlinewidth=0pt,
leftmargin=0pt,rightmargin=0pt,
innerleftmargin=4pt,outermargin=0pt,
innermargin=0pt,innerrightmargin=4pt,
innerbottommargin=2pt,innertopmargin=3pt,
skipbelow=1.5ex plus2pt minus2pt,
skipabove=1.5ex plus2pt minus2pt]{theoreme}[dummy]{Théorème}

with, I think, an elastic vertical stretch when needed before and after the frame. What's strange is that the \flushbottom option is ignored when the frame is split across pages, as illustrated below:

enter image description here

Is there an mdframed option that handles this issue?

A MWE is suggested below:

\documentclass[11pt,fleqn]{book}
\usepackage{lipsum}
\usepackage{amsmath,amsthm}
\usepackage[framemethod=tikz]{mdframed}
\usepackage[showframe,top=3.2cm,bottom=3.2cm,left=3.25cm,right=3.25cm,headsep=12pt,a4paper]{geometry}
\theoremstyle{plain}
\newmdtheoremenv[backgroundcolor=red!10,%
innerbottommargin=2pt,innertopmargin=3pt,%
skipbelow=1.5ex plus2pt minus2pt,%
skipabove=1.5ex plus2pt minus2pt,linecolor=red!50]{theorem}{Theorem}
\begin{document}
\chapter{Title}
\lipsum[1-3]
\begin{theorem}\lipsum[1-2]
\end{theorem}
\end{document}
  • Can you provide a minimal working example (MWE). The picture you provide needs mode than your code snippet to create it. Also do you mean "flushbottom option", if so to what, or "\flushbottom command"? – Andrew Swann Sep 11 '13 at 9:30
  • @AndrewSwann I just edited my message. This should show the problem. Thanks. – pluton Sep 12 '13 at 2:20
2

Adding a stretchable space before the break seems to do the trick. This is done via the option:

 beforebreak={\vspace{0pt plus 1filll}}

Less stretchable fills get swallowed. The example below gives

Bottom of page 1

at the bottom of page 1, and

Bottom of page 2

at the bottom of page 2.

\documentclass[11pt,fleqn]{book}

\usepackage{lipsum}

\usepackage{amsmath,amsthm}

\usepackage[framemethod=tikz]{mdframed}

\usepackage[showframe,top=3.2cm,bottom=3.2cm,left=3.25cm,right=3.25cm,headsep=12pt,a4paper]{geometry}

\theoremstyle{plain}
\newmdtheoremenv[backgroundcolor=red!10,%
innerbottommargin=2pt,innertopmargin=3pt,%
skipbelow=1.5ex plus2pt minus2pt,%
skipabove=1.5ex plus 2pt minus2pt,
beforebreak={\vspace{0pt plus 1filll}},
linecolor=red!50]{theorem}{Theorem}

\begin{document}

\chapter{Title}

\lipsum[1-3]

\begin{theorem}
  \lipsum[1-2]
\end{theorem}

\lipsum[4-6]

\begin{theorem}
  \lipsum[7-8]
\end{theorem}

\end{document}
  • It is interesting but in a sense not entirely satisfactory since the stretch only affects the box, and is not evenly distributed over the page. It would be nice to have all the stretches of the current page combined to this one. – pluton Sep 12 '13 at 14:57
  • A nice compromise would be a mix of \pagebreak and mdframed box breaks. – pluton Sep 29 '13 at 0:43

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.