# How can I produce this colored box in LaTeX?

I would like to create a LaTeX document with math problems and their solutions, where the statement of each problem goes inside a box like this one:

How can I produce this result (or a similar one) in LaTeX?

• Take a look at the tcolorbox package. – erik Feb 17 '17 at 18:07
• With the knowledge that tcolorbox can produce this type of output, can you put some effort into trying to reproduce it? If you're still stuck after that, post the code that you've tried and the experts here will take that as foundation. – Werner Feb 17 '17 at 18:16
• Of course, I wasn't trying for someone else to do all the work, I just needed a hint, I'm going to try now and see if I can figure it out. I had no idea that the tcolorbox package existed, thank you very much! – Wild Feather Feb 17 '17 at 18:18

Just in case it helps someone else, this was my solution using the tcolorbox package:

\documentclass[a4paper,12pt]{article}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz,lipsum,lmodern}
\usepackage[most]{tcolorbox}
\begin{document}
\begin{tcolorbox}[
colback=Magenta!5!white,
colframe=Magenta!75!black,
title={\centering Homework}]
The math problem should be here...
\end{tcolorbox}
\end{document}


The output is a colored box very similar to the one I posted in my question.

• tcolorbox is a tikz based package, no need to load tikz beforehand, as well as title={Homework},halign title=center is a little bit cleaner than title={\centering Homework} – user31729 Feb 17 '17 at 18:54