If you're sure that you'll be using numbered equations only within theorem environments (and other theorem-like environments) and if you're loading the amsmath
package, you could issue the command
\numberwithin{equation}{theorem}
where theorem
is the environment set up with a \newtheorem
statement.
If you have several theorem-like environments, be sure to have them share the same counter. How to do this depends strongly on the theorem package that's in use. For the amsthm
package, you'd force the lemma
, corollary
, etc environments to use the same counter as theorem
environments do by issuing commands such as
\usepackage{amsmath,amsthm}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corrolary}[theorem]{Corollary}
\numberwithin{equation}{theorem}
By the way, don't use the deprecated $$ ... $$
method to create unnumbered display-style equations. Instead, use something like \begin{equation*} ... \end{equation*}
. Among other good things, the spacing around displayed equations will become much better.