Auto-Numbering

Hi,

just starting with Scrivener - so the problem may be a result of my own ignorance :wink:

I try to work with auto-numbering. My test case consists of the desired output followed by the placeholders I use:

1 <$n:chap>
1.1 <$n#chap>.<$n:abschnitt>
1.1.1 <$n#chap>.<$n#abschnitt>.
1.1.2 <$n#chap>.<$n#abschnitt>.
1.1.3 <$n#chap>.<$n#abschnitt>.
1.1.4 <$n#chap>.<$n#abschnitt>.
1.2 <$n#chap>.<$n:abschnitt>
1.2.1 <$n#chap>.<$n#abschnitt>.
1.3 <$n#chap>.<$n:abschnitt>
1.3.1 <$n#chap>.<$n#abschnitt>.

The output is:
11
1.1 1.1
1.1.1 1.1.
1.1.2 1.1.
1.1.3 1.1.
1.1.4 1.<$n#abschnitt>. 1.2 1.2
1.2.1 1.<$n#abschnitt>. 1.3 1.3
1.3.1 1.3.

If I remove the lines after the 1.1.4 lines like in
1 <$n:chap>
1.1 <$n#chap>.<$n:abschnitt>
1.1.1 <$n#chap>.<$n#abschnitt>.
1.1.2 <$n#chap>.<$n#abschnitt>.
1.1.3 <$n#chap>.<$n#abschnitt>.
1.1.4 <$n#chap>.<$n#abschnitt>.

I got:
11
1.1 1.1
1.1.1 1.1.
1.1.2 1.1.
1.1.3 1.1.
1.1.4 1.1.

If I add this line at the end:
2 <$n:chap>

to a total:
1 <$n:chap>
1.1 <$n#chap>.<$n:abschnitt>
1.1.1 <$n#chap>.<$n#abschnitt>.
1.1.2 <$n#chap>.<$n#abschnitt>.
1.1.3 <$n#chap>.<$n#abschnitt>.
1.1.4 <$n#chap>.<$n#abschnitt>.
1.2 <$n#chap>.<$n:abschnitt>
1.2.1 <$n#chap>.<$n#abschnitt>.
1.3 <$n#chap>.<$n:abschnitt>
1.3.1 <$n#chap>.<$n#abschnitt>.
2 <$n:chap>

The compiler will produce no output (PDF using “Standard” as the format) at all and will not close the compile dialog.

What do I do wrong?

Also I tried to use <$sn> like in <$n#chap>.<$n#abschnitt>.<$sn> and would expect to have the sub-numbering reseted each time I increment any of the named <$n> elements? But as long as I use named streams the sub-number never resets itself.

Given that your desired output matches the result of using the <$hn> placeholder, you might consider using that instead of trying to build your own hierarchical numbering stream from scratch. But if you’re doing this as a learning exercise then carry on. :slight_smile:

That aside, it looks like you might have found a bug in fact. I have internal error alerts enabled (in the General: Warnings preference panel), and when I copied and pasted your initial example into a blank project and tried to compile to print, I got an exception. If you have that option disabled you might see no warning and the compiler will merely hang as you described.

Thanks for the quick response. I have to get used to split my documents into smaller parts and to use the binder more extensively. This is very different from other word processors but also the main reason I just bought a copy.
Should the <$sn> placeholder be reseted by a <$n:named> placeholder - no matter which one I use or only by <$n>?

P.S.: by the way - Galizia - what a nice place to work 8)

It certainly is a change! Even for one coming from something other than a word processor—before Scrivener I wrote mainly LaTeX, and I would sometimes use LyX—either way it is better to work in long documents rather than think about a document in terms of small pieces.

That placeholder is only reset by the regular <$n>, and as such it is only useful for simple applications. The <$rst> placeholder, and its accompanying <$rst_streamName> variant, will be useful for most everything else. For example:

Chapters will increment a new chap number and reset both the section and subsection counters to 1:

<$n:chap><$rst_section><$rst_subsection>

Sections will use the current chap number, increment a new section number and reset the subsection counter to 1:

<$n#chap>.<$n:section><$rst_subsection>

Subsections will use the current chap and section numbers and increment a new subsection number:

<$n#chap>.<$n#section>.<$n:subsection>

I think that should all work right—unfortunately I cannot test it at the moment because of the bug.

P.S. It’s a nice place to live, too. :wink: