Mardown compile and the level of headers


after much experimenting I just realized that text needs to be located in the „Draft“ section of the binder in order to get the correct header markup in the resulting markdown file. If the text contains a hierarchy of files, the headings will automatically be formatted with the correct number of hash signs around according to the level of the text within that hierarchy.

But, when I choose the text content during the compile as „current selection“, all headers only contain one hash sign, as if there were topl-level headers, regardless of their position in the hierarchy.

Also, when the texts are in the „Research“ section of the Binder, I cannot choose them directly for the compile but need to use „current selection“, resulting in the same phenomenon.

Is this the intended behaviour of Scrivener that a „current selection“ is treated differently from a directly chosen folder/document in the Binder? Why? It doesn’t seem to be documented in the manual but then again the manual (Revision: 2.6.0-01c) says something along these lines on page 349 („When using the current selection“) but then again I do not get the point about the selection as a filter.


You should read Section 24.7 of the manual again.

It clearly states that compiles from selections and collections will be treated as flat lists that don’t preserve hierarchy. You can use a selection as a filter, and if you do that it will preserve the # levels and if you use section numbering it will be correct. I just tested this and it works as expected, screenshot shows a Level 2 + Level 3 subdocument. Note the Draft is selected at to and I filter on the selection. This gives the correct ## 4.2 Effects on Moon ## and ### 4.2.1 Lunar Cycles ### formatting on compile.

— Chapter 24.7.2

And yes, the draft folder is “special” in Scrivener:

— Chapter 4.1.2

Collections are exceptions to this rule, and they are stated as such.

Thanks for the in-depth answer. I see, I should have read the manul more closely :slight_smile:

I can now see why the current selection is treated as it is. Conclusion: this is by design and makes perfect sense!


After using Scrivener since the misty swamp at the beginning of time, I still learn new things from the Scrivener manual every time I dip in too!!! :smiley: