6
votes

I have a problem with theorem numbering in LaTeX. I can make it number by subsection, e.g

Theorem 1.2.1

for the first theorem in the second subsection of the first section. But I need it to show me only the numbers of the subsection and the theorem, but not the section number, like this:

Theorem 2.1

I use

\newtheorem{thm}{Theorem}[subsection]

for the numbering.

6
Please don't do this. As a frequent reader of mathematical books, I hate it when books use this numbering style. If you do this, saying "Theorem 3.2" becomes ambiguous: it can refer to many possible theorems in many places, and does not make complicated material any easier to understand.kquinn
I'm a decade late in responding to kquinn but I really have never found this to be ambiguous. Saying "Theorem 3.2" means the second theorem of the third section of this chapter. To refer to another chapter authors will say "Theorem 3.2 of chapter 1". Further, this makes it far easier for me to read the theorems as (a) most of the time, chapters are either self contained or have named results from other chapters to refer to, and (b) I'm better at parsing English than I am at parsing sequences of digits.Ben Kushigian
@BenKushigian the question asks for theorem numbering which resets with each new section, not with each new chapterMcDuffin

6 Answers

13
votes

Putting the following code in the preamble seems to have the desired effect:

\usepackage{amsthm}
\newtheorem{thm}{Theorem}[subsection]
\renewcommand{\thethm}{\arabic{subsection}.\arabic{thm}}

I don't understand why you want this particular theorem numbering system, but the code does what you want: LaTeX output

1
votes

There's no easy way to do this. The AMS Theorem Package only provides a way to control when numbering resets (section, subsection), if it's tied to other environments (corollary, lemma) and number order ("1.1 Theorem" vs. "Theorem 1.1").

Theorem's get their numbering from the \thesection or \thesubsection command. You can redefine the \thesubsection command to get the numbering you want, but that will also affect everything else that uses \thesubsection.

1
votes

Does this work?

\newtheorem{thm}{Theorem}[section]

See these LaTeX tips.

0
votes

In a slightly less hacky way, you may create a fake counter that is reset with subsection, and redefine its \the to your liking:

\newcounter{fakecnt}[subsection]
\def\thefakecnt{\arabic{subsection}}
\newtheorem{thm}{Theorem}[fakecnt]
-1
votes

Insert this line in your preamble (or anywhere else before the \newtheorem statement):

\renewcommand{\thesubsection}{\arabic{subsection}}

This will reset the numbering command of the thm environment to ignore the section numbers (when numbering theorems) and display only the subsection numbers and theorem numbers. Section numbers will still be displayed in front of section headings, just not the theorems included within the sections. So, just as you describe, the first theorem in the second subsection of the first section will be numbered 2.1. Alternatives to \arabic include:

  • \Roman - produces capital roman numbers, such as II.1
  • \roman - produces lower-case roman numbers, such as ii.1
  • \Alph - produces capital letters, such as B.1
  • \alph - produces lower-case letters, such as b.1
-2
votes

You can use this command for renew command section and subsection and theorem's and ...

\renewcommand{\theequation}{\thesection.\arabic{equation}}
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thesubsection}{(\alph{subsection})}‎‎‎