enter image description here" />
Your code has some (easy to fix) errors and won't work. Please fix it. On your question, how would you number equations that appear outside a theorem?
Commented May 20, 2012 at 17:23My purpose is enumerate equations only in the proofs; because outside I use an 'observation' environment or just $$ $$
Commented May 20, 2012 at 17:26 I've updated my answer providing a simpler solution. Commented May 20, 2012 at 17:46Once amsmath has been loaded, you can use
\numberwithinA complete example:
\documentclass[a4paper,10pt] \usepackage \newtheorem[section] \numberwithin \begin \section \begin \begin \label 1+1=2. \end \begin The proof of the equation~\eqref is left as an exercise. \end \end \end
enter image description here" />
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
\numberwithinwhere 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 \newtheorem \newtheorem[theorem] \newtheorem[theorem] \numberwithinBy the way, don't use the deprecated $$ . $$ method to create unnumbered display-style equations. Instead, use something like \begin . \end . Among other good things, the spacing around displayed equations will become much better.