Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
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
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
add comment

2 Answers

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}

share|improve this answer
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
add comment
up vote 2 down vote accepted

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:

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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