我想在我的定理环境中摆脱 optinal 标头材料。这是一个 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}
setbeamertemplate 是否有其他选项可以保留编号但避免在文本中使用 ( )?
答案1
您可以重新定义theorem begin
/numbered
模板:
\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}
随着重新定义,全部模板下的定理numbered
将被删除括号。