10

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.

1 Answer 1

17

Your counter resets at subsections not at sections, so

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

You must log in to answer this question.

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