# Avoid parentheses around optional header material in theorem environment

I would like to get rid of the around the optinal header material in my theorem environment. Here is a MWE

\documentclass{beamer}
\begin{document}
\setbeamertemplate{theorems}[numbered]
\newtheorem{MyHypo}{Hypothesis}
\begin{frame}
\begin{MyHypo}[insert text]
This is my hypothesis
\end{MyHypo}
\end{frame}

\end{document}


Is there another option for the setbeamertemplate to keep the numbering but avoid the ( ) for the text?

• Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Jun 24 '14 at 13:24
• sry just forgot to paste the \documentcalss{beamer} Jun 24 '14 at 13:31

You can redefine the theorem begin/numbered template:

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


With the redefinition, all theorems under the numbered template will have the parentheses removed.

• Nice! So beamer does not make use of amsthm! Jun 24 '14 at 15:40
• @Sigur: It does, but it redefines certain things.
– Werner
Jun 24 '14 at 19:17
• Nice! I tried to do the same for the ams style beamer template, changing numbered to ams style, but ran into errors. Any idea how I should proceed? Thanks! May 23 '17 at 17:49
• @Matifou: Perhaps consider a follow-up question?
– Werner
May 23 '17 at 18:13
• sure, here is the new post: tex.stackexchange.com/questions/371280/… thanks! May 23 '17 at 18:41