定理和引理之后更新推论的计数器

定理和引理之后更新推论的计数器

我有以下定义:

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}

现在我想定义推论,以便它们的计数器在定理和引理之后按以下方式更新:

Theorem i
    Corollary i.1
    Corollary i.2
Lemma j
    Corollary j.1
    Corollary j.2

我该如何实现这一点?提前致谢。

答案1

假设您的代码加载amsthmntheorem包,我建议您创建类似推论的环境:corrtcorrl,分别用于与定理和引理相关的推论。

在此处输入图片描述

\documentclass{article} % or some other suitable document class

\usepackage{ntheorem} % no "." after theorem numbers
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{corrt}{Corollary}[theorem]
\newtheorem{corrl}{Colollary}[lemma]

\usepackage{amsmath}
\begin{document}
\begin{theorem} bla bla bla \end{theorem}
\begin{corrt} ble ble ble \end{corrt}
\begin{corrt} bli bli bli \end{corrt}

\medskip
\setcounter{lemma}{4}
\begin{lemma} blo blo blo \end{lemma}
\begin{corrl} blu blu blu \end{corrl}
\begin{corrl} bly bly bly \end{corrl}

\end{document}

相关内容