The environment align
isn't a splittable material by default. So you run into an loop which produce such unwanted space. However at the moment I am working on a fix. I think I will upload the new version at the weekend (inspired by Nicolas Markey).
To fix this with the current version use the following example which uses the command \allowdisplaybreaks
to make align splitable.
\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{mdframed}
\usepackage{blindtext}
\begin{document}
\blindtext \\ \blindtext \\ \blindtext
\allowdisplaybreaks
\begin{mdframed}
\rule{\linewidth}{0pt}
\begin{align*}
x^2 + y^2 = z^2 \\
x^2 + y^2 = z^2 \\
x^2 + y^2 = z^2 \\
x^2 + y^2 = z^2 \\
x^2 + y^2 = z^2 \\
x^2 + y^2 = z^2
\end{align*}
\end{mdframed}
\end{document}
If a list such as itemize
is placed at the start of a minipage its usual vertical spacing before the list is omitted.
Adding multicols
the way you did it is producing a box around the itemize
list just like a minipage and thus the \topsep
is not added. Instead what you see is the \multicolsep
which is added before and after the multicol
environment.
In article class (10pt) \topsep
has the value 8pt plus 2pt minus 4pt while \multicolsep
is something like 12pt which accounts for (most) of the differences experienced. Thus
\setlength\multicolsep{\topsep}
should in theory fix your problem.
However, your example also showed a glitch in multicols handling of \prevdepth
which accounts for 1.9994pt misalignment after the environment (happens happens only in "boxed" mode i.e. if the environment appears within a minipage or similar).
So additionally you need patch one of the multicol internals for now:
\usepackage{etoolbox}
\makeatletter
\patchcmd\page@sofar{\kern-\dimen\tw@ \ifdim\dimen\tw@}
{\kern-\dimen\tw@ \prevdepth\z@ \ifdim\dimen\tw@}
{\typeout{Success!}}{\ERRORpatching}
\makeatother
With those two adjustements you should see the following:
As requested here is the full MWE, if that doesn't work at your end you may have an older version of multicol
perhaps, this was run with version 2014/06/19 v1.8f.
\documentclass{article}
\usepackage{tikz}
\usepackage{enumitem}
\usepackage{multicol}
\raggedcolumns
\usepackage{etoolbox}
\setlength\multicolsep{\topsep}
\makeatletter
\patchcmd\page@sofar{\kern-\dimen\tw@ \ifdim\dimen\tw@}
{\kern-\dimen\tw@ \prevdepth\z@ \ifdim\dimen\tw@}
{\typeout{Success!}}{\ERRORpatching}
\makeatother
\begin{document}
\begin{minipage}[t]{0.44\linewidth}
The following are examples of numbers:
\begin{itemize}
\item 0ne,
\item $\pi$,
\item $2+3i$,
and
\item $0$.
\end{itemize}%
Some text following.
\end{minipage}%
\hfill%-------------------------
\begin{minipage}[t]{0.44\linewidth}
%% http://tex.stackexchange.com/questions/161966/spurious-vertical-space-introduced-by-multicols
%\setlength{\topskip}{\fontcharht\font`B }% Seems to have no effect
The following are examples of numbers:
\begin{multicols}{2}
\begin{itemize}
\item 0ne,
\item $\pi$,
\item $2+3i$,
\item $0$.
\item Two,
\item $e$,
\item $2-3i$,
and
\item $-0$.
\end{itemize}%
\end{multicols}%
Some text following.
\end{minipage}%
% Following manually tweaked to show the problem.
\begin{tikzpicture}[overlay, remember picture]
\draw [red] (-11.5cm,-1.16cm) -- ++(4.8in,0);
\draw [blue] (-11.5cm,-1.86cm) -- ++(4.8in,0);
\draw [orange] (-11.5cm,-3.95cm) -- ++(4.8in,0);
\end{tikzpicture}
\end{document}
Upate
A fix for this issue was added to multicol
1.8g. The new version is now on CTAN and should show up on distributions with update capabilities in a few days (once Heiko gets around providing the tls package).
Note that a suitable setting for \multicolsep
is still necessary (and will always be).
Best Answer
The culprit is not
mdframed
butamsthm
.In fact, the following example without
amsthm
yields
To obtain the style you want, you can redefine the
definition
style in this way:MWE:
Output: