Does anyone know how to shade the background and put a border around a multicol environment, where page breaks are needed.

There is a couple of posts around, most notably, multicols within colorbox, but there seems to be problems.

The best looking environment is the tcolorbox, but, cant do pagebreaks.

mdframed appears to overflow when pagebreaks are required (ie when multicol env. across multiple pages)

I really don't have an MWE, given the above comments RE tcolorbox and mdframed.

-
 – Werner Jan 10 at 8:41 In my previous answer, if you need a border (since the background is already fixed), you just have to change the color colframe=white from the tcolorbox version or linecolor=white in the mdframed version. – Claudio Fiandrino Jan 10 at 8:50 @Werner, Im getting errors with that solution. Im running Article, not memoir perhaps. – ADP Jan 10 at 8:58 @Claudio. tcolor box is the best, but it cant pagebreak.... – ADP Jan 10 at 8:59 @ADP: I agree with you :); my previous comment should be intended as a way to get the border that in the other question was not necessary. Notice, however, that in the solution suggested by Werner, the first example has article as documentclass: only the second goes under memoir. – Claudio Fiandrino Jan 10 at 9:58

You might want to play with the spacing a bit but something like this

\documentclass{article}
\usepackage{multicol,color}

\makeatletter
\let\old@page@sofar\page@sofar
\let\old@box\box
\let\old@rlap\rlap
\def\page@sofar{%
\let\box\colorcolumn
\def\rlap{\let\box\old@box\old@rlap}%
\old@page@sofar
}
\def\colorcolumn#1{%
\kern\dimexpr-\fboxrule-\fboxsep\relax
{\let\box\old@box\fcolorbox{red}{yellow}{\box#1\llap{\phantom p}}}%
\kern\dimexpr-\fboxrule-\fboxsep\relax
}

\makeatother

\def\a{Red blue green yellow black white. }
\def\b{One two three four five six. }
\def\c{\stepcounter{enumi} \Roman{enumi}
\a\a\b\b\a\a\b\a\a\b\b\b\b\b\b\a\a\b}
\begin{document}

\begin{multicols}{3}
\c\c\c\c\c\c\c\c\c\c
\end{multicols}

\end{document}

-
Nice. So you actually hook into multicols "column output routine"? – Martin Schröder Jan 10 at 12:25
yes @page@sofar is Frank's macro that lines up the boxes with the column text and inserts inter-column rules, This just patches it to add some colour at the same time. – David Carlisle Jan 10 at 12:51