muzimuzhi / thmtools

New home for LaTeX package bundle thmtools
LaTeX Project Public License v1.3c
16 stars 3 forks source link

beamer theorem syntax not fully supported #57

Open mbertucci47 opened 7 months ago

mbertucci47 commented 7 months ago

The beamer syntax \begin{theorem}<overlay spec>[heading] is not supported by thmtools while the alternative syntax \begin{theorem}[heading]<overlay spec> is.

\documentclass{beamer}
\setbeamertemplate{theorems}[numbered]
\usepackage{thmtools}

\declaretheorem{MyTheorem}

\begin{document}

\begin{frame}
\begin{MyTheorem}[name=bla]
first text
\end{MyTheorem}
\begin{MyTheorem}<2->[name=bla]
second text
\end{MyTheorem}
\begin{MyTheorem}[name=bla]<3->
third text
\end{MyTheorem}
\end{frame}

% Compare:

\begin{frame}
\begin{theorem}[bla]
first text
\end{theorem}
\begin{theorem}<2->[bla]
second text
\end{theorem}
\begin{theorem}[bla]<3->
third text
\end{theorem}
\end{frame}

\end{document}
beamer-ex

It's confusing to me that the heading/options are silently ignored in the <2->[name=bla] example, which makes me think that thmtools' intention is to support this syntax, but something is going awry in the code. I haven't spent the time to understand parseargs so I can't debug the definition of \thmt@parsetheoremargs at the moment.