I am using the thmtools package to create my theorem environments and I would like to have a headpunct that depends on the start of a theorem: if it starts with an enumeration (that is, if it starts with the code \begin{enumerate}
) then I would like to use a point .
as headpunct, otherwise I'd like to use a dash ---
as headpunct.
I am able to define a command \dashorpoint
that checks the next character using \@ifnextchar
and depending on that gives me the right result. However, I can't use this command to solve my problem as it does not grab the first character of the theorem body when used in thmtools.
Is there an easy solution to this problem (without defining an extra theorem style)?
The following picture might explain my problem.
I have used thmtools
to create these environments but ideally I would like to use one single theorem style that automatically gives the right output.
Here I have a minimal example: I would like to have one theorem style defined for both cases, and I want to get rid of the ~ symbol that I am adding manually now.
\documentclass{article}
\usepackage{amsthm,thmtools}
\declaretheoremstyle[
notefont=\bfseries,
notebraces={}{},
headformat=\NUMBER\NOTE\ ,
headpunct=---,
]{dash}
\declaretheoremstyle[
notefont=\bfseries,
notebraces={}{},
headformat=\NUMBER\NOTE,
headpunct=.
]{point}
\declaretheorem[style=dash, name={}]{f}
\declaretheorem[style=point, name={}]{g}
\begin{document}
\begin{f} [Theorem]
\begin{enumerate}
\item bla blabla blablabla
\item bla blabla blablabla
\end{enumerate}
\end{f}
\bigskip
\begin{g} [Theorem] ~
\begin{enumerate}
\item bla blabla blablabla
\item bla blabla blablabla
\end{enumerate}
\end{g}
\end{document}