beamer中重定义AMSTHM定理环境—\renewtheorem的替代

Vanabel/ 5月 15, 2015/ LaTeX/ 0 comments

重定义定理

只需将下列代码放到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

测试如下:

\usetheme{Warsaw}




\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*}
 
Share this Post

Leave a Comment

您的电子邮箱地址不会被公开。 必填项已用*标注

*
*

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据