TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working a document that has one (very large) chapter, in which theorems, lemmas, etc. are numbered with subsubsection, i.e. the start of the document has the command


However, the document also has some short chapters, in which theorems etc. are numbered with subsection. At the moment, the only way I can do this is to also define a theorem_ at the beginning of the document:


and use theorem sometimes and theorem_ other times. This seems like an ugly hack, and I'd love it if there were some way I could use \begin{theorem}...\end{theorem} throughout the document, and use some command at the start of each chapter to determine whether theorems were numbered with subsection or subsubsection. Is this possible?

share|improve this question

You could use


immediately before the chapter you wish you change.

% arara: pdflatex







Changing the numbering convention part way through a document could cause confusion to your reader. How many theorems do you have? Does the numbering need to go so deep? Just some thoughts :)

share|improve this answer
Otherwise you can use \counterwithin{theorem}{subsection} from the package chngcntr. – karlkoeller Sep 5 '13 at 17:34
I'm well aware that changing the numbering convention could cause confusion - the problem is, I don't have control over the numbering. And the document is ~150 pages, so yes, the numbering does need to that deep. Thanks for this nice solution though! – Daniel Miller Sep 5 '13 at 22:25
In the OP's intention, theorem shares the subsubsection counter, it's not subordinate to it. So there's no \thetheorem – egreg Sep 5 '13 at 22:25
@egreg thanks for pointing that out. in which case karlkoeller's idea seems more appropriate – cmhughes Sep 6 '13 at 0:55

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.