I want to typset some text with colored background and outline, that spans the whole \textwidth
. I tried to get this with a colorbox
surrounding a parbox
. It works in some way, but the colorbox
is always a bit bigger than the parbox
, causing the colored fill to overlap the outline a bit:
Is there any way to fix this? I didn't find one. The corresponding code:
\newcommand{\information}[1]{\colorbox{DarkOliveGreen2}{\fboxsep4mm\framebox[\textwidth][l]{\parbox{\linewidth}{\textbf{foo: } #1}}}}
Any ideas are greatly appreciated. Thanks!
Edit: As supposed in the comments: I already tried removing or changing the \fboxsep
-value, but it doesn't change the behavior. Just the space between the text and the border of the boxes tightens, and I want that space...
\fboxsep
value, i.e. it's too large\fboxsep4mm
so you can change it\fboxsep