General ⇒ Box with rounded corners
Box with rounded corners
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Re: Box with rounded corners
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
http://groups.google.com/group/comp.tex ... e611ce2e2b
Not sure if they support rounded corners...

- Kjell Magne