Using \newtcbtheorem
, how do we reference the created environment?
\documentclass{article}
\usepackage[most]{tcolorbox}
\tcbuselibrary{theorems}
\usepackage{cleveref}
\crefname{exa}{example}{Example}
\Crefname{exa}{Example}{Example}
\newtcbtheorem[auto counter, number within = section]
{Example}{Exam\smash{p}le}{%
breakable,
fonttitle = \bfseries,
colframe = blue!75!black,
colback = blue!10
}{exa}
\begin{document}
\begin{Example}{Example}{exam}
Some example
\end{Example}
\noindent
\Cref{exa:exam}
\end{document}
Using tcbmaketheorem
, I used \newcounter{exa}
, but I can't get referencing to work here.