Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

enter image description here

but with an updated TeXLive2012 this yields:

enter image description here

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}
share|improve this question
    
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. –  David Carlisle Apr 20 '13 at 20:45
2  
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. –  egreg Apr 20 '13 at 22:02
    
Use tcolorbox ;-) –  Marco Daniel Apr 21 '13 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. –  Marco Daniel Apr 21 '13 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. –  Peter Grill Apr 21 '13 at 17:58

1 Answer 1

up vote 5 down vote accepted

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: enter image description here

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

enter image description here

\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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.