Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a document with a lot of lemmas and theorems. In the main part of the document there are sections and subsections, so I defined

\newtheorem{lem}{Lemma}[subsection]

to number the lemmas accordingly. But in the appendices I don't have subsections, so I figured it would be better if lemmas in the appendices are not numbered with respect to subsections, but with respect to sections. Therefore, I gave the command

\renewcommand\thelem{\thesection.\arabic{lem}}

just after opening the appendices with \appendix. But something strange happened. In appendix A I don't have lemmas. In appendix B the first lemma is numbered B.3. Could anyone explain me this behavior and suggest a solution?


Edit: If I give the command

\renewcommand\thelem{\thesection.\arabic{lem}}
\setcounter{lem}{0}

the first lemma will be numbered B.1. But I'm still confused about why it is necessary to set the counter to 0.

share|improve this question
add comment

1 Answer

up vote 12 down vote accepted

Your counter resets at subsections not at sections, so

\makeatletter
\@addtoreset{lem}{section}
\makeatother
share|improve this answer
    
If I do this the number of the first lemma will be B.0.1. –  Egbert May 31 '12 at 12:23
    
I meant do that at the point that you rededine the counter, not at the satrt –  David Carlisle May 31 '12 at 12:27
    
Ah sorry, I commented away \renewcommand\thelem... (which is silly, I admit). It works now, thanks! –  Egbert May 31 '12 at 12:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.