Suppose I define a new theorem "Theorem" and declare that its counter should be reset whenever the subsection counter is incremented or reset:
\newtheorem{theorem}{Theorem}[subsection]
At some point in my (article) document I start a new \section
(say, section 2) without starting a \subsection
. I expect the first theorem in this section to be numbered with "2.0.1" (which may be considered bad style). However, the theorem is numbered "2.0.2".
Is this "by design" (technically, I didn't start a new \subsection
) or a bug? Moreover, what would be a proper workaround? (Such a workaround should not involve manually resetting the theorem counter, and it should work for whatever theorem type I may define in addition to "Theorem".)
\documentclass{article}
\newtheorem{theorem}{Theorem}[subsection]
\begin{document}
\section{bla}
\subsection{blubb}
\begin{theorem}
Some text.
\end{theorem}
\subsection{foo}
\begin{theorem}
Some text.
\end{theorem}
\section{bar}
\begin{theorem}
Some text.
\end{theorem}
\end{document}
EDIT: In response to Seamus' comment: The unexpected counter value also occurs with amsthm
and ntheorem
.
amsthm
orntheorem
? (I imagine this might be the sort of slight bug that theorem packages might fix... – Seamus Aug 3 '11 at 17:05