eBook Conversion

eBook conversion for Kindle and ePub readers

eBook aggregators and online book stores

Where to sell your eBook isn’t a subject I want to go into deeply and there are several people on the web who are far more knowledgeable than me. However, it does have some implications for formatting and conversion, so I thought I’d better mention it.

As far as market share goes, Amazon is the by far the biggest fish in the pond. Depending on whose figures you believe, Amazon’s share of the eBook market is somewhere between 70 and 80 per cent. For this reason alone, I think it’s worth spending time making your books look as good as possible and it’s why the Kindle format is the focus of this site. Getting your book in the Kindle store is a fairly straightforward task.

Next up is Barnes & Noble, who seem to have a market share of somewhere between 15-20%. B&N sells in the ePub format. They also make it fairly straightforward to upload your file and sell through their site but there’s one catch; you must have a credit card registered to a US address. If you have one, I’d recommend doing this; however, if you don’t then there are workarounds.

Apple and Sony, despite their high profile – especially in terms of the iPad – aren’t actually selling that many eBooks themselves.

I must also add that I have no personal experience of any of the sites I’m discussing on this page; although I’m a writer and editor by profession and I’ve formatted several eBooks for friends and acquaintances, at the time of writing I have no book to sell. There are several excellent websites and people on Twitter who know much more than me about writing fiction, design, marketing and distribution.

eBook aggregators

eBook aggregators are companies who will take your file, convert it into multiple formats and make it available through multiple distribution channels. They typically make money by taking a small commission or charging an upfront fee. They often are the only way of distributing your book via Apple’s iBookstore, Sony, Kobo and Barnes & Noble.

How many channels you want to sell on is up to you, but as I’ve already mentioned, you want to be on Barnes & Noble as well as Amazon. If you can’t sell directly through them, the only aggregators that let you access this channel would appear to be Smashwords, Lulu and BookBaby.

About Smashwords

Lulu and BookBaby both give you the option of uploading ePub files. You can use online validators (such as this one) to check your file before you submit it.

Smashwords seems to have a high reputation in self-publishing circles – for the range of retail channels they offer and for their competitive pricing. However, for reasons best known to themselves, Smashwords will only accept files in Word 2003 format. The company uses a proprietary piece of software called Meatgrinder to convert Word files into the myriad of formats they offer.

Of course the problem with this kind of conversion is that it often gives you a format that could be described as acceptable but rarely looks professional. Stylistic features such as images as chapter headings and drop capitals simply aren’t allowed.

Smashwords offers a very long and detailed style guide, which you must strictly adhere to. Tales abound on the internet of files rejected by the Meatgrinder. (Paul Salvette also has a useful guide to submitting Word files to Smashwords.)

Now, you may be annoyed that I’ve encouraged you to convert your Word file into HTML for conversion and you may now have to send a Word file after all. However, all is not lost:

1. Much of the Smashwords style guide is based around using Word’s Styles and Formatting features, which I’ve encouraged you to use prior to conversion. So chances are you’ve done much of the work already
2. If you’ve done all the style work by editing the HTML code, MS Word does a fairly good job of opening simple HTML files, which you can then save as a Word document. (I’d appreciate a comment from someone who’s done this – unfortunately there’s no way for me to test the Meatgrinder without submitting a book.)

If you’re going to use Smashwords, I would encourage you to try and do your best with the software. I’ve looked through some of their free .mobi book downloads on my Kindle and several of them look pretty lousy. I suspect it’s a combination of poor author formatting and the limitations of the Meatgrinder software.

Printing on Demand

Several companies let you upload Word or PDF files and print individual books to order; after all, many people still prefer a paper book. The most famous of these is probably Lulu.

This subject is also beyond the scope of the site. If you’re going to do this in MS Word, then tweaking the Styles and Formatting attributes makes this a whole lot easier. From a page layout point of view, I’m not a fan of Word – unless you know the program well, your pages invariably end up looking like office documents.

A good solution to this may well be the free program LyX; this uses a typesetting engine called Latex, via a basic word processor-like interface. For producing prose such as novels and poems you can get some very attractive results (here’s a PDF of the first two chapters of Emma done on LyX). Although it’s not particularly difficult to use, it’s not as intuitive as MS Word and there’s not much online documentation for the beginner (although this guide isn’t bad). However, I may return to the topic if there’s enough demand, as I think it’s a very useful tool for the self-publisher.

References and links

If you’re writing non-fiction, you’ll probably want to include references and possibly links to other parts of your eBook.

Fortunately, both these features are supported and, as you’re probably aware, work on the basis of hyperlinks.

The good news is that it’s much easier to do references and links in Word or Open/Libre Office, rather than having to go into the code.

Adding a reference

This method will work whether you’re doing your HTML conversion via cKEditor or via Open/Libre Office.

To add a reference in MS Word, you put the cursor where you want the citation to appear and go to Insert > Reference > Footnote. Word gives you the choice of footnotes (which appear at the bottom of the page) and endnotes (which appear at the end of the document), but it’s not important here, as they’ll all appear at the end of the book anyway.

In Open/Libre Office, it’s almost identical – go to Insert > Footnote in the main menu.

You many want to go into the code and insert a heading for your references.


You can add internal links to eBooks that behave in the same way as hyperlinks on the web. (It goes without saying that your links should be internal and should not link to the internet.)

Again, it is easier to do this using a word processor. In MS Word, you need to use the Bookmarks function, outlined here. If you convert this later using cKeditor, the links should remain when you convert it to HTML. (Using MS Word’s Insert >  Hyperlink and linking to a heading does not appear to work.)

If you want to go into the HTML code (or have to fix it), the syntax is below. It is necessary to give your link a unique name (‘foo’ in this example). The hyperlink will appear on the word ‘text’. Use the following code to create the link:


For the link destination, place the following markup just before it:

Styles & Formatting and document conversion

I can’t repeat how much of a timesaver – and good practice – it is to use styles in your word processor document. Not only does it give consistent formatting throughout but it’s also a real time-saver and it makes conversion a whole lot easier.

In both MS Word and Open Office/Libre Office, you do this via the Styles and Formatting pane (go to Format > Styles and Formatting). If you are unfamiliar with this function, go to this site for an explanation.

For a lot of novels, you probably only need three styles – one for the chapter headings, one for the body text (preferably with an indent) and one for the first paragraph of a chapter (without an indent). If you use spaced paragraphs with no indents, then you might only need two.

Even on more technical publications I’ve worked on, I’ve often never needed more than eight or nine – mainly more heading levels and styles for numbered lists, bulleted lists and captions.

A typical layout


This Word 2003 file will open without problems in Word and Open/Libre Office. Once open, display the Styles and Formatting dialog – in Word, select ‘Formatting in Use’ from the ‘Show’ drop-down box in the Styles and Formatting pane; in Open/Libre Office, select ‘Applied Styles’ from the drop-down box at the bottom of the Styles and Formatting box.

This sample document uses the following styles:

  • Normal – normal (indented) paragraph text
  • First – same as normal, but without an indent, for the first paragraph after a heading, indent or list
  • Heading 1 – chapter heading
  • Heading 2 – second-level heading
  • Heading 3 – third-level heading
  • Bulleted
  • Numbered
  • Indent – an indented paragraph for quotes

To be honest, that’s probably all the styles you’ll need, unless you need one for photo captions or another level of headings. Remember, the Kindle isn’t capable of displaying much more (see CSS paragraph styles).

Also, press the Show Hide ¶ button and you’ll notice there is no manual formatting at all – there are no page breaks, tab stops or double paragraph marks and all the spaces are single ones (see this page for common formatting problems).

It may be easier to paste your document into this one and apply these styles, rather than to do it yourself from scratch. However, you need to be careful, because simply pasting text, selecting Select All and applying the style can make your bold and italic formatting disappear. Try the following:

  • Delete the dummy text. Go to Edit > Select all and click on the style that will be most abundant in the document (i.e. ‘normal’). If another style appears in the list, delete it by hovering over the style, going to the drop-down list and selecting delete
  • Go to Edit > Paste Special and select ‘formatted text’ from the list. Press OK
  • You’ll then need to go through the document and apply styles for headings and first paragraphs. Rather than selecting the whole paragraph and applying the style, put the cursor within the paragraph and apply it; this should keep any bold or italics in the copy

Converting word processor files to HTML


If the formatting in your book is simple, then I’d recommend cKeditor, as I outlined in this post. It produces very clean, easy-to-understand HTML that doesn’t need tidying up. It has a couple of downsides:

  1. Custom paragraph styles – such as indented quotes and first paragraphs – are not exported; they have to be restored manually in the HTML code. Therefore if your book is highly formatted, it’s probably not the best choice
  2. It doesn’t save internal links (although it does honour footnotes)

In this case, you’re better off doing the conversion in Open/Libre Office.

Word processors

Although doing your composition in MS Word is fine, its HTML export – at least on Word 2003, which many people (including me) are still using – is awful.

Fortunately, the HTML export from Open/Libre Office is fairly good, if you’ve been strict with applying the styles. So, even if you don’t want to write using this program, you can use it to open your Word file when you’ve finished it and do the HTML export. Here’s a step-by step guide on the basis of this sample file:

  1. In Word, check for unwanted styles by selecting ‘available formatting’ in the Styles and Formatting pane. To get rid of any, select the drop-down list of the style and select ‘Select All’ in the list. Then click on the style you want and the unwanted one should disappear
  2. In Word, ensure all the text has the same language – select all the text and go to Tools > Language > Select Language and pick the preferred one from the list. Sometimes if you don’t do that, the converter will apply language tags to every paragraph
  3. Save and close your document, then open it in Open/Libre Office. If the program prompts you to save in other format, select ‘keep current format’; it doesn’t make much difference to the conversion process
  4. In Open/Libre Office, text with the style ‘normal’ in Word needs to be ‘text body’. You can do this using Find and Replace – open the dialog box, press the More Styles button and select Styles. Replace ‘normal’ with ‘text body’
  5. To save the document, go to File > Save As > HTML. Close the document

Tidying things up

At the top of the page, delete every line starting with <META … > h1{ text-align:center; page-break-before: always; text-decoration: underline; text-decoration: bold; margin-bottom: 2em;} h2{ text-align:left; text-decoration: bold; margin-top: 1em; margin-bottom:0em;} h3{ text-align:left; font-style: italic; margin-top: 1em; margin-bottom:0em;} p.first {text-indent: 0;} p {text-indent: 1em; margin-top: 0; margin-bottom: 0;} p.indented {text-indent:0; margin-left: 2em; margin-right: 0em;}

You now need to do some Find and Replacing. Some complicated tags have been generated, but they’re all consistent and can be fixed in five minutes or so. Refer back to your original Word or Open/Libre Office file to match up what the styles are.

Below is a list of the tags I got in my output, but they may differ slightly depending on your configuration. But it should explain the idea. Remember the tags always come before a paragraph.

Remember, in Notepad++ if you highlight some text then press Find (Ctrl-F), the text will appear automatically in the Find box.

You can keep checking how everything’s looking in the browser in Notepad++ by going to Run > Launch in … (and selecting which browser you’re using).

Type of paragraph Tag outputted by software Replace with
Normal (indented) paragraph <P CLASS=”western”> <p>
Paragraph without indent <P STYLE=”text-indent: 0cm; margin-bottom: 0cm”> <p class=”first”>
Chapter heading <H1 CLASS=”western” STYLE=”margin-top: 0cm”> or
Second-level heading <H2 CLASS=”western”> <h2>
Third-level heading <H3 CLASS=”western”> <h3>
Indented text <P STYLE=”margin-left: 1cm; text-indent: 0cm; margin-top:
<p class=”indented”>

Recommended software

The good news is that you can generally do your self-publishing project with open source and free software. I imagine better, paid-for software is probably available, but I’ll leave that for other people to comment – sadly, I’m not in the pocket of Big Publishing (although I would like to be).

In this area, the PC platform is generally better catered for than the Mac.

Read the rest of this entry »

© Paul Brookes, 2015. Powered by Wordpress.