برای اینکه شمارهها پشت سر هم باشند باید در تعریف قضیه و لم [section]
را از انتها حذف کرده و به صورت زیر بنویسید تا شمارهها به هم وابسته باشند (به مکان [definition]
توجه کنید).
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\theoremstyle{plain}
\newtheorem{theorem}[definition]{Theorem}
\newtheorem{lemma}[definition]{Lemma}
چنانچه محیطی میخواهید که شمارهاش مستقل باشد نوشتن [section]
در انتها، راهگشا خواهد بود.
مثال:
\documentclass{article}
\usepackage{amsmath,amsthm,amssymb}
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\theoremstyle{plain}
\newtheorem{theorem}[definition]{Theorem}
\newtheorem{lemma}[definition]{Lemma}
\newtheorem{conjecture}{Conjecture}[section]
\begin{document}
\section{\texttt{amsthm} Numbering}
\begin{theorem}
In any right triangle, the area of the square whose side is the hypotenuse (the side opposite to the right angle) is equal to the sum of the areas of the squares whose sides are the two legs (the two sides that meet at a right angle).
\end{theorem}
\begin{theorem}
The square root of $2$ is irrational, $\sqrt{2}\notin \mathbb{Q}$
\end{theorem}
\begin{definition}
A plane is a flat surface with no thickness.
\end{definition}
\begin{lemma}
If a prime $p$ divides the product $ab$ of two integers $a$ and $b$, then $p$ must divide at least one of those integers $a$ and $b$.
\end{lemma}
\begin{lemma}
Suppose a partially ordered set $P$ has the property that every chain in $P$ has an upper bound in $P$. Then the set $P$ contains at least one maximal element.
\end{lemma}
\begin{conjecture}[Goldbach's conjecture]
Every even integer greater than $2$ can be expressed as the sum of two primes.
\end{conjecture}
\end{document}
نتیجه: