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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In extending a previous question, Shaded multicols, how can I put rounded corners on the multicol environment, for the outer 4 corners (ie the corners directly next to the page margins)

This question is only really relevant when multicol shading is used, or multicol borders are used, a solution contained in part I of this question (see above link).

So main thing is that the environment needs to be able to page break mid way through. David Carlisle has suggested in one of the comments to patch the box command, but how can this be done to only round the left 2 corners for a left column, the right 2 corners for a right column and, no corners in a middle column (when there are 3 or more columns).

share|improve this question
up vote 8 down vote accepted

enter image description here

As noted in the question, this essentially just replaces \fcolorbox with mdframed (with thanks to Marco for supplying the right mdframed incantation)


           \hbox{\box#1\llap{\phantom p}}}%


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


share|improve this answer
Thanks a million, but how is it exactly determining if the column is left, right or middle? Presumably it will work for 'n' columns? – Nicholas Hamilton May 30 '13 at 22:17
@ADP as written it works for any n so long as n=3. \ifnum#1=\mult@rightbox is the right box \ifnum#1=\numexpr\mult@rightbox+4\relax should be + 2*(n-1) for the left box and the middle one should be the else clause for the other cases. – David Carlisle May 30 '13 at 22:29
He he he. any n as long as n = 3...., funny. – Nicholas Hamilton May 30 '13 at 22:34
@DavidCarlisle When I use your code in twoside mode I have problems with the margins: tex.stackexchange.com/questions/136434/… Do you have any idea what's going wrong? – susis strolch Oct 10 '13 at 12:46
@susisstrolch note that the code here is tuned for 3 columns and you have 2 so you'll need to make adjustments. None of the mdframed margin options are relevant as it is not using mdframed breakable frames it is just using mdframed as a convenient fancy alternative to \fbox to frame a box within the page (as constructed by multicol) – David Carlisle Oct 10 '13 at 13:16

Your Answer


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.