Say I have an index such as:
1. Chapter
1.1 Section
1.2 Section
2. Chapter
3. Chapter
and I number my theorems as
\newtheorem{theorem}{Theorem}[section]
with the last theorem in 1.2 being Theorem 1.2.5. Then the first theorem in chapter two will be 2.0.6.
My first question is: is this really a feature and not a bug? Is there a situation where this is the preferred behavior?
My second question is about how to fix it. I would like the theorems in Chapter 2 to be 2.1, 2.2, etc while keeping the theorems in Chapter 1 to appear as 1.1.1, 1.1.2, etc. I can manually do it various ways (see here) by putting in code in individual chapters. But I shouldn't have to do such a thing, should I? I would really like to have a solution where the format of the numbering is determined entirely in the preamble.
Here is a MWE:
\documentclass[12pt]{report}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}[section]
\begin{document}
\begin{chapter}{Chapter 1}
\begin{section}{Secton 1.1}
\begin{theorem}
asdf
\end{theorem}
\begin{theorem}
asdf
\end{theorem}
\end{section}
\end{chapter}
\begin{chapter}{Chapter 2}
\begin{theorem}
asdf
\end{theorem}
\end{chapter}
\end{document}
Best Answer
The following conditions on the value of
section
, inserting it into the theorem numbering as needed:Note that you have to consider that
theorem
counters are reset with every\chapter
and\section
, otherwise you'd haveTheorem 2.3
starting off in Chapter 2 in the above example. Also, if you have a theorem inside the "introductory" part of a chapter that eventually will contain a section, then you'll still receive the "reduced" numbering.