Tcolorbox Theorem environment doesnt show first character

tcolorboxtheorems

I was going to use tcolorbox theorem environment using a guide on this stackexchange. In the example there, it is good. However when I tried it myself, it always didnt show the first character (so I need to put Enter or {}).

Here is my code

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{tikz}
\usepackage{tcolorbox}
\tcbuselibrary{theorems}

\newtcbtheorem
[]
{define}
{Definition}
{
colback = blue!5,
colframe = blue!35!black,
fonttitle = \bfseries
}
{def}

\begin{document}

\begin{define}{Test 1}
Test abcd
\end{define}

\end{document}

and here is my result

enter image description here

Can somebody help me? I know the problem were minor, but I want to know the correct way of using tcolorbox theorem environment. Any help would be appreciated!

Best Answer

The define environment specified via \newtcbtheorem requires two mandatory parameters, both of which can be empty {}. The first is the title and the second is the <marker> used as a \label and can be referenced via \ref{def:<marker>}:

enter image description here

Including the hyperref package makes the reference a link. You can also use the nameref package for more options.

Code:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{tikz}
\usepackage{tcolorbox}
\tcbuselibrary{theorems}
\usepackage{hyperref}

\newtcbtheorem
[]
{define}
{Definition}
{
colback = blue!5,
colframe = blue!35!black,
fonttitle = \bfseries
}
{def}

\begin{document}

\begin{define}{Test 1}{Test Theorem Label}
Test abcd
\end{define}

As per theorem \ref{def:Test Theorem Label}, we see that
all our problems are now solved.

\end{document}