I would like to construct a new environment that I can call like:

\begin{Box}{*Title of Box*}

** Text **
** Math equations **


It shall have the following properties:

  • The box background shall have a colour.
  • The text inside the box shall have a distance of 3 - 5 mm to the boundary.
  • Important: It shall break at the end of a page and continue at the next page.

Is there someone who can do that?

  • 4
    Use the package tcolorbox. Jun 2, 2016 at 11:08
  • Welcome to TeX.SE. How wide should be color box be?
    – Mico
    Jun 2, 2016 at 11:37

1 Answer 1


This can be achieved with tcolorbox, one of my favourite packages (;-))



% Define a new box for this
\newtcolorbox[auto counter]{MyBox}[2][]{%
  title={MyBox \thetcbcounter\ #2},


\begin{MyBox}{My nice title box}





\begin{MyBox}[width={0.5\textwidth},coltitle={blue}, colbacktitle={gray},colback={green!60!blue}]{My nice title box, but not so wide}






enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .