I want to use the restatable package with a custom environment. It almost works except when I restate with \name* it does not use the original label.
Before you ask, I'm not using newtheorem because its formatting doesn't agree with me needs and using amsthm, to my dismay, is not an option.
Here's a minimal example:
\documentclass{article} \usepackage{thmtools} \newcounter{main} \newcommand{\envheader}[2]{% \refstepcounter{main}\par\smallskip \textbf{{#2}~\thesection.\themain.} \if\relax\detokenize{#1}\relax\else{({#1})}\fi %% Name of the theorem } \newenvironment{theorem}[1][]{\envheader{#1}{Theorem}\itshape\/}{\smallskip} \newenvironment{lemma}[1][]{\envheader{#1}{Lemma}\itshape\/}{\smallskip} \begin{document} \begin{restatable}{theorem}{mytheorem}\label{thm:mytheorem} How you doin'? \end{restatable} \mytheorem* \end{document} Here's what I get:

