0

I am working with the ntheorem package and a while back customized it. I would like my propositions, theorems, corollaries, and lemmas to be numbered as followed (for Chapter 1 - all of them regardless of which of the four they are): 1.1, 1.2, 1.3 etc. Then, in Chapter 2 (again regardless of chiwh of the four they are): 2.1, 2.2, 2.3 etc.

Here is my MWE. For some reason when I take my entire document and attempt to make a MWE, it does not compile. I get an error message:

undefined control sequence \begin{prop}

However, my entire document does.

\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}

Thanks so much!

2
  • Hi. If you want to have the theorem-like environments share a common chapter-number prefix, why do you run instructions such as \newshadedtheorem{them}{Theorem}[section] and \newtheorem{coro}{Corollary}[section]? This makes the section number, not the chapter, the common prefix. Please advise.
    – Mico
    Jan 29, 2019 at 17:40
  • @Marco: I would like the numbering to be according to chapters, so what I'm really looking for is for all four of those types of environments to be numbered consecutively throughout a given chapter. Jan 29, 2019 at 19:16

1 Answer 1

1

Is that what is seeked ?

enter image description here

\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}
1
  • @Michael Dykes Pleased to know that your problem is solvef Jan 30, 2019 at 0:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .