如何让 4 个不同的定理环境在 ntheorem 中连续编号?

如何让 4 个不同的定理环境在 ntheorem 中连续编号?

我正在使用 ntheorem 包,不久前对其进行了自定义。我希望我的命题、定理、推论和引理按以下方式编号(对于第 1 章 - 全部编号,无论它们是四个中的哪一个):1.1、1.2、1.3 等。然后,在第 2 章中(同样,无论它们是四个中的哪一个):2.1、2.2、2.3 等。

这是我的 MWE。出于某种原因,当我拿出整个文档并尝试制作 MWE 时,它无法编译。我收到一条错误消息:

undefined control sequence \begin{prop}

但是,我的整个文档都是这样的。

\documentclass[12pt]{report}

\usepackage{amsmath,amscd,amsbsy,array,color,pxfonts,latexsym}
\usepackage{mathtools}

\usepackage[amsmath,framed,thmmarks]{ntheorem}
\usepackage{amssymb}
\usepackage[thmmarks]{ntheorem}

\newtheorem{Theorem}{Theorem}

\theoremclass{Theorem}
\theoremstyle{break}
\theoreminframepreskip{0pt}
\theoreminframepostskip{0pt}
\theoremframepreskip{1cm}
\theoremframepostskip{1cm}
\theoremstyle{break}
\def\theoremframecommand{%
\psshadowbox[fillstyle=solid,fillcolor=cyan,linecolor=black]}
\newshadedtheorem{them}{Theorem}[section]

\theoremclass{Theorem}
\theoremstyle{break}
\theoreminframepreskip{0pt}
\theoreminframepostskip{0pt}
\theoremframepreskip{1cm}
\theoremframepostskip{1cm}
\theoremstyle{break}
\def\theoremframecommand{%
\psshadowbox[fillstyle=solid,fillcolor=gray,linecolor=black]}
\newshadedtheorem{prop}{Proposition}[section]

\theoremstyle{break}
\theoremsymbol{\ensuremath{\heartsuit}}
\theoremindent0.5cm
\theoremnumbering{arabic}
\newtheorem{lema}{Lemma}

\theoremindent0cm
\theoremsymbol{\ensuremath{\spadesuit}}
\theoremnumbering{arabic}
\newtheorem{coro}{Corollary}[section]

\title{MWE}
\author{Michael Dykes}

\begin{document}    
\maketitle

\chapter{Analysis}
\section{The Set of Natural Numbers}

\begin{prop}[Cancellation Law for Addition]
If $x+z=y+z$ for some $x,y,z \in \mathbb{N}$, then $x=y$.
\end{prop}

\begin{lema}
For $x,y \in \mathbb{N}$ and $y \ne 0$, we have that $x+y \ne x$.
\end{lema}

\begin{them}[Trichotomy Law for Addition]
For any $x,y \in \mathbb{N}$, \textbf{exactly one} of the following three statements is true:
\begin{enumerate}[label=\roman*.]
    \item $x=y$;
    \item $x=y+z$ for some $z \in \mathbb{N}^*$;
    \item $y=x+z$ for some $z \in \mathbb{N}*$.
\end{enumerate}
\end{them}

\end{document}

非常感谢!

答案1

这就是所寻求的吗?

在此处输入图片描述

\documentclass[12pt]{report}

\usepackage{amsmath,amscd,amsbsy,array,color,pxfonts,latexsym}
\usepackage{mathtools}
\usepackage{enumitem,pstricks,framed} 
\usepackage[amsmath,framed,thmmarks]{ntheorem}
\usepackage{amssymb}
\usepackage[thmmarks]{ntheorem}

%\newtheorem{Theorem}{Theorem} % not needed

\theoremclass{Theorem}
\theoremstyle{break}
\theoreminframepreskip{0pt}
\theoreminframepostskip{0pt}
\theoremframepreskip{1cm}
\theoremframepostskip{1cm}
\theoremstyle{break}
\def\theoremframecommand{%
\psshadowbox[fillstyle=solid,fillcolor=cyan,linecolor=black]}

\newshadedtheorem{them}{Theorem}[chapter] % <---------- modified

\theoremclass{Theorem}
\theoremstyle{break}
\theoreminframepreskip{0pt}
\theoreminframepostskip{0pt}
\theoremframepreskip{1cm}
\theoremframepostskip{1cm}
\theoremstyle{break}
\def\theoremframecommand{%
\psshadowbox[fillstyle=solid,fillcolor=gray,linecolor=black]}

\newshadedtheorem{prop}[them]{Proposition} % <----- modified

\theoremstyle{break}
\theoremsymbol{\ensuremath{\heartsuit}}
\theoremindent0.5cm
\theoremnumbering{arabic}

\newtheorem{lema}[them]{Lemma} % <----- modified

\theoremindent0cm
\theoremsymbol{\ensuremath{\spadesuit}}
\theoremnumbering{arabic}

\newtheorem{coro}[them]{Corollary} % <----- modified

\title{MWE}
\author{Michael Dykes}

\begin{document}    
\maketitle

\chapter{Analysis}
\section{The Set of Natural Numbers}

\begin{prop}[Cancellation Law for Addition]
If $x+z=y+z$ for some $x,y,z \in \mathbb{N}$, then $x=y$.
\end{prop}

\begin{lema}
For $x,y \in \mathbb{N}$ and $y \ne 0$, we have that $x+y \ne x$.
\end{lema}

\begin{them}[Trichotomy Law for Addition]
For any $x,y \in \mathbb{N}$, \textbf{exactly one} of the following three statements is true:
\begin{enumerate}[label=\roman*.]
    \item $x=y$;
    \item $x=y+z$ for some $z \in \mathbb{N}^*$;
    \item $y=x+z$ for some $z \in \mathbb{N}*$.
\end{enumerate}
\end{them}

\begin{coro}
nice corrolary 
\end{coro}

\end{document}

相关内容