beamer中重定义AMSTHM定理环境—\renewtheorem的替代
重定义定理
只需将下列代码放到preamble, 注意beamer中需要放在CJK环境中. 就会实现重定义定理环境theorem(lemma等类似), 而且会自动编号.
\newtheorem*{inner}{\innerheader}
\newcommand{\innerheader}{}
\renewenvironment{theorem}
{\renewcommand\innerheader{定理\,\stepcounter{theorem}\thetheorem}\begin{inner}}
{\end{inner}}
定理分页
\newcounter{thmc}
\renewcommand{\thmhead}{定理\,\stepcounter{theorem}\thetheorem\setcounter{thmc}{0}}
\newcommand{\thmheadc}{定理\,\thetheorem\,续\,\stepcounter{thmc}\Roman{thmc}}
\makeatletter
\newenvironment<>{theorem}[1][\thmhead]{%
\par
\def\insertproofname{#1\@addpunct{.}}%
\usebeamertemplate{proof begin}#2}
{\usebeamertemplate{proof end}}
\makeatother
测试如下:
\documentclass[CJK]{beamer}
\usetheme{Warsaw}
\usepackage{CJK}
\usepackage{lipsum}
\begin{document}
\begin{CJK*}{GBK}{song}
\newcounter{thmc}
\renewcommand{\thmhead}{定理\,\stepcounter{theorem}\thetheorem\setcounter{thmc}{0}}
\newcommand{\thmheadc}{定理\,\thetheorem\,续\,\stepcounter{thmc}\Roman{thmc}}
\makeatletter
\newenvironment<>{theorem}[1][\thmhead]{%
\par
\def\insertproofname{#1\@addpunct{.}}%
\usebeamertemplate{proof begin}#2}
{\usebeamertemplate{proof end}}
\makeatother
\begin{frame}
\begin{theorem}
\lipsum[1]
\end{theorem}
\end{frame}
\begin{frame}
\begin{theorem}[\thmheadc]
\lipsum[1]
\end{theorem}
\end{frame}
\begin{frame}
\begin{theorem}[\thmheadc]
\lipsum[1]
\end{theorem}
\end{frame}
\begin{frame}
\begin{theorem}
\lipsum[1]
\end{theorem}
\end{frame}
\begin{frame}
\begin{theorem}[\thmheadc]
\lipsum[1]
\end{theorem}
\end{frame}
\end{CJK*}
\end{document}
本作品采用创作共用版权协议, 要求署名、非商业用途和保持一致. 转载本站内容必须也遵循署名-非商业用途-保持一致的创作共用协议.

发表回复