Chapter numbering in books with parts

I’ve figured out how to set up a novel with parts, each part containing multiple chapters, but how do I get the chapter numbers to restart in each part, e.g., “Part 1, Chapter 1, Chapter 2, … ; Part 2, Chapter 1, Chapter 2, etc.” ?

Use the “silent” reset code wherever there is a part break. Here is the description from the placeholder tag list:

A logical place to put this is in the prefix or suffix field for the part itself, since that is when you would want chapter numbering to restart.

So the tags I would use are <$rst_p> and <$rst_chapternumber>?

What is the <$rst_p> for? In the question you were asking how to reset one single stream, the chapter number stream, so I don’t know why you would need to different stream resets to accomplish that. This is the only thing I’m confused on. Otherwise, assuming you number chapters with <$n:chapternumber>, that should work.

Pardon my confusion—but the whole “tag” thing is about as intuitive as a third order integral. :confused:

You’re right, I don’t need to reset page numbers. However, I can’t find that tag "<$n:chapternumber> in the included Placeholder tag list, and I don’t understand the structure of tags.

Are you saying that I should put this: <$rst><$n:chapternumber> in the Prefix pane of the Level 1 folders? Or should it go in the Level 2 (Chapter) Prefix pane?

This is what the structure looks like:

Okay, figured it out by trial and error (lots of the latter). :blush: Thanks for helping.

Is there anywhere the Placeholder tag structure is explained? I can’t find it, and obviously need to understand it. For example, the <$n:chapternumber> tag tells Scrivener to insert a chapter numeral. Nowhere can I find something that explains the “n:”; nor can I find a list of the internal command keywords such as “chapternumber.” :question:

Select “Placeholder Tag List…” from the Help menu for the documentation on these. Scroll down to the “Auto-Numbering” section, and you will see all of the basic counters described. Named counter streams are applied to the basic types. So you have <$n> that prints numerals, and <$n:mychapterstream> that counts numerals in a separate stream. This way you can have a <$n:figures>, <$n:tables> or Parts and Chapters. As noted, there are no “internal command keywords”. You just call the number stream whatever you want.

Right, it sounds like you figured it out, but if you are resetting a number stream whenever a part break occurs, it would make sense to place the reset code in the part break. Placing it in the chapter break would produce a book with 50 chapter ones. :slight_smile:

So the <$n>, <$R>, <$w>, etc. is used with whatever you call the sequence. How does Scrivener know what “mychapterstream” or “mychapters” or “oddbits” mean? Does it look in the file for a folder/document/subdocument with such a label (internal keywords from folder and document titles?), or does it look at the “Level n” structure for where hierarchy levels change?

The basic placeholder token by itself, like <$w> is an unnamed sequence. Wherever it appears it will increment the counter and print the number. Adding your own name after a colon will create a named sequence, which then counts independently from unnamed counters, and other counters with different names.

Scrivener doesn’t know what these “mean”, to you, they are just a name you provide. How you use them is what defines their meaning (a statement that is true for Scrivener’s approach in general. How you use a level 1 folder is up to how you use it, is a part, a chapter, an article for a magazine? The software isn’t smart, it just does what you tell it to).

I don’t think so, if I understand you correctly. To be clear the numbering tokens do not have any special relationship with formatting levels. They are useful here because formatting levels represent a place where we can insert structural information into the output, such as a title name, or its number, but that is all. You could just as well type these by hand into the text editor wherever they should appear and it would work just as well (though you’d have more clutter to stare at while writing).

Maybe something that would help is to compile once, just as an experiment, with the “Do not convert auto-number tags to numbers” option enabled, in the Transformations compile pane. This is roughly what Scrivener “sees” when it evaluates numbering. At this point, all of the numbering codes are on a flat level, it just counts everything in the order they appear, whether the placeholders came from the compile settings, typed into the text, or extrapolated from Replacements (as some of our non-fiction templates provide a system for).

I begin to see. I’ll try your suggestion.

Something I’m definitely going to put in the wish list is that tag codes eventually be incorporated into the GUI. The characters <$x> are code (Admittedly, some of it is surprisingly intuitive. However, other aspects are not.) I know some people who are immediately put off by this (“I don’t write code! I write English!” Well, more or less they do …) The converse is part of my problem—I see it and think “code … but I don’t know that language …” So I look for structure that isn’t there, in this case. Blindingly simple.

Your explanation goes a long way toward clearing up the confusion. I recommend putting it in the documentation in a chapter called “Understanding Tags and How They Are Used.” :smiley:

One thing that cleared this up for me was to experiment with the tags in a document. Try creating document for compiling and pasting the following in:
ONE: <$n:doh>, <$n:re>, <$n:mi>, <$n:fa>
TWO: <$n:doh>, <$n:re>, <$n:mi>, <$n:fa>
THREE: <$n:doh>, <$n:re>, <$n:mi>, <$n:fa>
FOUR: <$n:doh>
FIVE PLUS: <$n:doh> <$n:doh> <$n:doh> <$n:doh> <$n:doh> <$n:doh>
NOT FIVE: <$n:re>
ALSO NOT FIVE: <$n:mi>
RESET DOH: <$rst:doh> <$n:doh>

What you should get out of these when you compile is:
ONE: 1, 1, 1, 1
TWO: 2, 2, 2, 2
THREE: 3, 3, 3, 3
FIVE PLUS: 5, 6, 7, 8, 9, 10