# Issue with resetting theorem counter

I am using LyX to typeset a document. I wanted to use another theorem-like construct not available in `amsthm`. So I included it using LaTeX code.

``````\newtheorem{discussion}{Discussion}[section]
``````

This works fine except the next theorem that appears using the built in theorem construct ends up having the same number as the one above. I tried using `\stepcounter` and `\addtocounter`, but this does not change the numbering.

Any idea how to fix this?

-
There is no built-in theorem construct, unless it's LyX that provides one. –  egreg Mar 20 '12 at 14:08
@egreg: By "built-in" I meant "available in amsthm". I might be using incorrect terminology, but I don't think what I mean is ambiguous. –  Zoey Mar 20 '12 at 14:12
@henrique: I had read about the MWE, but as I said I am using LyX to do this, so I am not sure how I can provide an MWE for that. If I export to latex and try to compile, I end up getting a bunch of errors which are not representative of my situation. –  Zoey Mar 20 '12 at 14:24

If you want this new structure to share the counter of a previously defined theorem-like environment, you can use the first optional argument of `\newtheorem` to indicate the counter dependance; for example:
``````\newtheorem{theorem}{Theorem}[section]