I asked before how to identify the counter of Equation and Theorem. A simple answer suggested there is


A simple variation allows me to identify the Theorem and Section counter:


Is there a way to identify all three counters, Equation, Theorem, and Section?

  • At the moment I find this question difficult to understand without a similar example to the referenced question. Do you want the Theorem to be number consecutively with the equation and section numbers? As in (say) Sec1, Eq2, Thm3, Thm4, Sec5, Thm6, Eq7, ...? I guess I'm not sure what "identifying a counter" means. – Werner Jan 16 '12 at 20:36
  • You probably want to take a look at \numberwithin (GIYF) – kahen Jan 16 '12 at 20:39
  • 3
    While the idea of equations and theorems sharing one counter is at least debatable, making these structures share one counter with sectioning elements is bound to confuse the reader. Don't do it. – lockstep Jan 16 '12 at 20:43

The TeX primitive \let allows you to identify control sequences. LaTeX counters are implemented by TeX count registers; the LaTeX command \newcounter{foo} creates a TeX counter \c@foo.

So you just need to make sure that the count registers for equation, section, and theorem are the same! LaTeX's \newtheorem command provides the functionality to make the theorem counter identical to the section counter. Use a \let to let the equation and section counters be the same.


\section{First Section}

e = q^{uation}

Ceci n'est pas une th\'eorem.

\section{Second Section}

  • Your solution doesn't require amsmath. – lockstep Jan 16 '12 at 20:45
  • @lockstep: I'll be darned, you are correct. For some reason I thought \newtheorem was part of the AMS bundle of packages. – Matthew Leingang Jan 17 '12 at 17:56

I found an elegant solution for this problem. It is a variation of the answer to a similar question. Put the following in the preamble:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.