# thmtools: Footnotes in theorem names and notes

I am using the thmtools package as a frontend to amsthm to typeset various types of theorems. Sometimes I feel the need to put a footnote either directly at the theorem name or inside the theorem note.

To be preicse, when this is my document:

\documentclass{scrartcl}
\usepackage{amsthm}
\usepackage{thmtools}
\declaretheorem[name=Theorem]{mytheorem}
\begin{document}
\begin{mytheorem}[Some reference]
This statement is true.
\end{mytheorem}
\end{document}


I'd like to put footnotes at the positions indicated here:

For position 1, the solution given here for amsthm is working fine with thmtools when changing \thetheorem to \themytheorem.

For position 2 there is no problem when just using amsthm without thmtools: something like \begin{mytheorem}[Some reference\footnotemark] followed by a \footnotetext{...} nearby just works. However, when using thmtools this results in the following error:

! Argument of \@begintheorem has an extra }.
<inserted text>
\par


Of course, after carefully phrasing a question and preparing a MWE, I figured out how to achieve the desired result.

This seems to be the common problem of a fragile command in a moving argument and using \protect fixes that.

So the following works:

\documentclass{scrartcl}
\usepackage{amsthm}
\usepackage{thmtools}
\declaretheorem[name=Theorem]{mytheorem}
\begin{document}

\begin{mytheorem}[Some reference\protect\footnotemark]
\footnotetext{This is a footnote}
This statement is true.
\end{mytheorem}
\end{document}