Putting text into a colorful box
You often see important content put into a colored box, especially on posters and slides, although it's used in other documents, too. In this recipe, we will put a little text and also whole paragraphs into a colored box. They can also have titles.
How to do it...
We will use the tcolorbox
package. It is based on pgf
, so you need to have that package installed as well.
We will create a box with the defaults, a titled box with split content, and boxes placed inline that fit the width of the content. Proceed as follows:
- Create a small document based on any document class. The
article
package is a simple choice. Load theblindtext
package to generate dummy text. This time, we will use thepangram
option to create short pangrams as dummy text. Theblindtext
package requires thebabel
package, so we load it before. We also set English as the language. Furthermore, load thetcolorbox
package. Our base document looks like this:\documentclass{article} \usepackage...