# I cannot get the numbers in theorem environment (thmtools)

I can't seem to get the numbers of my theorems back in my custom theorem environment, some help would be appreciated:

\documentclass[10pt,a4paper]{article}

\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{hyperref,nameref}

\makeatletter
\declaretheoremstyle[
spaceabove=6pt,
spacebelow=6pt,
notefont=\em\mdseries,
notebraces={(}{)},
bodyfont=\itshape,
]{theorem}
\makeatother

\declaretheorem[style=theorem,
numbered=yes,
name=Theorem,
refname={theorem,theorem},
Refname={Theorem,Theorems}]{theorem}

\begin{document}

\section{First section}
\begin{theorem}
First theorem
\end{theorem}

\begin{theorem}
Second theorem
\end{theorem}

\section{Second section}

\begin{theorem}
Third theorem
\end{theorem}

\end{document}


You simply format to add the \NUMBER command:

\documentclass[10pt,a4paper]{article}

\usepackage{xcolor}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{hyperref,nameref}

\makeatletter
\declaretheoremstyle[
spaceabove=6pt,
spacebelow=6pt,
notefont=\em\mdseries,
notebraces={(}{)},
bodyfont=\itshape,
]{theorem}
\makeatother

\declaretheorem[style=theorem,
numbered=yes,
name=Theorem,
refname={theorem,theorem},
Refname={Theorem,Theorems}]{theorem}

\begin{document}

\section{First section}
\begin{theorem}[First trial]
First theorem
\end{theorem}

\begin{theorem}
Second theorem
\end{theorem}

\section{Second section}

\begin{theorem}
Third theorem
\end{theorem}

\end{document}


• Thank you! So if I want to use the same theoremstyle for theorems and say propositions I would need to create a copy of the style whithout the number command? – WrabbitW Apr 8 '19 at 22:02
• Because you don't want them to be numbered? – Bernard Apr 8 '19 at 22:06
• Yes, my question should have been: Is there a way to put the \NUMBER command in the \declaretheorem instead of \declaretheoremstyle. – WrabbitW Apr 8 '19 at 22:15
• It seems the headformat key is known only to \declaretheoremstyle, so I think it isn't possible. See the keys known to \declaretheorem in §3.2 of the documentation, pp. 14-15. – Bernard Apr 8 '19 at 22:23
• Okay merci beaucoup pour votre aide! – WrabbitW Apr 8 '19 at 22:36