# Spacing with framed and mdframed packages

I have a slight problem with the framed package when combined with the itemize environment:

\documentclass[parskip]{scrartcl}
\usepackage{fancybox}
\usepackage{framed}

\newenvironment{simpages}%
{\endMakeFramed}

\begin{document}
Some text

\begin{simpages}
\begin{itemize}
\item Foo
\item Bar
\item Baz
\end{itemize}
\end{simpages}

Some more text

\end{document}


This leads to the following result:

As you can see, the vertical space above the items is much larger than the one below - this is what I would like to correct. I've tried to switch to the mdframed package as suggested here, but so far unsuccessfully:

\documentclass[parskip]{scrartcl}
\usepackage{mdframed}

\newmdenv{simpages}

\begin{document}
Some text

\begin{simpages}
\begin{itemize}
\item Foo
\item Bar
\item Baz
\end{itemize}
\end{simpages}

Some more text

\end{document}


The result is pretty much the same, only now the shadow effect is missing...

Why is the vertical space above and below the contents of the environment different, and how do I adjust it?

• You seem to be using an outdated version of mdframed; in my system (TeX Live2013) I use mdframed.sty 2013/07/01 1.9b: mdframed and the undesired space is not present. – Gonzalo Medina Jul 19 '13 at 21:32
• @GonzaloMedina: That might be the case, I'm still on TL 2012 here. However, is there an option to fix the issue with the framed package? I rather prefer the shadowed box :-) – vwegert Jul 19 '13 at 21:36
• Please see my updated answer; at the end there's one possible workaround using framed. – Gonzalo Medina Jul 19 '13 at 22:11

Here there are two options to produce the shadowed box, one using mdframed, and the other one with tcolorbox:

\documentclass[parskip]{scrartcl}
\usepackage[most]{tcolorbox}
\usepackage[framemethod=tikz]{mdframed}

\newmdenv[
{simpages}
\newtcolorbox{tsimpages}{
enhanced,
breakable,
arc=0pt,
outer arc=0pt,
colback=white,
}

\begin{document}
Some text

\begin{simpages}
\begin{itemize}
\item Foo
\item Bar
\item Baz
\end{itemize}
\end{simpages}
Some more text
\begin{tsimpages}
\begin{itemize}
\item Foo
\item Bar
\item Baz
\end{itemize}
\end{tsimpages}
Some more text

\end{document}


And with the framed package, making some adjustments so the parskip option doesn't interfere:

\documentclass[parskip]{scrartcl}
\usepackage{fancybox}
\usepackage{framed}
\usepackage{etoolbox}

\newenvironment{simpages}%
{\AtBeginEnvironment{itemize}{\parskip=0pt\parsep=0pt\partopsep=0pt}
{\endMakeFramed}

\begin{document}
Some text
\begin{simpages}
\begin{itemize}
\item Foo
\item Bar
\item Baz
\end{itemize}
\end{simpages}
Some more text

\end{document}