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
\colorbox{green}{\begin{minipage}{\slwidth}
Some text
\end{minipage}}
lead to a box which was a bit wider than the original minipage. Any suggestions?
Best Answer
You have to set
\fboxsep=0pt
to avoid the extra padding around the minipage. Try this: