This is a follow-up question on Avoid parentheses around optional header material in theorem environment.
I want to do exactly the same (remove the parenthesis around the theorem optional header in a theorem, in beamer), but for ams style theorems. I am indeed using ams style theorems, not the numbered ones, i.e. I use \setbeamertemplate{theorems}[ams style]
, not \setbeamertemplate{theorems}[numbered]
as in the other post. How should I adjust the code there?
A naive change of \defbeamertemplate{theorem begin}{numbered}
to \defbeamertemplate{theorem begin}{ams style}
ran into the error: LaTeX Error: Command \beamer@@tmpop@theorem begin@ams style already defined.
Here is the code that works for [numbered], and that I would like to adapt for [ams style]:
\documentclass{beamer}
\makeatletter
\expandafter\let\csname beamer@@tmpop@theorem begin@numbered\endcsname\relax
\defbeamertemplate{theorem begin}{numbered}
{%
\begin{\inserttheoremblockenv}
{%
\inserttheoremname
\inserttheoremnumber
\ifx\inserttheoremaddition\@empty\else\ \inserttheoremaddition\fi% (\inserttheoremaddition)
}%
}
\makeatother
\setbeamertemplate{theorems}[numbered]
\newtheorem{MyHypo}{Hypothesis}
\begin{document}
\begin{frame}
\begin{MyHypo}[insert text]
This is my hypothesis
\end{MyHypo}
\end{frame}
\end{document}
amsmath
. theorems are defined byamsthm
, so i've changed the tag.