[Tex/LaTex] Common numbering with ntheorem

ntheoremnumberingtheorems

I have the exact same question as detailed in Common, per-section numbering of theorems, lemmas etc., but I am using ntheorem and so can't use the accepted answers code. Does anyone know how to adapt this to the case of ntheorem? Thanks!

Here is a MWE

\documentclass{article}

\usepackage{amsmath,amssymb,amscd,thmtools,amscd}

\usepackage{eucal}

\usepackage[thmmarks]{ntheorem}

\newcounter{dummy} \numberwithin{dummy}{section}


\theoremprework{\setlength
\theorempreskipamount{10 pt}\setlength\theorempostskipamount{10 pt}}

\theoremstyle{plain}
\theorembodyfont{\upshape}
\theoremsymbol{\ensuremath{\clubsuit}}
\theoremseparator{:}
\newtheorem{example}{Example}[dummy][subsection]

\theoremstyle{plain}
\theorembodyfont{\upshape}
\theoremsymbol{\ensuremath{\blacklozenge}}
\theoremseparator{:}
\newtheorem{remark}{Remark}[dummy][subsection]

\theoremprework{\setlength\theorempreskipamount{10 pt}}

\theoremstyle{plain}
\theorembodyfont{\slshape}
\theoremsymbol{}
\theoremseparator{:}
\newtheorem{theorem}{Theorem}[dummy][subsection]

\theoremstyle{plain}
\theorembodyfont{\slshape}
\theoremsymbol{}
\theoremseparator{:}
\newtheorem{prop}{Proposition}[dummy][subsection]


\theoremstyle{plain}
\theoremheaderfont{\upshape \bfseries}
\theorembodyfont{\slshape}
\theoremsymbol{}
\theoremseparator{:}
\newtheorem{corollary}{Corollary}[dummy][subsection]

\theoremstyle{plain}
\theoremheaderfont{\upshape \bfseries}
\theorembodyfont{\slshape}
\theoremsymbol{}
\theoremseparator{:}
\newtheorem{lemma}{Lemma}[dummy][subsection]

\begin{document}

\begin{theorem} Hey
\end{theorem}

\begin{lemma}I
\end{lemma}
 
\begin{prop}Just
\end{prop}

\begin{remark}Met
\end{remark}

\begin{example}You
\end{example}

\end{document}

At the end I would like it to look something like

1 First Section

1.1 First Subsection

Theorem 1.1.1

Proposition 1.1.2

Lemma 1.1.3

1.2 Second Subsection

Theorem 1.2.1

Proposition 1.2.2

Lemma 1.2.3

Best Answer

From your code, it seems that you want each of the theorem-like environments to inherit the subsection counter. As such, I have used

\newcounter{dummy} 
\numberwithin{dummy}{subsection}

in the below.

Note that you can use

\newtheorem{example}[dummy]{Example}

which tells the newtheorem command to make the example counter inherit the dummy counter, but not

\newtheorem{example}{Example}[dummy][subsection]

as this is undefined.

screenshot

Here's the complete MWE:

\documentclass{article}

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

\newcounter{dummy}
\numberwithin{dummy}{subsection}

\theoremprework{\setlength
\theorempreskipamount{10 pt}\setlength\theorempostskipamount{10 pt}}

\theoremstyle{plain}
\theorembodyfont{\upshape}
\theoremsymbol{\ensuremath{\clubsuit}}
\theoremseparator{:}
\newtheorem{example}[dummy]{Example}

\theoremstyle{plain}
\theorembodyfont{\upshape}
\theoremsymbol{\ensuremath{\blacklozenge}}
\theoremseparator{:}
\newtheorem{remark}[dummy]{Remark}

\theoremprework{\setlength\theorempreskipamount{10 pt}}

\theoremstyle{plain}
\theorembodyfont{\slshape}
\theoremsymbol{}
\theoremseparator{:}
\newtheorem{theorem}[dummy]{Theorem}

\theoremstyle{plain}
\theorembodyfont{\slshape}
\theoremsymbol{}
\theoremseparator{:}
\newtheorem{prop}[dummy]{Proposition}


\theoremstyle{plain}
\theoremheaderfont{\upshape \bfseries}
\theorembodyfont{\slshape}
\theoremsymbol{}
\theoremseparator{:}
\newtheorem{corollary}[dummy]{Corollary}

\theoremstyle{plain}
\theoremheaderfont{\upshape \bfseries}
\theorembodyfont{\slshape}
\theoremsymbol{}
\theoremseparator{:}
\newtheorem{lemma}[dummy]{Lemma}

\begin{document}

\section{Section}
\subsection{SubSection}
\begin{theorem} Hey
\end{theorem}

\begin{lemma}I
\end{lemma}

\begin{prop}Just
\end{prop}

\begin{remark}Met
\end{remark}

\begin{example}You
\end{example}

\subsection{SubSection}
\begin{theorem} Hey
\end{theorem}

\begin{lemma}I
\end{lemma}

\begin{prop}Just
\end{prop}

\begin{remark}Met
\end{remark}

\begin{example}You
\end{example}
\end{document}