Scrivener --> MMD ignoring structure

I’m having problems getting MMD out of Scrivener.

When I export to LaTeX, the output file ignores the hierarchy/structure of the document. So all documents in the export will have the same level (i.e. \chapter, \section, \subsection) as the “Base Header Level” setting.

Is there something obvious that could be causing this? I’m using MMD3 and Scrivener 2.1 on a Mac (10.7).

This hasn’t been a problem in the past, so I must have changed something to break it…

Thanks,

Ewan

First thing I would do is double-check your Formatting compile settings and make sure titles are being output for all levels; that might not be it though because then you just wouldn’t get titles at all. What does the compiled MMD file itself look like?

(Thanks for the quick reply).

The formatting settings are set to include titles for all levels:

The compiled MMD file is consistent with the LaTeX version – as in, it includes titles for all documents, but all at the same level, ignoring hierarchy.

Thanks!

What about the Contents compile pane? Does that list look flat as well? If so, make sure you aren’t compiling using a Collection or Current Selection as your compile group. Those will always be flat-list and so level 1 MMD.

If you are using one of those for some sort of logical filter, consider using Filter instead; below the Contents list. Filtering can be used to do the same thing as a Collection/Selection compile but will honour the original hierarchy.

No, the contents compile pane shows structure (as it should)…

(Thanks for your help with this!)

I think I’ve solved this.

If I select a single folder, and then export the “Current selection” and subdocuments, as in:

…then the MMD output loses all structure (all headings are set to “#”, i.e. H1).

However, if I select the folder from within the compile window, as in:

…it works as expected (the structure is exported correctly as MMD headings).

I’ve no idea why the first method doesn’t work – I would have thought the output should be identical. Anyway, I’m glad it’s working now :slight_smile:

Both Current Selection and any selected Collection from the compile group menu produce flat lists (and yes that will make all headers level 1), that’s just the way they work because both can involve items selected from all over the place at varying depths. In the very simple case you describe, where one selects a single folder—it does seem illogical—but consider that one can select five items from level 1, 3, 5, and 2 from points in the manuscript that are dozens of pages apart. In this case, it would produce a very strange looking hierarchal pattern if such were retained. Same thing goes for Collections, which can display items from all over the Binder in any order and from any depth.

As you conclude, if you just want to compile off a folder, selecting it in the Contents pane is the best way to go about it. If selection really is a better choice though (say, you want to compile two chapters), then consider using the Filter option at the bottom, which can also be set to use Current Selection. Filters, unlike compile groups, merely subtract items from the main list above which do not match the described criteria. They do not make any judgements about hierarchy or order.