I created a theorem command defining example sections, definitions, etc. the same way like so


Of course, the numbering of this is consistent with the numbering of every other theorem command. For example, currently I would have something like this for the first section of the paper

Definition 1.

Definition 2.

Example 3.

But what I want is for the examples to be numbered independently by its section number and subsection (or even just by its section. As long as the numbering starts over from 1), like this

Definition 1.

Definition 2.

Example 1.1

1 Answer 1


Assuming you're using amsthm or compatible package (for some reason you didn't say), you can do this—

For Example 1.1 (by section number):


or for Example 1.1.1 (by subsection number):


Definitely don't add [thm] in the middle if you don't want the numbering to be shared with theorems. That's what that does.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .