# Subsequential numeration of theorems and equations

I'm writing an essay in Latex and I want to do the following thing, which I'll explain with an example. Suppose that I have a theorem 1.1 and inside it I have to specify an equation. Is there a way in which I can label automatically the equation as 1.2 and such that the subsequent theorem is labelled 1.3? Furthermore, is it possible to do this with any kind of proposition (like examples, lemmata etc.)?

Thank you very much!!

## 2 Answers

Simply enumerate the theorem like environment within equation counter. Note the position of the [equation] (in front of the environment name {theorem}.

\documentclass{report}
\usepackage{amsmath,amsthm}
\newtheorem{theorem}[equation]{Theorem}
\usepackage{lipsum}
\begin{document}
\lipsum[2]
\begin{theorem}$$content...$$$$content...$$
\end{theorem}

\lipsum[2]

$$content...$$

\begin{theorem}$$content...$$$$content...$$
\end{theorem}

\end{document}


Try with the following.

\documentclass{article}
\usepackage{amsmath,amsthm}

\numberwithin{equation}{section}
\newtheorem{theorem}[equation]{Theorem}
\newtheorem{lemma}[equation]{Lemma}

\begin{document}
\section{Section}
\begin{theorem} This is a theorem \end{theorem}
$$Equation$$
\begin{lemma} This is a lemma \end{lemma}
\end{document}


You need the combination of two commands:

1. \numberwithin{equation}{section} tells LaTeX to number equations with the style sectionnumber.equationnumber.

2. \newtheorem{theorem}[equation]{Theorem}: you probably already use newtheorem; the middle argument in square brackets tells LaTeX to reuse an existing counter for the theorem numbers rather than defining a new one. Typically one uses it like \newtheorem{theorem}{Theorem} and then \newtheorem{lemma}[theorem]{Lemma}, so that lemmas and theorems share numeration, but the same command works also in this less traditional use case.