Wednesday, 2 October 2013

Numbering Theorems and subsections

Numbering Theorems and subsections

I want the numbering of theorems to follows the section/subsection
counters so I use
\newtheorem{thm}{Theorem}[subsection]
But when I write a theorem in a section before any subsection the
numbering follows the numbering of theorems in the previous section.
Here is an example. I would like the numbering to be as written in the
body of the theorems.
\documentclass[11pt,a4paper]{article}
\usepackage{amsthm}
\renewcommand{\thesubsection}{\arabic{subsection}}
\newtheorem{thm}{Theorem}[subsection]
\begin{document}
\section{Section 1}
\subsection{Subsection 1.1}
\begin{thm}Thm 1.1.1.\end{thm}
\section{Section 2}
\begin{thm}Thm 2.0.1.\end{thm}
\subsection{Subsection 2.1}
\begin{thm}Thm 2.1.1.\end{thm}
\end{document}

No comments:

Post a Comment