4

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?

2
  • 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.
    – jub0bs
    Jun 24, 2014 at 13:24
  • sry just forgot to paste the \documentcalss{beamer}
    – Max M
    Jun 24, 2014 at 13:31

1 Answer 1

5

You can redefine the theorem begin/numbered template:

enter image description here

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

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

5
  • Nice! So beamer does not make use of amsthm!
    – Sigur
    Jun 24, 2014 at 15:40
  • @Sigur: It does, but it redefines certain things.
    – Werner
    Jun 24, 2014 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!
    – Matifou
    May 23, 2017 at 17:49
  • @Matifou: Perhaps consider a follow-up question?
    – Werner
    May 23, 2017 at 18:13
  • sure, here is the new post: tex.stackexchange.com/questions/371280/… thanks!
    – Matifou
    May 23, 2017 at 18:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .