I use amsthm
for my theorems, lemmas etc.
I'd like their numbering to look like that:
Theorem 1.1.1
Lemma 1.1.2
Definition 1.1.3
Theorem 1.2.1
Definition 1.2.2
Corollary 1.2.3
Theorem 2.1.1
etc.
To make the numbering "per-section" I did
\newtheorem{defi}{Definition}[section]
But then each theorem type I defined had its own counter. So I tried
\newtheorem{defi}[somecounter]{Definition}
But then the numbers are just plain, section part disappears!
So I'd like to write something like
\newcounter{somecounter}[section]
\newtheorem{defi}[somecounter]{Definition}[section]
But this doesn't work 🙁
How can I achieve such effect?
Best Answer
You need to make a "dummy" theorem and make all the others subordinate to that. For example:
Either the commented
\newtheorem
line or the\newcounter
line works; the\numberwithin
command is defined byamsmath
, but if you are usingamsthm
you are probably using that too. If not, then the\newtheorem
line works just withamsthm
.