Math & ScienceNumbering for Theorems and Proofs

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
alexbcg
Posts: 4
Joined: Wed Oct 09, 2013 7:04 pm

Numbering for Theorems and Proofs

Post by alexbcg »

Hi,

I am currently writing lots of latex code for uni notes in a maths class and have run into a problem using the theorem, ntheorem, amsthm packages. I've defined theorem, proof, lemma etc environments at the beginning of my document in this format.

Code: Select all

\newtheorem{theoreme}{Théorème}[subsection]
All this is well and good but basically I would like the numbering of these theorems, proofs, lemmas etc to depend on the subsection (which is what is currently happening) but for there to be no overlap in the numbers regardless of the item. A simpler way of putting it is I need something like this.

Theorem 2.2.1
Proof 2.2.2
Theorem 2.2.3
Proof 2.2.4
Lemma 2.2.5
etc...

instead of

Theorem 2.2.1
Proof 2.2.1
Theorem 2.2.1
Proof 2.2.2
Lemma 2.2.1

Thanks for any help :)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
tom
Posts: 73
Joined: Thu Apr 18, 2013 4:02 am

Numbering for Theorems and Proofs

Post by tom »

Hi!

The solution is in the amsthm documentation, section 3. When defining a \newtheorem, you can use the optional argument to share a previously defined counter. Here is an example:

Code: Select all

\documentclass[11pt]{article}
\usepackage{amsthm}
\begin{document}

\newtheorem{thm}{Theorem}[subsection]
\newtheorem{prf}[thm]{Proof} % use option thm here to share thm counter
\newtheorem{lem}[thm]{Lemma} % use option thm here to share thm counter

\section{Some section}
\subsection{Some subsection}

\begin{thm}Some theorem\end{thm}
\begin{prf}Some proof\end{prf}
\begin{lem}Some lemma\end{lem}

\end{document}
Post Reply