[Tex/LaTex] Remove chapter number from theorem number

numberingtheorems

Currently the document I'm facing has a few chapters which
contain subchapters.
Those sub/chapters are numbered as usual like 1.1, 1.2, 3.7, ….

One specific type of those subchapters shall not follow the default numbering but have its own numbers over the whole document. So in chapter 1 the passage of e.g. a theorem shall have number 1 (nothing else). In chapter 3 it is continued and has the number 2.

My current approach is using

\newcounter{mycounter}
\newtheorem{specialthm}{specialthm}[mycounter]

In general it works
but if it comes to using it like

\begin{specialthm}Some very interesting text
....

I get numberings like 0.1 and later on 0.2 – thus I'm more interested in the subsection number for this kind of specialthm. so i think my question boils down to: how can i remove the main (chapter) figure – in this case the zero – from mycounter?

Best Answer

You current code states that the theorem should be labeled as <mycounter>.<theorem number>. The leading 0 is the mycounter number and you probably never change that counter, so it stays 0. The specialthm theorem has its own counter called specialthm. So if you only like that number use:

\newtheorem{specialthm}{specialthm}

which give me the requested behavior, i.e. continuous numbering across chapters. If this really doesn't work for you can redefine \thespecialthm which prints the theorem number:

\renewcommand*{\thespecialthm}{\arabic{specialthm}}

This sets the number to only be the theorem number.

Related Question