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).


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}


  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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