# Interaction with multicol and mdframed results in misaligned rows

This works fine with TeXLive2011 and was working fine with TeXLive2012 until I recently updated the packages. So with TexLive2011, this produces:

but with an updated TeXLive2012 this yields:

## Notes:

• Also there seems to be something going on with \x. Replace \Number in the MWE with \x and run with TeXLive2012 (with latest updates). Using \show\x shows that it is undefined, so not sure why there is a problem with using \x as the \foreach variable.
• There is an warning from mdframed

Package mdframed Warning: You have only a width of 3cm on input line 15

but not sure what it means, or what to do about it.

## Code:

\documentclass{article}
\usepackage{multicol}
\usepackage{pgffor}
\usepackage{parskip}
\usepackage{multicol}
\usepackage{mdframed}
\usepackage{showframe}

\begin{document}\raggedcolumns
\begin{multicols}{6}
\foreach \Number in {1,...,14} {%
\begin{mdframed}%
\mbox{AB-\Number}%
\end{mdframed}
}
\end{multicols}
\end{document}

• Not sure why the positioning is off but the warning you can just ignore it, as far as I can see 3cm is just an arbitrary check in the code it makes that warning if the width is small but carries on anyway, and with that many columns the width has to be that small. Apr 20, 2013 at 20:45
• The problem with \x is that it's used in the definition of \mdf@trivlist; it should be replaced by a private macro such as \mdf@temp. Apr 20, 2013 at 22:02
• Use tcolorbox ;-) Apr 21, 2013 at 7:29
• Please test the current version I uploaded at github. BTW: The \x wasn't the problem. And the warning results of an previous idea of mine: Normally you have a complete line width. After subtraction of all relevant length (line width, left margin, etc) The width should be more than 3cm. Apr 21, 2013 at 9:04
• @MarcoDaniel: The version on Github works better, but is missing the vertical spacing between the frames as shown in TeXLive2011 version image. Apr 21, 2013 at 17:58

With the current version of mdframed the behaviour is nearly equal. The shown distance of the older version was a bug where I didn't regard parskip at the beginning of the environment. The default behaviour of mdframed ought be skipabove=skipbelow=0pt whereby by using parskip the option was skipabove=\parskip

If you use the current version you will get the following result:

If you want extra space you can add some skip to skipabove:

\documentclass{article}
\usepackage{multicol}
\usepackage{pgffor}
\usepackage{parskip}
\usepackage{multicol}
\usepackage{mdframed}
\usepackage{showframe}

\begin{document}\raggedcolumns
\begin{multicols}{6}
\foreach \Number in {1,...,14} {%
\begin{mdframed}[skipabove=\parskip]%
\mbox{AB-\Number}%
\end{mdframed}
}
\end{multicols}
\end{document}