Turning this on seems to fix the issue (I do not think I turned that off?
It is off by default, and ordinarily you wouldn’t want it on, so I’m not sure if that is much of a solution—but if you can make it work with it on, that’s fine (it shouldn’t do anything for Section Layouts that do not generate a Title).
I was mainly curious if had been turned on at some point, as the result you were posting looked a bit like it had been.
Should I send in an export of my format?
That could help, along with a minimal project structure that replicates the problems it reveals. Basically enough Draft structure to trigger the section layouts needed. The Format can be saved into this sample project so that it in theory works with a simple click of the compile button.
I would go about doing so by using Save As to create a demo copy of the project, strip everything out, empty the trash, and leave some lorem ipsum text behind in the necessary binder structure.
I’ll see if I can figure out what is going on and offer you a better workaround—and get anything else written up as bugs, if need be.
At this point, I have to call the CSS Scrivener generates completely broken, not just for this but for many more issues (like the font size I have to override with !important).
Oh yes, and the HTML output is broken as well, as you note. Basically, ePub output was never finished. It appears to have been programmed to work against the stock Ebook compile format’s default settings, instead. The more you push your settings away from that default, the more issues you will likely run into. Thus for those that don’t do much or any design, it “works” in a broken-watch-twice-a-day sort of fashion—so for most people using this, it’s “fine”. But anyone that does their own design, or wants to use the compiler the way it was designed to be used, will often run into issues.
I’ve said it before in other threads, but I would never mess with this exporter myself. I would install Pandoc, to activate Scrivener’s integration with it (after a restart), which will add a Pandoc → ePub entry at the bottom of the Compile For list, where you would select ePub3.
This approach can be used with a project that hasn’t been written with Markdown in mind, thanks to the setting to convert rich text to Markdown in the general options compile tab. One may need to tweak some styles so that they generate Markdown, as by default it will ignore most rich text directives.
It requires one to design the CSS themselves, though one can use Scrivener’s GUI generator to get the basics done, with some adjustments to its much cleaner HTML output. For someone that knows what they are doing though, that’s probably unnecessary.
What I do is first compile with no CSS settings, which causes Pandoc to insert a bunch of example CSS. This is a good starting point (it isn’t too opinionated) for making a design, which I do in Sigil. Once I’ve done that, I copy and paste the entire stylesheet.css contents into the “Pandoc Options” compile format pane.
It’s maybe a bit late to consider a change that radical for this project, but maybe worth looking into, and seeing if it will work for you, with the next book.
I’m biased because I vastly prefer writing in Markdown to begin with, and that is the only way I write in Scrivener, but to my mind it is easier to work toward something fully functional, and learn how that system works, than spend time trying to figure out why options that say they do “X” do not, and so forth.