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'm typing my lecture notes in one big .lyx file, and I use numeration to keep stuff organised in the TOC:

  • Numbered Sections for Lectures\Recitations\Tutorials
  • Numbered Subsections for Lecture\Recitation\Tutorial parts (e.g. For search algorithms, to distinguish between BFS and DFS)
  • Numbered Subsubsections for Lemmas, Theorems, Examples and the etc.

Since I wasn't doing that from the beginning, I've just finished converting what I've already typed, and all the numbers are correct. But, when I begin typing a new Section, when I don't have a Subsection in it, the numeration continues from the last Subsubsection instead of starting over. In other words, this is what happens:

End of Lecture 2:

3.3.5 Conclusion

Begining of Lecture 3:

4 Lecture number 03 - 07.11.2011

4.0.6 Lemma:

Screenshot: screenshot illustrating the problem

How can it be solved, to output:

4.0.1 Lemma:

without adding Subsection between the Section and the Subsubsection? I've tried to do that, and it results:

4 Lecture number 03 - 07.11.2011

4.1 Dummytext

4.1.1 Lemma:

But it don't need the Subsection there...

share|improve this question
    
Welcome to TeX.sx! Please make sure that all images are uploaded using the official stackexchange interface, i.e. the image icon on top of the text field (shortcut: CTRL+G). This ensures that all images are always accessible and do not expire. (As new user without image posting privileges simply include the image as normal and remove the ! in front of it to turn it into a link. A moderator or another user with edit privileges can then reinsert the ! to turn it into an image again.) –  diabonas Dec 25 '11 at 11:45
    
@diabonas Thanks! –  Khaloymes Dec 25 '11 at 11:51
    
Re: Wrong numbering persists in LyX editor: It would be best to repost this as a fresh question. Follow-up questions like this are more than welcome! Please use the "Ask Question" link for your new question; there you can link to this question to provide the background. –  lockstep Dec 25 '11 at 13:15
    
@lockstep Done –  Khaloymes Dec 25 '11 at 13:32
add comment

1 Answer

up vote 2 down vote accepted

Instead of adding a "Dummytext" subsection, you have to add the following ERT ("Evil Red Text", i.e., LaTeX code) at the same place in your document:

\setcounter{subsubsection}{0}

See Resetting theorem counters: \sections and (missing) \subsections for some background information.

share|improve this answer
    
Thank you! It works the way I wanted it! Would you suggest adding such ERT every time I begin a new Section or should I just "patch" the document when this problem occures? –  Khaloymes Dec 25 '11 at 11:32
    
Because "missing" subsections before subsubsections aren't too common, I'd rather go for the second approach. –  lockstep Dec 25 '11 at 11:36
    
I think I was in a hurry, but now I see that while in the pdf output, the numbering is correct, in the LyX editor, I still see the wrong numbering. Is there a way to fix it there as well? –  Khaloymes Dec 25 '11 at 12:49
    
@Khaloymes Sorry, I don't know enough about LyX to answer this. –  lockstep Dec 25 '11 at 12:50
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.