18

I wish to number my theorems within subsections as

Theorem 1
Theorem 2
Theorem 3
...

And only reset it back to 1 when I have a new subsection.

So I have a subsection within a section, and within the subsection I have several theorems, which are normally numbered section.subsection.theoremnumber. But I want it just to be Theorem 1, Theorem 2, Theorem 3, etc until the end of the subsection, and in the next subsection, reset it back to Theorem 1, Theorem 2, etc.

How can I do this?

Stefan Pinnow
  • 29,535
  • Welcome to TeX.SE. Please tell us which document class you use, and also if you use a theorem-related package such as amsthm or ntheorem. Separately, should the change in numbering system apply only to theorem environments, or should it apply to other, theorem-like environments, e.g., proposition, lemma, corollary, etc.? – Mico Jan 09 '17 at 03:59
  • Please advise if your document currently features an instruction such as \newtheorem{thm}{Theorem}[subsection]. – Mico Jan 09 '17 at 04:48

1 Answers1

9

Specify the theorem to renew with every \subsection, and then remove the subsection counter from the theorem counter representation:

enter image description here

\documentclass{article}

\newtheorem{thm}{Theorem}[subsection]% theorem counter resets every \subsection
\renewcommand{\thethm}{\arabic{thm}}% Remove subsection from theorem counter representation

\begin{document}

\section{A section}
\subsection{A subsection}
\begin{thm}\end{thm}
\begin{thm}\end{thm}
\begin{thm}\end{thm}
\subsection{A subsection}
\begin{thm}\end{thm}
\begin{thm}\end{thm}
\begin{thm}\end{thm}

\section{A section}
\subsection{A subsection}
\begin{thm}\end{thm}
\begin{thm}\end{thm}
\begin{thm}\end{thm}
\subsection{A subsection}
\begin{thm}\end{thm}
\begin{thm}\end{thm}
\begin{thm}\end{thm}

\end{document}
Werner
  • 603,163
  • 1
    What is thethm referring to? I haven't been able to figure out how to use this with my amsart article. What do I need to replace thethm with in that context? – rschwieb Dec 04 '17 at 20:10
  • 1
    @rschwieb: \thethm refers to the representation of the counter thm; internally, the thm acts like a counter, but it's representation - \thethm - can be something arbitrary (like \roman{thm} for lowercase Roman numerals, \Roman{thm} for uppercase Roman numerals, \alph{thm}, \Alph{thm}, ...). This counter is defined when you define the thm environment via \newtheorem{<env>}{.}[.] that holds your theorem content. How did you define your theorem environment? – Werner Dec 04 '17 at 20:30
  • I'm not sure what things are relevant, but here goes nothing: I'm using amsart, and I use the amsmath and amsthm packages, and I see \newtheorem{theorem}{Theorem}[section] . My goal is to have global sequential numbering throughout the paper (Theorem 1, Proposition 2, Theorem 3, etc. across the entire document, regardless of sections) – rschwieb Dec 04 '17 at 20:41
  • @rschwieb: \newtheorem{theorem}{Theorem}[section] defined a theorem environment (so you can use \begin{theorem} ... \end{theorem}) that prints the title Theorem X. Here X is the theorem counter representation, or \thetheorem and will be prefixed with the \section counter representation (or \thesection) separated by a period .. So if you want to change your theorem counter representation, you'd need to \renewcommand{\thetheorem}{...}. – Werner Dec 04 '17 at 20:48
  • @rschwieb: Based on your requirements - a global continuous counter for different environments - you'll need to use \newtheorem{theorem}{Theorem} and then subsequent environments \newtheorem{proposition}[theorem]{Proposition}, \newtheorem{lemma}[theorem]{Lemma}, ... See this paste. – Werner Dec 04 '17 at 20:51
  • Thanks for the explanation... this is beginning to click. There is a Remark that is intruding into my numbering, but I don't want it to. How can I define it so that it's available, but does not need a counter, and does not use the theorem/proposition counter? – rschwieb Dec 04 '17 at 21:09
  • @rschwieb: You should probably use \newtheorem*{remark}{Remark}, which prints Remark. without a counter and doesn't interfere with other environments' numbering. – Werner Dec 04 '17 at 21:12
  • Thank you! It's been a long time since I learned anything much about this, but today was very helpful. Everything is as it should be, now. – rschwieb Dec 04 '17 at 21:15