[Tex/LaTex] Wrong subsections numbering

numberingsectioning

I have a weird problem. My subsections are numbered like this:

Chapter 1: Subsection 1.0.1 Subsection 1.0.2 Subsection 1.0.3

Chapter 2: Subsection 2.0.4 Subsection 2.0.5

Chapter X: Subsection X.0.

I have no idea how to start fixing this error. The only warning I get is:

Chapter1.tex(1): Underfull \vbox (badness 10000) has occurred while \output is    activepdfTeX warning (ext4): destination with the same identifier (name{page.1}) has been       already used, duplicate ignored
Chapter1.tex(26): destination with the same identifier (name{page.2}) has been already used, duplicate ignored

but I doubt it has anything to do with the problem.
Appreciate any ideas.

Best Answer

You are using the sectioning commands \chapter (level 0) and \subsection (level 2), but not the "in-between" command \section (level 1). This is rather uncommon and possibly a misunderstandng on your part.

If you insist on using \subsection this way, you have to reset the subsection counter manually immediately after the start of a new \chapter. See Resetting theorem counters: \section and (missing) \subsection for an explanation.

\documentclass{report}

\begin{document}

\chapter{bla}

\setcounter{subsection}{0}

\subsection{blubb}

\chapter{foo}

\setcounter{subsection}{0}

\subsection{bar}

\end{document}
Related Question