# Numbering chemmacros schemes within sections [closed]

Hello dear community,

excuse me if this is a very basic question. But I googled to no avail. I also checked the manual of chemmacros, which gives no information. I am using "scheme" environments from chemmacros. The problem is, that those are not numbered like figures or tables, i.e. including the chapter (4.1, 4.2,..., 5.1, 5.2, ...), but rather get a simple number n (1, 2, ...) over the whole document. I am using Koma script's scrbook. \numberwithin{scheme}{chapter} does not work, I get the error that "no counter 'scheme' [is] defined". As I am in a hurry right now and this is a very basic question, I am omitting the MWE, if it is needed, I will give it ASAP. But maybe somebody alsready knows of that problem?

With best regards

• MWE is not "needed" but enormously increases the chance of people answering. Nov 24 '20 at 12:37
• Try \numberwithin{scheme}{chapter} after \begin{document} Nov 24 '20 at 12:47
• Nov 24 '20 at 14:15
• @cgnieder Thank you so much, that solved the problem. I would never have thought that it has to go outside the preamble, sorry. Nov 24 '20 at 14:29
• I’m voting to close this question because it has been solved by comments. Nov 25 '20 at 22:53