Hi folks!
I've looking for a method to create a box in my document with a grey background colour or something. I want the shape of the box to be rectangular, but with rounded corners and the edges should have their own colour too.
Is this possible? I've seen it used in different books for describing either examples or algorithms.
/Casper
General ⇒ Box with rounded corners
NEW: TikZ book now 40% off at Amazon.com for a short time.

Re: Box with rounded corners
The fancybox package is a good place to start:
http://www.ctan.org/tex-archive/help/Ca ... cybox.html
Other alternatives are listings.sty framed.sty and boites.sty:
http://www.ctan.org/tex-archive/help/Ca ... oites.html
For really fancy boxes you can try using TikZ or PSTricks. Here is a TikZ example:
http://www.fauskes.net/pgftikzexamples/ ... -and-math/
Unfortunately this only works well if the box fits on a page, since there is no automatic page breaking inside a tikzpicture environment.
Hope this helps.
Regards,
Kjell Magne Fauske
http://www.ctan.org/tex-archive/help/Ca ... cybox.html
Other alternatives are listings.sty framed.sty and boites.sty:
http://www.ctan.org/tex-archive/help/Ca ... oites.html
For really fancy boxes you can try using TikZ or PSTricks. Here is a TikZ example:
http://www.fauskes.net/pgftikzexamples/ ... -and-math/
Unfortunately this only works well if the box fits on a page, since there is no automatic page breaking inside a tikzpicture environment.
Hope this helps.
Regards,
Kjell Magne Fauske
Box with rounded corners
This works very well, but I can't seem to change the colour of the background. Do you have any ideas for that?propell wrote:The fancybox package is a good place to start:
http://www.ctan.org/tex-archive/help/Ca ... cybox.html
/Casper
Re: Box with rounded corners
Unfortunately I don't see any obvious way to set the background color. This thread recommends using framed.sty or boites.sty:
http://groups.google.com/group/comp.tex ... e611ce2e2b
Not sure if they support rounded corners...
- Kjell Magne
http://groups.google.com/group/comp.tex ... e611ce2e2b
Not sure if they support rounded corners...

- Kjell Magne