# Avoid parentheses around optional header material in theorem environment for ams style?

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
}%
}
\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}

• this has nothing to do with amsmath. theorems are defined by amsthm, so i've changed the tag. – barbara beeton May 24 '17 at 0:17

\defbeamertemplate{theorem begin}{ams style} is defined in beamerbaseauxtemplates.sty, ll. 771. To remove the parenthesis:

\documentclass{beamer}

\setbeamertemplate{theorems}[ams style]
\newtheorem{MyHypo}{Hypothesis}

\makeatletter
\setbeamertemplate{theorem begin}
{%
\begin{\inserttheoremblockenv}
{%
\inserttheoremname
\inserttheoremnumber
\inserttheorempunctuation
}%
}
\makeatother

\begin{document}

\begin{frame}
\begin{MyHypo}[insert text]
This is my hypothesis
\end{MyHypo}
\end{frame}

\end{document}