I have just read Building your book for Kindle and it tells me to create a .docx file, then export it as “filtered HTML” (which I gather filters out all the extra MS tags that Word needs to round-trip the HTML), then zip it (along with any illustrations).
It seems to me that Scrivener could compile to HTML directly and save me a tedious production step. If anyone has tried this I’d be glad of any pointers.
My book is about programming, and it is helpful to have programming language elements typographically distinct in the text. A widespread and very long-standing convention uses monospace for this purpose. As I understand it .mobi cannot do that.
Ah yes, reading source code in a proportional font is unpleasant, its a good convention.
I’m not around a Windows machine to test at the moment, but you could quickly do so with a sample project that has some text, and Kindle Previewer. I’d try with Courier for the source code and see if compiling to Mobi gives you the result you need. If not, try HTML, it is probably cleaner than what you’d get out of Word and is one less step away from where you are headed.
To be clear, Amazon is going to convert your material to Mobi/KF8 no matter how you upload it. So any limitations inherit in the format will not be dodged by using .docx or .html. On that score however, Mobi can mix monospace and body text fonts in the same book. The question is whether our exporter on Windows leaves the “monospace” declaration in the CSS or strips it out.
Windows doesn’t currently respect monospace font when compiling to these formats, but you could mark the text with right and left boundaries in the editor, then do a replace all to switch them to the correct and in the XHTML after compile. That’s simple to do in something like Sigil, so you could even do the ebook compile as an epub, make that edit in Sigil, and then convert to mobi through KindleGen (or Kindle Previewer, which uses KindleGen).
If you’re doing it purely with CSS, you could do something similar by marking the code text in the editor with a font colour, which would give the code a unique class in the CSS for the epub, and you could then just switch the font color with the monospace font style.