34

Edited to include complete code, as suggested:

Here is what the preamble of my main file looks like:

\documentclass[12pt]{report}
\usepackage{epsfig}
\usepackage{upmathgrad2}  
\usepackage{UPnotations}
\usepackage{amssymb, graphicx, amsmath, amsthm}
\RequirePackage{graphicx}
\RequirePackage{hyperref}
\theoremstyle{definition}
\newtheorem{thm}{Theorem}[chapter]
\newtheorem{defn}[thm]{Definition}
\newtheorem{lem}{Lemma}[thm]
\newtheorem{cor}{Corollary}[thm]
\newtheorem{prop}{Proposition}[thm]
\newtheorem{rem}{Remark}[thm]
\newtheorem{ill}{Illustration}[thm]

I've been trying to tinker on ways to change the above code however I still get the following numbering:

Chapter 1
1.1 Section A
Definition 1.0.1
Theorem 1.0.2
Theorem 1.0.3

The definitions, theorems, lemmas, etc. are numbered continuously as I wanted. However, I wanted to get rid of the 0's. How do I do this?

I tried to use the suggestions in this thread however things just got worse.

For example, when I tried:

\newcounter{dummy} \numberwithin{dummy}{section}
\newtheorem{defn}{Definition}[dummy]
\newtheorem{thm}{Theorem}[dummy]

I got Definition 1.1.0.1 instead.

1 Answers1

50

The \newtheorem command has two mutually exlusive optional arguments:

Using

\newtheorem{<name>}{<heading>}[<counter>]

will create an environment <name> for a theorem-like structure; the counter for this structure will be subordinated to <counter>. On the other hand, using

\newtheorem{<name>}[<counter>]{<heading>}

will create an environment <name> for a theorem-like structure; the counter for this structure will share the previously defined <counter> counter.

In the definition of defn you need to use the first optional argument of \newtheorem to indicate that this environment shares the counter of the previously defined thm environment.

If the counters need to be subordinate to the section counter, use section for the second optional argument of \newtheorem in the definition of thm. A little example:

\documentclass[12pt]{report}
\usepackage{amsthm}

\newtheorem{thm}{Theorem}[section]
\newtheorem{defn}[thm]{Definition}

\begin{document}

\chapter{Test}
\section{Test}
\begin{defn}test\end{defn}
\begin{thm}test\end{thm}
\begin{thm}test\end{thm}

\end{document}

enter image description here

On the other hand, if the counters need to be subordinate to the chapter counter, use chapter for the second optional argument of \newtheorem in the definition of thm. A little example:

\documentclass[12pt]{report}
\usepackage{amsthm}

\newtheorem{thm}{Theorem}[chapter]
\newtheorem{defn}[thm]{Definition}

\begin{document}

\chapter{Test}
\section{Test}
\begin{defn}test\end{defn}
\begin{thm}test\end{thm}
\begin{thm}test\end{thm}

\end{document}

enter image description here

A similar remark applies to the other structures; so instead of

\newtheorem{lem}{Lemma}[thm]
\newtheorem{cor}{Corollary}[thm]
\newtheorem{prop}{Proposition}[thm]
...

you probablly want

\newtheorem{defn}[thm]{Definition}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{rem}[thm]{Remark}
\newtheorem{ill}[thm]{Illustration}
Gonzalo Medina
  • 505,128