Auto-numbering for MultiMarkdown

Dear fellows,

here is something that is driving me up the wall:-)

I have 2 folders in Scrivener with 9 subdocuments in the first folder and 8 subdocuments in the second folder. I insert autonmubers for folders so that they appear as “1. General” and hierarchical autonumbers for the subdocument so that they read “1.1. Information, 1.2. Copyright, …,”. This works perfectly.

However, even though the second folder reads as “2. Introduction”, the first subdocument starts as “2.9. Getting started”. Why “9”? Even if I use the tag for restarting the numbering I don’t get it to work.

Maybe someone out there that has had similar experiences or even better a solution?

I compile for MultiMarkdown and the ato-numbering tags are inserted manually for each document. I am not going the way for adjusting the auto-numbering when compilig.

Cheers, Michael

Hmmm. If you are compiling to MMD then you really don’t need to use the auto number tags. In the compile dialogue format pane each level of document should have its #, ## and ### header levels set. The compile picks that up for each document, depending on its position in the hierarchy.

And on the auto numbering, are you using <$hn> at all levels? Your post suggests you are using <$n> for top level and <$hn> for others, which would account for the second level of heading continuing in the second chapter.

Normally, the second <$hn> tag (at the second folder) would re-set the counter for second level headings back to 1, but if there is no top level <$hn> tag for that folder the second level numbering will continue to the next number.

Hi Mr. Gruff and thanks for getting back to me.

The whole script is written MMD and each folder/document has its own #, ##, ### and so on. I then compile to MultiMarkdown because I use Marked app for producing the final pdf with adapted css stylsheets.

But you are right: I used <$n> tags for folders and <$hn> on documents. The reason for this is that when putting <$hn> tags on folders, they get numbered as “1.1.”. This, however, is not what I want. But maybe I have done everything wrong:-(

Here is what my first folder looks like:

#<$n>. Folder name#
##<$hn>. Document name##

And this produces the desired effect:

  1. Foldernamne
    1.1. Document name

    1.9. Document name

The second folder and subsequently second document are exactly identical as far as tags and # are concerned.

The output, however, is like that:

  1. Foldernamne (so this works)
    2.9. Document name (and here we start at 9)

    I really have no explanation for that. Or am I completely off?

Thanks again

The issue with the <$hn> tags giving 1.1 for your first level of heading is down to the set up of your binder.

I have done a few experiments on this, and provided the top level folder being compiled is at level 1 in the binder, then it gets numbered as 1, and subsidiary folders/documents get 1.1 and 1.1.1 as appropriate. However, if the top level folder is at level 2 in the binder then it becomes 1.1 and all the rest follows one level down.

I’m going to guess the folders you want as your top level headings are not at level 1 in the binder. If that is the case, there are two solutions:

  1. Manually move the folders and files up the binder hierarchy.
  2. When selecting for compile, select the level 2 folder which contains all your to-be-compiled documents in the lefthand drop down above the contents list, and in Compile group options select ‘Treat compile group as entire draft’.

Of those two, the second is preferable as it makes no permanent change to your binder.