2

Apparently there is a known issue with using mdframed inside a multicol environment. For me it seems to work fine including page breaks, but column breaks act all funny and typically push the entire frame to column 2 instead of splitting it like I want.

I've been trying to decipher the manual, but it makes no sense to me. Specifically in chapter 10, Examples, there is an example on page 32 (example 2) that shows exactly my failed situation and seemingly another on page 33 (example 3) that is working. I can't make out what the difference is or how to code it so that it works.

Can anybody offer insight in English that makes sense as to what the key is to getting the effect of a framed box to split over a multi-page multi-columned environment?

Edit: The break points must be determined automatically as my content is auto-generated.

1
  • 1
    page 33 is set in twocolumn mode, not with multicol. Try out tcolorbox. Mar 28, 2015 at 18:47

1 Answer 1

3

As mentioned by Ulrike, you can try the tcolorbox. An example adopted from manual:

\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{multicol}
\usepackage{lipsum}
\begin{document}
  \begin{multicols}{2}
\lipsum[2]
\begin{tcolorbox}[enhanced jigsaw,breakable,size=title,
colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries,
title=My breakable box,pad at break=1mm, break at=12.8cm/0pt ]
\lipsum[2-10]
\end{tcolorbox}
\lipsum[4]
\end{multicols}
\end{document}

enter image description here

For more details, see the manual, page 307, section 15.5. Watch out for /tcb/break at and /tcb/height fixed for and set the proper values.

2
  • I'm afraid this doesn't really solve my problem as tcolorbox is too crippled for my purpose. From the manual: «But choosing break points for a breakable box cannot be done by the balancing routine of multicols.» My documents and the content of the boxes are auto-generated. I can't go hand generating all the break points as you've had to do in this example.
    – Caleb
    Mar 29, 2015 at 4:45
  • @Caleb Too sad that you are out of luck then. I will delete the answer if you wish.
    – user11232
    Mar 29, 2015 at 4:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .