.MOBI output with monospace

I saw in the release notes that scripts now output with monospace as the default font. It seems as though my fiction novel is doing the same, but I don’t know where I’ve angered the preferences gods.

When I view the book in Calibre, everything is indeed monospace. CSS says it is so. What did I do?

I’m curious how Scrivener gets to the final MOBI file. Does it just build up an ePub and then run it through kindlegen at the end? It would seem that way, but I couldn’t find any reference to how it’s done. Not that that sort of thing is usually included in the manual anywhere, but I like to tinker. 0-]

Actually, it’s not just scripts - any text that is Courier, Courier New or Monaco in Scrivener gets converted to monospace fonts for the Kindle. So it sounds as though your text is getting output as Courier. Most likely you are using standard manuscript format and the “Formatting” pane of Compile is set up to convert the font to Courier. If you’re just using the standard novel template, you could switch to selecting the “E-Book” preset from the “Format As” presets, otherwise, adjust the “Formatting” settings.

As for how Scrivener produces the .mobi file, no, it doesn’t convert directly from .epub, although much of the code is the same. It generates an OPF and NCX file along with a bunch of HTML files (which the .epub format also uses), and then converted these to a Kindle file. There’s a bunch of Kindle-specific code that handles things like setting the correct start page (after any front matter), though.

Hope that helps.

All the best,
Keith

But from what I can tell, it looks like Scrivener outputs the files in the format that would normally build an ePub and then points kindlegen at that bundle to build the MOBI, yes? Plus or minus some extra bits that are Kindle specific.

When I use MobiUnpack to unpack the MOBI generated by Scrivener, it has a kindlegensrc.zip file that I assume is what Scrivener originally output that was then built from. I could be totally wrong about that as I don’t understand all the pieces in play yet, but that’s what I gathered.

Well, yes, but that is who you build Kindle files (in general). It’s the best way of creating Kindle files. Kindlegen can convert several different file types, but the best way to do it is with an OPF file and HTML files. Sorry, I’m not quite sure what you were expecting or why you are confused by this - is there something specific you are trying to determine?

An annoying habit of Kindlegen is that it packs the original files from which the .mobi file was created into the .mobi file itself - annoying because it doubles the file size, but there’s no way to prevent it, unfortunately.

Mostly trying to determine how much it’s worth tweaking things by hand. Since there’s no way to get to the intermediary format that Scrivener builds before passing to kindlegen, I was thinking that creating an ePub, unzipping that, and then doing hand edits from there will net me the same basic file as would be output by Scrivener itself.

The bits I’m missing are the extra things Scrivener knows to put in for the Kindle. The starting page bit, etc… I don’t actually know what else is included in this.

There’s really no way to tell it not to do that? Wow, that’s annoying. :slight_smile: The new one compiles both the KF7 and KF8 formats into one file making the thing even bigger. I’m still using an older version of kindlgen which didn’t produce KF8 output, so I get a slightly smaller file for it. KF8 is mostly a waste given that I’m only writing straight fiction. I don’t even use bold. :slight_smile:

Yeah, it is really annoying - you’d think there would be an argument you could pass to Kindlegen to suppress it, but there isn’t. I’ve seen a couple of Python scripts around for stripping it out, but nothing I was comfortable using in post-processing to add it as an option.

If there’s interest in having Scrivener export the raw files (maybe as an option to have them exported in addition to the .mobi file), I could probably add that as an option in a future version.

All the best,
Keith

I’m not sure how many others would find it useful, but I like poking around at things. I don’t even know that I would find it all that useful, but it would be educational. I assume Scrivener is using a temp directory somewhere to build everything, so maybe I’ll just poke around for that.

It’s mostly about tweaking things and learning more about the formats. I love that Scrivener does all the heavy lifting for me, and it’s one of the major selling features that I tell people when convincing them to buy it. :slight_smile: But sometimes there’s no substitute for fiddling the knobs by hand.

Don’t put it high on your list or anything, but Scrivener already has all the code for building the bundle to pass to kindlegen in some temporary location. Might be as simple as exposing that for the people who don’t mind seeing how the sausage is made. So to speak. :slight_smile:

I’ve added this as an option in the “KindleGen” pane for the next update. :slight_smile: