Compile .mobi

Here is what I want to do:

  1. Insert a page break between chapters*
  2. Include each chapter in the table of contents
    except when the file begins with '**’

What happens instead?

  1. There are no page breaks between any chapter (which are individual files in the binder)
  2. Only the first chapter is included in the ToC

I hope I don’t have to use Calibre to edit the .mobi file for something as simple a inserting a page break between chapters. Kinda seems like this should be default behavior (with the exception of the ‘***’ bit), but instead is much harder than it should be.

Scrivener isn’t really equipped to do things precisely how you describe, which isn’t to say it cannot make a section break or handle scene separators—not in the least—it is merely designed to do so from a different angle of attack.

A more optimal approach that would work with how Scrivener is designed:

  • First, use more than one level of indent in your draft. This isn’t necessary, but it will be easier, and has the beneficial side-effect of being able to collapse or fold scenes away, so that all you see is a chapter list. Here is an example of what that would look like:


We can think of this as a form of nesting by kind. Items at the top level of the draft are things we know to be chapters. Stuff nested to the right of those we can know to be scenes. They could be anything really, this is abstract, but we can start thinking of things productively like that.

  • That works for us, but we also need to clue Scrivener in on what we mean by this. This is done with Section Types. If you’ve never messed with setting those up before, there is a good guide in the interactive tutorial, and the user manual goes in-depth for any detailed questions you may have, in §7.6, Section Types, pg. 133. Basically what you want to aim for here is to have all of your file groups and files on “level 1” of the Draft to act like “Chapters”, and everything below that level to act like a “Scene”.
  • After setting that up, you can poke around in the binder with the Inspector’s Metadata tab open to make sure your settings worked, and anything that should have a chapter break is marked “Chapter”, and anything that should have a scene break is “Scene”. Outliner is a great tool for this as well, as you can add the “Section Type” column.
  • The next ingredient is to set up the compiler. The “Assign Section Layouts” feature in the middle of the overview ought to make more sense now. You’re now choosing what a chapter should do and look like. If you are using the built-in Ebook format (and you should be at least starting from that if you aren’t), you can select from a number of heading styles, and note which ones come with a built-in section break (the technical term for what you’re calling a “page break” in an ebook). For Scenes you’ll probably just want the regular “Text Section” layout.

Before you click OK though, double-click on the “Section Text” preview tile to edit this format. Your separator style is different than the defaults (which use a blank line).

[*] Click on the Separators compile format pane.

  • Select “Section Text” if necessary.
  • On the right side, change Separator between sections to “Custom”, and type in your three asterisks.
  • Click Save.

Note the preview tile changes to reflect your settings. Now click OK and run a test compile.[/*:m]

You’ll probably get double the asterisks you want, since it sounds like you’ve gone through the trouble of typing all of these in by hand. Consider that it would also be possible to set that setting to “Single return” instead of custom. Frankly though, I’d ditch the manual labour in the editor. You can switch separation styles with the flick of the wrist if you leave it up the compiler.

And the same goes for chapter headings as well. Why type in and lay out each of those things by hand when the compiler can automatically number and format them in one shot?

So as you can see, no—but do be aware Calibre can only edit ePub files. If you ever find yourself in a position of needing to do custom edits for things Scrivener cannot do (it’s a pretty short list!), the best approach is to flip on the setting in the General Options tab of the compile overview screen to export source files as well as a .mobi. You can then freely edit the HTML and CSS (as well as other control files), and when you’re done, simply drop the .opf file into Kindle Previewer to have it assemble a custom book.

You’d have found a tip box with a title asking a question much like that, had you ended up in the right place of the user manual. :wink: Depending on your definition of default, it kind of already is that way. If one were to start the project using one of the built-in project templates and followed the instructions it provides for organising chapters and scenes—all of the above setup would be handled for you, including the compile layout assignments. You’d only the need to tweak things from that starting point (for example, to use asterisks instead of spaces).

Not to disparage starting a project from scratch, mind! That’s pretty much all I ever do myself, but I usually have a very specific goal in mind that has nothing to do with how the templates work, and thus it’s easier to start with no assumptions and built up from that, than to dismantle the dozens of styles, layouts and other friendly additions these templates have.