Text Formattinglemma numbering across sections

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
nullgraph
Posts: 1
Joined: Sun Apr 04, 2010 8:58 pm

lemma numbering across sections

Post by nullgraph »

Hi, I'm using package amsthm. My theorem is in section 1. I want to number my theorem such that it has the section number, so I used:

Code: Select all

 \newtheorem{theorem}{Theorem}[section]
So my theorem is called Theorem 1.1
Now in section 2, I have my lemma, but I also want my lemma to use the theorem counter (i.e. it should be called Lemma 1.2), so I did:

Code: Select all

\newtheorem{lemma}[theorem]{Lemma}
But instead of following the theorem counter, it seems that the section counter inherited from theorem took over, so my lemma is numbered as Lemma 2.1. Is there any way to number my lemma after my theorem consistently across different sections? I'm thinking of maybe setting the lemma counter manually, but then it wouldn't reference the theorem counter. Another fix that would work for me is Theorem 1.1 and then Lemma 1.1.1 (still in a different section), but I don't know how to do that.

Any help greatly appreciated!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

youngprof
Posts: 8
Joined: Thu Apr 08, 2010 9:18 pm

Re: lemma numbering across sections

Post by youngprof »

The optional argument in brackets for you [section] sets the counter to reset itself when you switch sections. If you are fine with theorems,lemmas, etc numbered continuously throughout the document just leave the brackets empty; similarly, to get the 1.1.1 sort of numbering use the optional argument [subsection]. If you want just a single theorem to be not reset across the section break but everything else to change numbers I think you'll have to do it manually.
Post Reply