Two sets of labels in chemnum

Is it possible to have two sets of labels for numbering compounds throughout the document? Currently I'm using chemnum to make labels like 1, 2, 3a and so on. I want to introduce a new sequence of numbers, say, TS1, TS2... The only idea I have is to reset the counter right before I introduce new labels like this:

\documentclass[b5paper,12pt]{article}
\usepackage{chemnum}
\cmpdinit[init-sub = true]{1,2,3.{a,b}}
\newcommand*{\cmpdTS}[1]{\cmpd[cmpd-prefix=\bfseries{TS},cmpd-space={}]{#1}}
\begin{document}
Here are two compounds: \cmpd{1} and \cmpd{2}.

\cmpdreset
Here are two transition states: \cmpdTS{TS1.a} and \cmpdTS{TS2}.

Which of these two transition states is involved in transformation of \cmpd{1} to \cmpd{2}?

What about \cmpd{3.a}? It is formed from \cmpd{2} via \cmpdTS{TS3.a}.
\end{document}


But it's a bad idea because in the output I get: "What about 3a? It is formed from 2 via TS4a." instead of: "What about 3a? It is formed from 2 via TS3a." because of the resetting the counter.

-
You're missing a dot in \cmpdinit. Change it to \cmpdinit[init-sub = true]{1,2,3.{a,b}}. –  cgnieder Sep 17 '12 at 20:03
Thanks for pointing out the mistake:-) Am I right that this method will work if I initiate all the labels for one sequence in, for example, preamble and then just reset the counter before I need to introduce a new sequence? –  Ilya Makarov Sep 17 '12 at 20:12
Yes, that should work. –  cgnieder Sep 17 '12 at 20:30
The dot fixes the issue (in case that wasn't clear from my earlier comment) –  cgnieder Sep 17 '12 at 20:31

The line

\cmpdinit[init-sub = true]{1,2,3{a,b}}


initates three labels: 1, 2 and 3{a,b}. Every further label used in the text will still be created (and write a warning in the log that it hasn't been initiated). Thus the numbering goes:

Here are two compounds: \cmpd{1} and \cmpd{2}.% numbers 1 and 2

\cmpdreset% new numbers will start at 1 again
Here are two transition states: \cmpdTS{TS1.a} and \cmpdTS{TS2}.
% 1a and 2

Which of these two transition states is involved in transformation of \cmpd{1} to \cmpd{2}?
% 1 and 2 again

What about \cmpd{3.a}? It is formed from \cmpd{2} via \cmpdTS{TS3.a}
% 3' was never declared but gives 3' as this is the next number to be declared,
%TS3' consequently gives 4


So what you want is this:

\cmpdinit[init-sub = true]{1,2,3.{a,b}}


which initiates labels 1, 2 and 3 and the sublabels 3.a and 3.b.

You could have seen this easier by using the option init-strict which will cause errors if an uninitiated label is used. My suggestion would be to do something like the following, i.e. declare every label in the preamble together with init-strict:

\documentclass[b5paper,12pt]{article}

\usepackage{chemnum}
\cmpdsetup{init-strict,init-sub}% error if unititialized label is used

% regular labels
\cmpdinit{1,2,3.a}

% transition states
\newcommand*{\cmpdTS}[1]{\cmpd[cmpd-prefix=\textbf{TS},cmpd-space={}]{#1}}
\cmpdreset
\cmpdinit{TS1.a,TS2,TS3.a}

\begin{document}
Here are two compounds: \cmpd{1} and \cmpd{2}.

Here are two transition states: \cmpdTS{TS1.a} and \cmpdTS{TS2}.

Which of these two transition states is involved in transformation of \cmpd{1} to \cmpd{2}?

What about \cmpd{3.a}? It is formed from \cmpd{2} via \cmpdTS{TS3.a}.
\end{document}

-
Just realized there's a bug in chemnum in connection with init-strict`. Will be fixed soon :) –  cgnieder Sep 17 '12 at 21:00