I have some tcbtheorems that are usually unnumbered but I want to have the flexibility to use them numbered as well.
Here is a minimal example:
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{multicol}
\tcbset{
detach title,
fonttitle=\bfseries,
coltitle=black,
before upper={\tcbtitle},
terminator sign={.},
}
\newtcbtheorem[]{myproof1}{Proof}{ colframe=gray }{}
\newtcbtheorem[]{myproof2}{Proof}{ colframe=red, before upper={\tcbtitle~} }{}
\newtcbtheorem[]{myproof3}{Proof}{ colframe=blue, terminator sign={.~} }{}
\begin{document}
\begin{multicols}{2}
\begin{myproof1*}{}{}
This is a proof.
\end{myproof1*}
\begin{myproof2*}{}{}
This is a proof.
\end{myproof2*}
\begin{myproof3*}{}{}
This is a proof.
\end{myproof3*}
\begin{myproof1}{}{}
This is a proof.
\end{myproof1}
\begin{myproof2}{}{}
This is a proof.
\end{myproof2}
\begin{myproof3}{}{}
This is a proof.
\end{myproof3}
\end{multicols}
\end{document}
The gray box is how I normally have things set up and it works perfectly fine until I decide to use it numbered. There should be a space between the number and the content of my box.
I tried to fix this behaviour by adding a tilde after the title (red box) or by adding a tilde after the terminator sign (blue box). Both work as expected, but now there is an extra whitespace in the unnumbered boxes.
I would like to have a single tcbtheorem that behaves like so:
before upper*={\tcbtitle}
seems to work.