How to adjust counters for so that theorem is subsection+0.1 and the subsection number adjusts itself after the theorem. For example in the code below the output produces 1.1 subsection followed by the Theorem 1.1 (I want this to be Theorem 1.2) this is followed by 1.2 Another Subsection (I want this to 1.3).
I have tried using \addcounter
and \setcounter
but it does not produce the desired result.
\documentclass{article}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}[section]
\begin{document}
\section{Test Section} some text
\subsection{subsection} blah
\begin{theorem}
How to set the theorem counter to 1.2 instead of 1.1 as in the output.
\end{theorem}
\subsection{Another subsection} How to set this counter to 1.3
\end{document}
amsthm
, this can be done with\newtheorem{theorem}[subsection]{Theorem}
. This is explained in answers to this question and the question it points to as a duplicate.