I would like the use the package showlabels to display the labels of everything I have in my document, as https://www.overleaf.com/learn/latex/Latex-questions/Keep_track_of_your_labels_with_showlabels demonstrates. I'm using the newtcbtheorem environment to create theorem/lemma boxes, which automatically come with labels (as discussed here: Main text of tcbtheorem environment absorbed into options). However
\documentclass{article}
\usepackage{amsmath}
\usepackage{tcolorbox}
\tcbuselibrary{theorems}
\tcbuselibrary{breakable}
\usepackage[colorlinks = true, urlcolor = red]{hyperref}
\usepackage{pifont}
\usepackage{showlabels}
\newtcbtheorem[number within=section]{mylemma}{Lemma}%
{colframe=blue!45!white,enlarge top by=0.15cm,before
skip=3pt,after skip=6.5pt,fonttitle=\slshape,breakable}{lem}
\usepackage{thmtools}
\declaretheorem[name=Theorem,numberwithin=section]{thm}
\begin{document}
[
E=mc^2 \label{eq:einstein} \tag{\ding{37}}
]
As we can see from \eqref{eq:einstein}
\begin{mylemma}{Substitution lemma}{substitution}
Lemma in a tcolorbox
\end{mylemma}
Reference to the lemma \ref{lem:substitution}
\end{document}
the lemma box is not visibly labelled in the output (whereas the explicitly \labeled equation is):
(MWE inspired in part by Label equation with a symbol).