Thursday, June 27, 2019

Mobi Dick

So I have been trying to drum up some more reviews for Joshua, and following the advice I found here, I looked up a few book bloggers who might want to read my novel and, I hope, go on Amazon and Goodreads to tell people it doesn't suck.

It turns out there are a few bookworms out there who do indeed take a chance on self-published authors, although it seems like a lot of them do it just to make money. However they do it, though, a lot of them prefer to get manuscripts in mobi format so they can be easily read with a Kindle.

Mobi? I have to confess I never heard of it before I started my quest for reviews. I've heard of lots of file formats, but this one is unique to Kindle users. But no biggie, many have told me; all I need to do is go to my book details on my KDP page and download my manuscript in mobi form. There. Done! So I go there, and I get:

WTF?! did they lose my manuscript or something? No. The problem is that I uploaded my manuscript as a .kpf file, something spat out by Amazon's Kindle Creator app when you feed it your manuscript. In order to download your book in mobi format you have to have uploaded it in mobi format.

Anybody see the disconnect here? What kind of idiot would clobber their original mobi file, thus making this expedition necessary? Don't answer that.

Joshua began life as a couple of short stories about a boy who gets into all kinds of humorous predicaments. I wrote them in HTML. After I wrote a few more of them, I started to get more serious about the project so I abandoned the HTML and converted the text to a Google Doc. There are a number of advantages to working this way as you are developing your manuscript. Everything you write is saved in real time to your Google drive, which you can access from anywhere, on any device that supports it. When you're away from your PC and you have an idea for your story, you can just whip out your phone, open up the Google Docs app, and start writing. I wrote a significant portion of my manuscript for Joshua in this way.

Once I was done with it, however, I needed to format it for print, paying attention to paper size, margins, and text placement in order to conform to Amazon's standards. I could not do this in Google Docs and I didn't want to do it in my severely outdated copy of Word. What I really did not want to do was pay for Office 365, the latest bloated atrocity of an office suite from Microsoft. I did, however, have a copy of Apache Open Office that was up to the task. Sort of.

I tried exporting my manuscript in Open Office's preferred format, .odt, with some funky results. Things I had formatted within Google Docs went all wonky when I opened them in Open Office. Trying to fix them all piecemeal proved to be too much of a challenge. I finally went back to Docs and stripped the manuscript of all formatting, re-exported it to .odt, and painstakingly reformatted everything from the chapter headings to the italics. After several days' hard labor, I had a manuscript that was fit to publish as a paperback that met Amazon's standards. It was extremely quirky, however. It was very easy to mess up my page numbers. I had to input my TOC manually. When I finally had it ready to publish, I exported it as a PDF, and hooray, nothing got trashed in the process.

But it turns out that .odt is not an acceptable format for Kindle Creator. I went back to Open Office to export it as a .doc, and it trashed my page numbers again. This wasn't really a problem, however, since Kindle Creator strips out the page numbers anyway. So I imported it to Kindle Creator, went through it page by page to fix up things that didn't import in a way I liked, and finally, I had both a print-ready and Kindle-ready manuscript to upload to KDP. A couple of days later, both were live on Amazon. Yay.

But troubles still lurked unseen, surfacing when I tried to make a mobi. There is a very good, free, open source tool known as Calibre that will convert manuscripts into both mobi and epub formats. Although it has a few quirks, it's pretty slick. You import your manuscript, turn the crank, and out comes your mobi. Well, it isn't that simple, but you get the idea.

But Calibre doesn't accept .doc files for conversion, and Open Office doesn't produce .docx files (no idea why). Calibre does purportedly convert .odt files, but it would rather have a .docx. I thought this might be my problem, so I got another free tool, LibreOffice, that can export a manuscript as .docx. Problem solved? I wish. Calibre converted my manuscript to a mobi, but it did not produce a table of contents from the chapter headings like it was supposed to. It also made a goof with the picture of Robert Fishell I use in my About the Author page at the end of my book. No matter, I just got rid of it rather than try to debug it. That still left me with a TOC problem.

I started plowing through the documentation for Calibre and discovered that it works its magic by converting whatever you give it to an intermediate form in XHTML that you can edit, if you understand enough about XHTML to know what you are doing. I do (although I'm pretty rusty), so I was able to generate a TOC manually. This left me with a question of why Calibre didn't just pick up my chapter headings to begin with.

I reported this as a bug to the developers, who promptly told me I needed to use heading styles in my manuscript, marked my bug report as a non-issue (as in RTFM, dummy), and went away. Leaving me with no idea why I couldn't get a TOC from the chapter headings which were quite clearly formatted using heading styles. I figured the problem was that converting the manuscript so many times had somehow corrupted it, but I didn't know how to fix that without stripping it down to plain text and starting over.

I respectfully asked them to look at the document again, or at least read what I told them in the first place, and what do you know – I had discovered a bug after all. Evidently the problem was that I numbered my chapters. Lots of, if not most, book authors do that. But it turns out that Calibre sees those numbers and thinks you made a list, and thus tags them with <li> rather than <h1>. If you don't know anything about HTML, I won't go into that, but the upshot was that the developer I was working with figured out the problem and fixed it for the next biweekly rollout. So you can thank me for my persistence in pursuing this issue if you're using Calibre and need a TOC for your numbered chapters.

And I can now give the thousands of reviewers who are champing at the bit to read Joshua a fully functional mobi, or even an ePub if they want it that way. I even figured out how to put Robert Fishell's mug back into the About the Author section. Go me.

Joshua will go live on BooksGoSocial in July. Watch this space.


No comments:

Post a Comment