The new environment

Hi, I want to define a new environment like the figure above. It has two text blocks with different background color. Block 1 has a short numbered title, such as 'Note' or 'Definition'. Block 2 has a specific indent.

I tried several ways. The first is package mdframed. I need two blocks, but the package usually provides one block. All the examples in the manual also have only one block.

The second way is to use tabular environment. But I don't know how to make this a new environment with numbers.

Would anybody please give me an example? Thank you.

1 Answer 1


Something like this? The tcolorbox package can do this using the tcblower code. In order to make full use of the package, an environment with \DeclareTColorbox should be used, for some options and to use an automated \tcblower.



\newtcolorbox[auto counter]{mynote}[1][]{
  sharp corners,
  detach title,before upper={\tcbtitle~\thetcbcounter~\par},
  before lower={\parindent20pt},



\begin{mynote}[colbacklower={white},before lower={\parindent40pt}]


enter image description here

  • Thank you, Christian. Your answer solved my question. tcolorbox is really a useful package. After reading part of the manual of this package, I learned a lot. With the use of detach title, I can get what exact I want (put the title in the upper box with thetcbcunter). Dec 10, 2015 at 21:22
  • @ChangjieGUAN: I would say, tcolorbox is one of the most powerful packages concerning colored boxes etc. I wished I had invented it ;-) If you don't mind you can accept my answer ;-)
    – user31729
    Dec 10, 2015 at 21:25

You must log in to answer this question.

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