I want to make a tcolorbox with a number. I currently have created a new command
\newenvironment{mybox}{\begin{tcolorbox}\centering}{\end{tcolorbox}}
I want to display numbering inside the tcolorbox.
I find this The first style numbering tcolorbox, but i can not combine it with mine.
I only want to add a number in the box.
I tried to do \newenvironment{mybox}{\begin{tcolorbox}[within=section]\centering}{\end{tcolorbox}}but it wont work.
and i also want to \ref the box in this way \ref{first box}
\begin{mybox}\label{first box}
bla,bla,bla...
\end{mybox}
please someone help me!!

\label{}this way. – xiaojiuwo Feb 07 '20 at 13:10[label=]? i really want to use the normal label way. – xiaojiuwo Feb 07 '20 at 13:28\label? This way is the same command buta la tcolorboxstyle. If you insist with\label, you can use it inside title option, but the reference is just the box number without the section component. Another solution could be to use a\newtcbtheoremwhere labels are automatically created and you don't use\labelat all. – Ignasi Feb 07 '20 at 13:40\newtcolorboxi want to use\label{}when i create a box\begin{mybox}\label{}, and the\refseems not the box number, how can i format it? – xiaojiuwo Feb 07 '20 at 13:46