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.

The theorem count doesn't update when I move to another section. I.e. I'm currently in section 6, and LyX has already in theorem 30, when theorem 1 is in section 1. How can I make LyX start counting the theorems and lemmas from "1" in each new section?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

If you add the Theorems (Numbered by Section) module your theorems will be numbered 1.x for the first section, 2.x for the second, etc.

If you for some reason don't want the section number in the theorem number (which you should, if you're cross referencing theorems), you can add to the preamble (Document --> Settings --> LaTeX preamble) the following.

\makeatletter
\@addtoreset{thm}{section}
\makeatother

(Assuming you're using the Theorems (AMS) module, I didn't check if other theorem modules have other names for that counter.)

Note that the LyX view will not have the correct numbers with this last method, but the PDF will be correct.

Reference: Resetting theorem counters: \sections and (missing) \subsections

share|improve this answer
    
Thanks a lot ! It worked ! Many Thanks ! –  joshua Nov 10 '12 at 18:04
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.