我们可以先导入包:
\usepackage{amsthm}
但,由于,这个包已经在amsmath中包含了,故而只包含amsmath就够了。
\usepackage{amsmath}
用法
\newtheorem {环境名} {标题} [排序单位]
将下面放入导言区:
\newtheorem{example}{例} % 整体编号
\newtheorem{algorithm}{算法}
\newtheorem{theorem}{定理}[section] % 按 section 编号
\newtheorem{definition}{定义}
\newtheorem{axiom}{公理}
\newtheorem{property}{性质}
\newtheorem{proposition}{命题}
\newtheorem{lemma}{引理}
\newtheorem{corollary}{推论}
\newtheorem{remark}{注解}
\newtheorem{condition}{条件}
\newtheorem{conclusion}{结论}
\newtheorem{assumption}{假设}
使用
\section{定义示例}
\begin{definition}
This is a definition1.
\end{definition}
\begin{definition}
This is a definition2.
\end{definition}
\section{定理示例}
\begin{theorem}
This is a theorem1.
\end{theorem}
\begin{theorem}
This is a theorem2.
\end{theorem}
结果
解释:
- 我们设置的定义环境是 全局编号。 而定理环境是 按 Section 编号。