I would like to have something like a minipage with colored background, i.e. a box where you can predefine the width and the background color. My attempt

Some text

lead to a box which was a bit wider than the original minipage. Any suggestions?

  • Add \fboxsep0pt before.
    – yannisl
    Apr 1, 2013 at 19:23

2 Answers 2


You have to set \fboxsep=0pt to avoid the extra padding around the minipage. Try this:

  Some text

Some text
  • 1
    Using a group the setting will be local.
    – egreg
    Apr 1, 2013 at 19:54
  • @egreg True. I am not too sure what the OP wants though, as a colorbox without a bit of padding does not look very sexy.
    – yannisl
    Apr 1, 2013 at 20:03
  • Possibly a very thin padding is better.
    – egreg
    Apr 1, 2013 at 20:12
  • I works well; the aim is to produce boxes of given width which can be converted to images by the "preview"-package. Apr 2, 2013 at 19:45

Test this. Wrapfigure is optional, but I like adding it and I like that it works!


\begin{tcolorbox}[colback=gray!5,colframe=green!40!black,title=In short]
Example text ... blabla         
  • 3
    Why do you use a wrapfigure? Does it really solve the 'old' question? A full example with some screenshot would be appreciated!
    – user31729
    Sep 22, 2014 at 0:02

You must log in to answer this question.

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