我想要定理标签和 beamer 定理中的内容而不是斜体。
目前它显示像
我想要“这是一个定理”而不是斜体。
\documentclass{beamer}
\makeatletter
\setbeamertemplate{theorem begin}{%
{%
{\bfseries\upshape\inserttheoremname%
\ifx\inserttheoremaddition\@empty\else\ \inserttheoremaddition \fi}%
\space\normalfont%
}%
}
\setbeamertemplate{theorem end}{}
\makeatother
\begin{document}
\begin{frame}{Theorem}
\begin{theorem}[hello]
This is a theorem
\end{theorem}
\end{frame}
\end{document}
答案1
你可以移动\normalfont
到组外,这样它也会影响定理的主体:
\documentclass{beamer}
\makeatletter
\setbeamertemplate{theorem begin}{%
{%
{\bfseries\upshape\inserttheoremname%
\ifx\inserttheoremaddition\@empty\else\ \inserttheoremaddition \fi}%
}%
\space\normalfont%
}
\setbeamertemplate{theorem end}{}
\makeatother
\begin{document}
\begin{frame}{Theorem}
\begin{theorem}[hello]
This is a theorem
\end{theorem}
\end{frame}
\end{document}