Don’t know what happened

15 08 2013

Yesterday, a strange post was sent out to at least some of my followers.  I have since changed all my passwords, and sincerely hope nothing like this happens again.  I have not touched my blog in like two years, and have no intention of posting to this or any other blog in the foreseeable future.

Formatting an ebook

17 03 2011

So after I  published four stories as ebooks, it came to my attention that the Kindle versions had some formatting issues.  The big problem was that every now and then the indentation of paragraphs got screwed up.  Instead of just indenting the first line of a new paragraph, it indented every line.  It didn’t do this very often  (if it had I would have noticed it earlier) and would return to the proper formatting after just a couple bad paragraphs .

This was unacceptable to me.  It visually disrupts the reading experience and can yank the reader out of the story.  Very bad, so I needed to fix it.  It took me several hours of tinkering to figure out how to do it.  Maybe I’m just inept, but the process didn’t seem very straightforward to me so I’m going to spell it out here for the benefit of others.

(And to those who already purchased my ebooks, I’m sorry for the mistakes.  I uploaded new versions which should go live in the next 24 hours or so, but I believe only for new customers)

Warning to those who don’t give a damn about ebook formatting and the creation of epub / mobi files: this post will be extremely boring / useless to you.  I recommend you watch this video of a guy failing at an automatic door instead and come back when I post something else.

Ok, now that we’ve gotten rid of them let’s get down to business.  I originally uploaded the stories to Kindle Direct Publishing as Word documents formatted in accordance to the Smashwords Style Guide.  I did this since I was uploading to Smashwords as well and they seemed to have the more stringent (or at least more thoroughly defined) formatting rules.  I went back and looked at my source document to see if there was any funky Word formatting in there that would cause the weird indentations.  There was not, or at least not that I could find even with the “Show all nonprinting characters” thing turned on.  Since I was unable to solve the conversion problem, I decided I needed to cut out the conversion process and produce my own ebook files directly.

Easier said than done.  I needed to find some software that would allow me to create, edit, and save epub / mobi files.  For some reason this appears to be a relatively rare thing.  I found a few helpful tools for this (and a few not so helpful tools), and will outline them below.

Scribus –

This software package, as it turns out, does not help in creating ebooks.  At least not directly.  As such I considered just omitting it from this post, but figured it was worth mentioning because several people interested in ebook formatting would also be interested in POD formatting, and that’s where Scribus would come in handy.

It is a free desktop publishing application.  For those who loved analogies on the SATs, Scribus is to inDesign as OpenOffice is to Microsoft Office (or GIMP is to Photoshop).  Not as feature rich as inDesign (hey, it’s free), and I’m not going to go into its use (I barely touched it after I discovered it didn’t output epub files), but if you are looking for a free alternative to inDesign it would be worth looking into.  I checked it out because I know that inDesign can save epub files, so I figured I’d see if Scribus can.  Alas, it (currently at least) cannot.

Calibre –

My Google searches led me first to Calibre, which is basically a free conversion tool.  But it seems primarily aimed at content consumers instead of content producers.  If you buy a DRM-free epub book but wanted to read it on your Kindle, you could use Calibre to do the epub to mobi conversion.  It can import and export a variety of formats, and many authors seem to use it for that purpose when producing content.  For example, it accepts RTF as a source so you could use it to go straight from Word to epub/mobi.

But I didn’t like it very much.  Using it instead of the automatic Kindle Direct Publishing converter was really just exchanging one automatic converter for another.  True, it gives you some more options, but it’s still just a converter and you can beat your head against a wall trying to coax it into converting things the way you want them.

And as far as I can tell, using Calibre to produce a mobi file for upload to Kindle Direct Publishing is a TERRIBLE idea.  It always seems to create a table of contents and appends it to the end of the mobi file.  Not only does the formatting of the auto giant-font table look hideous, it’s completely unnecessary for a short story and in the wrong place for a novel (who puts the TOC at the end?).  For the life of me I couldn’t get it to stop doing that, and about 15 minutes worth of Googling suggested  that a) others have the same problem, and b) if the solution to this problem exists, its obscure enough that 15 minutes of Googling didn’t reveal it.

Sigil –

First, the good news.  We finally arrive at the tool that you will actually want to use, and it’s free.  As far as I can tell, Sigil is the only program that allows you to actually edit (instead of  just convert to) epub files.  It is also a WYSIWYG (what you see is what you get) editor, so you can be (reasonably) confident that when you get the formatting the way you want it within the program, it’s not going to get screwed up downstream (a little more on this later).

Now, the bad news.  Sigil is not very helpful in actually creating the formatting.  The formatting is controlled through CSS style sheets, which means HTML type coding.  You probably don’t want to do this from scratch.  Instead, you want to first convert your story with formatting into HTML (Word can save your document as an HTML file) and then import it into Sigil for tweaking.  Or, as I found, the Smashwords-generated epub file is remarkably clean.  Their converter seems much better than Amazon’s (although, to be fair, Amazon did the conversion in a few seconds where as my story waited in the Smashwords “meatgrinder” queue for over 24 hours).  If you have already uploaded to Smashwords you can download an epub copy and open that up in Sigil for tweaking (for example, you probably want to remove the “Smashwords Edition License Notes” thing before uploading to Kindle).

Speaking of using the Smashwords epub file, one thing I noticed is that it had some meta data in it that I did not expect.  Apparently it pulled the Word registration data and included the software registered user name as the “author.”  So, if you are writing under a pen name and do not want your real name attached to your story for whatever reason (e.g. the internet is for porn), you may want to check this and make sure your name is not secretly attached in the meta data.

After verifying my chapter indentation in Sigil and editing some meta deta I wanted to upload the ebook to Kindle.  Unfortunately, Sigil only saves in epub and not mobi.  Using Calibre to convert to mobi is once again a TERRIBLE idea (stupid appended TOC.  Every.  Single.  Time), so I tried uploading the epub directly (Amazon’s automatic conversion can take epub as an input, much like it can take Word documents).

Once again, formatting issues.  Different ones this time, though.  My indentation was finally consistent, but my scene breaks of three centered asterisks:

* * *

all became left justified.  And my “About the author” section at the end had the heading and  first line of the paragraph indented when I didn’t want it to.  These formatting issues were not there in the epub version.

I spent about another hour fruitlessly searching for a Sigil-like program for mobi files.  Then I realized that my initial title page had centered text that converted just fine, so I decided to interrogate the code to see why those translated fine while my section breaks did not.

It comes back to those CSS style sheets.  It appears that when Amazon does the file conversion, it pays attention to formatting instructions in some areas and ignores them in others.  The trick, then, is to place the instructions in the right spot so that it won’t be ignored.  If you go to the “code view” so that you can see the actual html codes, this was what my properly centered byline looked like:

<p class=”western”>A. G. Baines</p>

And this was what my improperly not-centered scene dividers looked like:

<p class=”western5 sgc-1″>* * *</p>

The <p> and </p> tags merely mark the beginning and end of a paragraph.  The class=western stuck in the opening <p> tag refers to a named paragraph formatting style defined in the css file.  The definition for “western” was as follows:

.western {
display: block;
font-size: 1.125em;
font-weight: bold;
line-height: 150%;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 1em;
text-align: center


Notice the last attribute, which tells it to be centered (I made it bold for emphasis).   Any paragraph referencing the style “western” will be formatted accordingly.

Now look at my scene divider code again.  The style is “western5 sgc-1″.  The problem turned out to be that the “western5″ style defined in the css file did not have the text-align: center attribute in it.   To make the text centered,  “sgc-1″ was appended to the style name, which referred to a little snippet of code within the header of the html file:

<style type=”text/css”>
@page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; }
p.sgc-1 {text-align: center;}


(bold again added for emphasis)

This “sgc-1″ callout was what made the text alignment centered in the epub file.  It overrode the standard alignment of “western5″ defined in the css sheet.  However, it appears that Amazon only pays attention to alignment tags within the style definitions in the css file.  It ignores the overrides.  Since “western5″ was not center aligned by default, my asterisks were not centered after the override got ignored.

You should thus always control your formatting through these style definitions in the css file.  If you need subtle changes to one style, define a new style and use it instead.

I was also able to fix my “About the Author” section by editing the style definitions used there.  By default, the Kindle will automatically indent the first line of every paragraph by some default amount.  To override this, you must manually tell it to use a different value (included zero) with the following argument within the style definition:

text-indent: 0.0in;

For the about the author section, I made the value 0.0 for no first-line indent.  For the body of the text I made it 0.25.  Smashwords had it originally at 0.5 since I had a half inch indent on the Word document I used as a source file, but I thought it was too big and looked funny on a smaller screen.

Well, that’s about it.  Once I put all the formatting instructions in the right place the conversion from epub was perfect.

If you are unsure if your epub will convert nicely over Amazon’s conversion process, Amazon has produced a couple of tools to help you.  You can find them here.

First, Kindlegen.  This is a command line tool for converting various formats to mobi.  Let me emphasize the COMMAND LINE aspect of this.  That means in Windows you are bringing up a DOS prompt and on a Mac you are opening up the terminal utility.  There is no graphical user interface.  I did get it to convert, but it was hardly user friendly.

Kindle Preview.  Now THIS is useful.  You can open up your epub file (by clicking on it!) and it will show you what it will look like on the Kindle.  They even put a fake little battery meter in the corner to emulate the total experience.  So use this to make sure the Kindle doesn’t ignore some key piece of formatting.  It even looks as though the previewer produces a mobi file in the process, so you get your file converted as a side benefit (not sure then why anyone would ever use kinglegen, though I guess you could automate that for large batch processes).  Once you get things looking right on the preview, upload either this generated mobi file or your source epub file.  Either one will come out looking the same.

Hope this helps.

New Fiction: The Dreamwalker

9 03 2011

As I promised yesterday, The Dreamwalker is now up at Amazon and Smashwords (other retailers to follow).  It will unfortunately be awhile before anything else goes up as my other stories are making the rounds at the pro markets, which takes them a while.

The Dreamwalker

Karl has long been plagued by dreams that were more than simple dreams. He’s learned to ignore them, but when his estranged wife–whom he left after discovering her infidelity–comes to him saying that their kids are in danger, Karl will have to learn to navigate his dreams in order to save them.

Available at Amazon and Smashwords for $0.99.

New Fiction Published

8 03 2011

I put two more stories up on the Kindle and Smashwords:

Wormwood’s Impact was my first Finalist for the Writer’s of the Future contest, back in the 4th quarter of 2009.  It has made the rounds at all the Pro magazine markets, and got some very kind personal rejections for it, but alas no one decided to bite on it.  Here is my current product description for it, but I don’t like it very much.  Will probably try to update it to something better:

Just as humanity was about to start colonizing other worlds, an asteroid struck Earth. The survivors call it Wormwood, the star prophesied to fall upon the Earth as a harbinger of the apocalypse. It was sent by God as a punishment for the sins of mankind, especially the mass abandonment of religion in favor of science.

Jude is a priest in the new Theocracy. But when his brother, whom he thought dead, turns out to be alive but scheduled to be executed, Jude’s faith is tested.

Currently available at Amazon and at Smashwords for $0.99.  Will be available in other retailers in a few weeks.

My first entry into the contest, The Watcher’s Onus earned me an Honorable Mention.  Here is the product description:

As a Watcher, a priest of the sacred goddess Mai, Thomas spends most of his time watching over his flock safely from the pulpit. But when a powerful demon known as an Ifriti is discovered within their midst, it is up to Thomas to confront it. Because if he cannot banish the Ifriti in the name of Mai, it will surely destroy the entire town.

Also available at Amazon on Smashwords for $0.99.

I have another story, The Dreamwalker, uploading now and it will probably be ready by tomorrow.  I’ll provide the link when it is.

Captain Picard Christmas Cookie

19 12 2010

Isn’t it festive!

Equivalency Pairs is live!

24 11 2010

Equivalency Pairs is now available!

Amazon Kindle: Click Here (multiple formats available): Click Here

At both stores you can sample a portion of the story before buying.  I believe the Smashwords free sample is a bit longer.

It should be up on the Barnes and Noble store any time now.  I’ll post a link when it is.  It will also be going up on the Apple iBook store and the Sony Reader store eventually, but they may take an extra week or two.

The other story that I plan to e-publish soon, “The Dreamwalker,” is still out to market.  I was a little slow sending it out.  I’ll put it up after I hear back from them.

Upcoming Covers

12 11 2010

In my last post, I mentioned that I was going to start putting some of my work up on the Kindle once I heard from Writers of the Future.  Well, I haven’t exactly heard from them, but I know I didn’t win because the Finalists have been announced.  I was not among them.  I don’t yet knows if I was a reject, honorable mention, or semifinalist, but in the grand scheme of things it doesn’t matter much.  They all equal not win.

I’m going to send the entry to F&SF since they are the best fit for a 17,000 word fantasy story.  Their response time is only about a week, and I’m going to use that time to learn how to do all the formatting I need to turn my manuscripts into an ebooks.  To give you a taste of what is shortly to come, here are my notional covers.

First, the cover for “Equivalency Pairs.”  It was my 1st Quarter 2010 Finalist:

And here is the cover for “The Dreamwalker,” my latest contest entry:

These stories will be my grand experiment with ebooks, chosen because there is a very limited market for stories of their length in traditional publishing.  My shorter stories, such as my 4th Quarter 2009 finalist, I’m going to try and find a home in professional magazines.  My novels (whenever I finally finish one) I’ll try to sell to a big New York publisher.

Unless of course my experiment here shows that self publishing has greater potential than I realize.  I’ll keep an open mind.


Get every new post delivered to your Inbox.