I'm currently using the mdframed package for a custom environment for my master's thesis. In rare cases, the environment shows some rather strange behaviour — the correctly split environment (i.e. the two, or sometimes even three parts) skips a page!
What I mean by that is, that the environment gets split as it should be, into two or sometimes three parts. However, the first part is not printed on the page were it should be, but on the next page. The second part is then printed on the subsequent page, and so on.
I've been trying to re-create this behaviour for a MWE, but I haven't succeeded yet. I cannot post the LaTeX code of my thesis, but I could post part of the PDF which shows this unwanted behaviour.
The definition of my custom environment might help though — it is largely based on an answer to one of my other questions (see Combining `tikzpicture` and `lstlisting`).
\usepackage[framemethod=TikZ]{mdframed}
\makeatletter
\def\mdf@@codeheading{Default}%
\define@key{mdf}{title}{%
\def\mdf@@codeheading{#1}
}
\mdfdefinestyle{nicebox}{%
innertopmargin=16pt,
innerbottommargin=8pt,
middlelinewidth=.8pt,
outerlinewidth=4pt,outerlinecolor=white,
innerleftmargin=10pt,
innerrightmargin=10pt,
leftmargin=-4pt,rightmargin=-4pt,
skipabove=\topskip,
skipbelow=\topskip,
roundcorner=4pt,
singleextra={\node[draw, fill=white, thick, anchor=west, xshift=10pt+1pt, font=\bfseries] at (O|-P) {\csname mdf@@codeheading\endcsname \space \theboxnumber};},
firstextra={\node[draw, fill=white, thick, anchor=west, xshift=10pt+1pt, font=\bfseries] at (O|-P) {\csname mdf@@codeheading\endcsname \space \theboxnumber};}
}
\newenvironment{boxenv}[2]{%
\incboxnumber
\label{#2}
\bigskip
\mdframed[style=nicebox,title={#1}]
}{\endmdframed}
splittopskip. – Marco Daniel May 17 '13 at 19:07overlayto the node properties of my environment. Thanks Marco! – Ailurus May 20 '13 at 08:32