Auto-number using <$sn> for sections of chapters

I’m having difficulty figuring out how to write the auto-number tags for sections of “chapters”. The Chapter numbers themselves (set in the Binder title) work fine in the format <$n:chap:ChapterTitle>. When I use <$n:chap:ChapterTitle>.<$sn> for the numbering of a section of a chapter, this works fine, too. But the sub-section numbering continues without a break through the next Chapters. So I get this:

  1. Chapter One
    1.1 Section One
    1.2 Section Two
  2. Chapter Two
    2.3 Section One
    2.4 Section Two
  3. Chapter Three
    3.5 Section One …

I’ve tried using subsection ‘uniquing’ in this form <$n:chap:ChapterTitle>.<$sn:chap:ChapterTitle> and in forms that uniquely identify the Section, too. But that doesn’t work because the <$sn> tag doesn’t seem to like the additional fields.

So I’m stumped. Can anyone help me with this?

Thank you.

Hmm, it looks like <$sn> does not get reset by named <$n> counters, and when you think about it that makes sense. You might be running a counter for table numbers, figure numbers, and chapter numbers. You wouldn’t want each figure to reset the scene counter. Have you tried using a reset code? Basically right before (right before no spaces allowed) the <$sn> you want reset, put <$rst>. So in your example:


If that doesn’t work, you might want to try abandoning the usage of unique counters for chapters, then it should reset each time you call <$n>. I think you can run a unnamed counter in conjunction with named counters just fine. I haven’t tested that though. The only reason that would not work is if you need to cross-reference the chapters in the text.

An alternative development for this would be to allow <$sn> to be linked to a stream. Say something like:


But that doesn’t exist—it is a suggestion for Keith.

With respect, Amber, it doesn’t make a lot of sense to me. If you follow the manual, you don’t use <$n> to count table (or figure) numbers. Instead you use a typed-tag with a unique identifier such as <$n:table:ThisTableTitle> so that the next use of a <$n… > tag follows in numerical order ONLY if it is another ‘table’ tag. If it is a <$n:figure:…> tag the number follows the ‘figure’ series. I took this to mean you should be able to use <$sn> tags between each unique <$n:table:…> tag to form a sub-series that repeats in sequence only up to the next <$n:table:…> tag. Or the <$n:chap:… > tag in my case.

That said, your suggestion to use a <$rst> tag before each <$sn> series works. But it’s only a partial solution.

As you guessed, I’m reluctant to abandon unique identifiers. I need them for chapters (and for sections marked with the <$sn> tags… although they won’t accept unique identifiers, unfortunately) as references throughout the book to chapters and sections that may change (sequence, position) during drafting. So unique identifiers to chapters and sections of chapters is important in this case for the same reason as they are important in e.g. figures or tables.

I hope Keith can turn his attention to this because the alternative is to hard-code the Chapter and Section numbers and then check them all again before ‘compiling’ (alas, I usually make mistakes)

Right, you understand what is going on (and I’m not suggesting that someone would use an unnamed counter for figures, that is precisely the problem. Consider this example:


Blah blah.


Blah blah.


Blah blah.


Okay, how is the compiler supposed to know that <$sn> is reset by the ‘chap’ stream? Sometimes it is right next to the chapter, other times it is all by itself. Yes, you are using it always in proximity, but a lot of people would not. In a technical paper it is ordinary to have 1.2.1 numbering. But in a novel you never see that. Sections, if numbered at all, do not typically have the chapter number associated with them.

In the above example, if <$sn> were reset by any named counter, the figure would cause the second bare <$sn> to equal 1.

Yes, you’re right. There is no way to allocate ‘singleton’ <$sn> tags to one stream or another except by making the <$sn> tag accept identifiers like the <$n…> tags. That’s what I tried, at first, but it doesn’t seem to work.

Agree, too about the irrelevance of this to most novels (although it’s probably unsafe to assume anything about the form of a novel).

Well, I guess it’s up to Keith whether he wants to make <$sn> tags identifiable. Thanks for your help, Amber.