[Tex/LaTex] Empty last line before page breaks using mdframed

mdframedpage-breaking

When using mdframed, there is an empty last line before page breaks as follows

|----------------------------|
| xxxx xxx xxx xxxx xxx xxxx |
| xxxx xxx xxx xxxx xxx xxxx |
|                            |
<page break>
| xxxx xxx xxx xxxx xxx xxxx |
| xxxx xxx xxx xxxx xxx xxxx |
|----------------------------|

How to fill this last line of the page? Here is a MWE

\documentclass[10pt]{article}

\usepackage[margin=2cm,a4paper]{geometry}
\usepackage{mdframed}
\mdfsetup{skipabove=0pt,skipbelow=0pt,topline=false,
innertopmargin=2pt,innerbottommargin=2pt,innerleftmargin=2pt,innerrightmargin=2pt}
\usepackage{lipsum}
\usepackage{colortbl}
\definecolor{gray}{gray}{0.9}

\begin{document}

\noindent
\begin{tabular}{|p{8mm}|p{4cm}|p{8cm}|p{2.45cm}|}\hline
\rowcolor{gray} \bf No. & \bf Title & \bf WP Leader & \bf Months \\\hline
WP1 & Title & Partner & m6--m45 \\\hline
\end{tabular}
\vspace*{-2pt}
\begin{mdframed}
\textbf{Objectives}\quad
\lipsum[1-3]
\end{mdframed}%
\begin{mdframed}
\textbf{Description of Work and Role of Partners}\quad
\lipsum[4-7]
\end{mdframed}%
\begin{mdframed}
\textbf{Description of Deliverables}\quad
\lipsum[4-8]
\end{mdframed}%

\vspace{2pt}

\noindent
\begin{tabular}{|p{8mm}|p{4cm}|p{8cm}|p{2.45cm}|}\hline
\rowcolor{gray} \bf No. & \bf Title & \bf WP Leader & \bf Months \\\hline
WP2 & Title & Partner & m6--m45 \\\hline
\end{tabular}
\vspace*{-2pt}
\begin{mdframed}
\textbf{Objectives}\quad
\lipsum[1-3]
\end{mdframed}%
\begin{mdframed}
\textbf{Description of Work and Role of Partners}\quad
\lipsum[4-7]
\end{mdframed}%
\begin{mdframed}
\textbf{Description of Deliverables}\quad
\lipsum[4-8]
\end{mdframed}%

\end{document}

Best Answer

The extra space below is splitbottomskip. The documentation says the default is 0pt, but that is not true: it is 10pt. And so is splittopskip but I think this is measured from the baseline of the first line to the top of the frame, so that seems reasonable.

So the solution is to add splitbottomskip=0pt to \mdfsetup.

Related Question