\documentclass[12pt]{article} \usepackage[number in = section]{fancythm} \makeatletter %\@counteralias{insection}{indocument} \makeatother \ExplSyntaxOff \AddProvidedFancyTheoremToGroup{lemma}{small} \begin{document} \section{test} \stepcounter{toplevel} \begin{example} test \end{example} \begin{example}+ test \end{example} \begin{example}* \end{example} \begin{lemma} \end{lemma} \begin{definition} test \end{definition} \begin{definition}* bla \end{definition} \begin{theoremdef} test \end{theoremdef} \begin{goal}+ test \end{goal} \end{document}