![在beamer中,如何让定理,定义,例子环境中的()变成[]?](https://linux22.com/image/376441/%E5%9C%A8beamer%E4%B8%AD%EF%BC%8C%E5%A6%82%E4%BD%95%E8%AE%A9%E5%AE%9A%E7%90%86%EF%BC%8C%E5%AE%9A%E4%B9%89%EF%BC%8C%E4%BE%8B%E5%AD%90%E7%8E%AF%E5%A2%83%E4%B8%AD%E7%9A%84()%E5%8F%98%E6%88%90%5B%5D%EF%BC%9F.png)
MNW 如下:
\documentclass[notheorems]{ctexbeamer}
\usetheme{Antibes}
\usepackage{amsmath,amsfonts,amssymb,comment}
\theoremstyle{theorem}
\newtheorem{theorem}{定理}
\newtheorem{lemma}[theorem]{引理}
\newtheorem{corollary}[theorem]{推论}
\newtheorem{proposition}[theorem]{命题}
\newtheorem{exercise}[theorem]{习题}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{定义}
\theoremstyle{example}
\newtheorem{remark}[theorem]{评注}
\newtheorem{example}[theorem]{示例}
\setbeamertemplate{theorems}[numbered]
\begin{document}
\begin{frame}\frametitle{experiment}
\begin{theorem}[外国人]
定理的本质意义呢?many 2
\end{theorem}
\begin{definition}
令其有限。
\end{definition}
\begin{remark}[中国]
$\mathbb{N}$是一个无穷集。
\end{remark}
\end{frame}
\end{document}
它被编译为
我的问题是:
- 如何让定理、定义、例子环境中包含定理注释的()变成[]?
我尝试了很多次但都失败了。所以欢迎任何帮助!
答案1
回答你的第一个问题:
这些()
是模板中的硬编码theorem begin
。要更改它,请重新定义模板。
\documentclass[notheorems]{beamer}
\usetheme{Antibes}
\usepackage{amsmath,amsfonts,amssymb,comment}
\newtheorem{theorem}{Theorem}
\setbeamertemplate{theorems}[numbered]
\makeatletter
\setbeamertemplate{theorem begin}
{%
\begin{\inserttheoremblockenv}
{%
\inserttheoremname
\inserttheoremnumber
\ifx\inserttheoremaddition\@empty\else\ [\inserttheoremaddition]\fi%
}%
}
\makeatother
\begin{document}
\begin{frame}
\frametitle{experiment}
\begin{theorem}[name]
text
\end{theorem}
\end{frame}
\end{document}