My thesis has several chapters, and a few of them have sections and subsections. However, for the chapters that do not have sections, the theorem counter continues to label them "X.0.1, X.0.2" etc... how do I get rid of these "middle zeros"? I would like to keep the rest of the numbering the same, for instance,

Chapter 1


Definition 1.1.1

Theorem 1.1.2



Chapter 2

Definition 2.1

Theorem 2.2


  • 1
    Welcome! Can you provide some code people can compile to reproduce the problem? This should be a complete but minimal document with just enough preamble and content to demonstrate the issue. Without knowing the code which typesets your theorems, we can't tell you how to modify it.
    – cfr
    Commented Apr 10 at 4:44

1 Answer 1


There are two options (you probably are in favor of the second one):

A: keeping the 3 digits for numbering but setting 0 to 1:

Due to the missing subsection the LaTeX counter subsection is not increased by 1. But you can do this manually: e.g., after the \section{...} command just add


and the respective counter's value was increase as it would have been if you would have had a subsection.

(The counters also exist for section, subsubsection etc)

B: Switching from 3 digits to 2 digits This is a bit unusual but can be achieved as follows:





This then gives the following document:

enter image description here

Note, that you might have to switch back to the "3 digit section numbering" by \numberwithin{theorem}{subsection} (adjust chapter/section/subsection to your case, of course).

You must log in to answer this question.

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