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...

  • 1
    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, 2011 at 11:45
  • 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, 2011 at 13:15
  • @lockstep Done
    – Khaloymes
    Dec 25, 2011 at 13:32

1 Answer 1


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:


See Resetting theorem counters: \section and (missing) \subsection for some background information.

  • 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, 2011 at 11:32
  • Because "missing" subsections before subsubsections aren't too common, I'd rather go for the second approach.
    – lockstep
    Dec 25, 2011 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, 2011 at 12:49
  • @Khaloymes Sorry, I don't know enough about LyX to answer this.
    – lockstep
    Dec 25, 2011 at 12:50

You must log in to answer this question.

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