[RSP Video Tutorial 001] How to Format an Ebook

In Video Tutorials by Simon Whistler37 Comments

formatabookcoverThe book’s written, its been carefully edited, proofread half a dozen times, and your cover designer has done an award winning job (well, at least you think so).

Ready to go, right? Let’s get’s get the damn thing up for sale already.

Hold your horses, their is one more step. Amazon isn’t going to accept your Word document, no matter how well edited it is…

You need your book formatted. 

Following up my last course on how to build a website, by almost a year, I finally present How to Format Your Ebook. 

Aren't we done yet?!

Aren’t we done yet?!

“No problem,” I hear you say, “there are tools for that!” And I can almost hear you thinking, “Oh come on! I just want this damn thing done already!! Let’s just jam the thing into one of these tools and be done with it! WHERE IS MY MOBI FILE?”

While that is true, there are tools that convert Word documents to ebook formats, they are far from perfect. If you just spent weeks, months, or even years, writing your book, don’t mess up now. These tools can often leave you with artifacts (weird blips) in your book that will annoy a reader, often enough for them to ditch your book, leave you a poor review, or even, not buy the book in the first place (although maybe you could just have a really well formatted sample 😉 ).

Good news? It’s not hard. I just learned it all in a week thanks to Guido Henkel and J Thorn, two gentlemen who have created fine fine guides to formatting ebooks. I knew nothing about this until a few weeks ago. Now I know all the basics and am confident I can create a beautifully formatted ebook.

And soon you will be able to as well.

I present, my own (visual) take on formatting an ebook. In this completely free 7 part course, I show you how to go from Word (or wherever you wrote your book) to beautifully formatted ebook. No prior skills required.

(I’m confident that after watching this, you’ll even know enough about book formatting to potentially turn it into a decent earning side gig!)

Get started by watching this intro video: (The rest of the course follow below).

Part 1. Introduction to Formatting an Ebook

First off, let’s take a look at the why and how of formatting an ebook…

As mentioned in the video, I would recommend that you download these programs which are useful for ebook formatting, before you get started:

OpenOffice – Microsoft Word Alternative

TextMate – The main program we are going to be using to format our book. Sublime Text is the best Windows alternative.

Calibre – Ebook management program, and what we are going to be using to make the final ebook conversion

Part 2. Making Tweaks in Word (or you chosen word processor)

Now we move onto tweaking our manuscript in our word processor before we take the file and really get into the depths of editing. Taking these steps in Word will save us a bunch of time down the road.

Oh, and apparently I’m pronouncing it ELIPSE the whole time. I mean elipSIS. Whoops.

Here is the em dash you can use: 

Here is the ellipsis

Italic HTML code: <i>^&</i>

Bold HTML code: <strong>^&</strong>

Part 3. TextMate Formatting Basics

Now that our Word document is tidied up we are ready to move into TextMate…

Update: For those working in Sublime text, the process for inserting the special characters and paragraph tags is slightly different. Please check out this video: http://youtu.be/9UiuyUhJBrk for an explanation.

Paragraph find: ^(.+)$

Paragraph replace: <p>$1</p>

Paste at top:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<style type="text/css">
html, body, div, h1, h2, h3, h4, h5, h6, ul, ol, dl, li, dt, dd, p, pre, table, th, td, tr { margin: 0; padding: 0em; }
text-indent: 1.5em;
margin-bottom: 0.2em;

Paste Below:


Part 4. Adjusting Paragraph Formatting

Now we will look at some more complex things in TextMate and start to make our book look less like a wall of text, and more like the final book. Specifically we’ll be looking at some of the changes we can easily make to the main paragraph text we have in our book.

Part 5. Creating Chapter Headings

Chapter heading are essential to any ebook. You need to have them on a new page, and make them stand out from the rest of the text. This part of the tutorial will show you how to create these chapter headings (they’ll also be perfect for easily creating our table of contents later!).

Chapter heading code:

text-indent: 0em;
text-align: center;
font-weight: bold;
font-size: 2em;
page-break-before: always;

Part 6. Working with Centralized Text

Yes, it needs its own video… Not just as easy as clicking the centre button sorry… Might not apply to everyone, only if you have centralized text in your book.

Centralized text code:

text-indent: 0em;
text-align: center;
text-indent: 0em;
text-align: center;

Centralized text here:

<p class="centered"><span class="centered">CENTRAL TEXT HERE</span></p>

Part 7. Converting Files in Calibre

Ahhh, the final step, taking our fantastically formatted HTML ebook file and turning it into something that ereaders will understand.

Table of content text:

//h:p[re:test(@class, "chapter", "i")]

For resizing your book cover – PicResizer.com

That’s all folks. I hope you find this guide useful, and I’ll shortly be making a bunch of plug-in tutorials so you can do more with your ebook formatting :).

And when I need to do my print formatting, I’ll have to learn that too and will share the process with you all!

Simon Whistler[RSP Video Tutorial 001] How to Format an Ebook
  • Walter Mitty

    Simon – great website, great podcasts, great info and now even great tutorials. THANK YOU!

    • SimonRSP

      Hi “Walter” – thanks, I appreciate that :). And love that poster, it put a big smile on my face 😉

  • Jason Fuhrman

    Great guide, but if I’m writing in scrivener, is all this still valid? Or is this strictly for someone coming from standard word processing software?

    • Scrivener produces great mobi files. It’s what I use to create my ebooks. I’ve not checked out the above thoroughly, but it seems to get right to the heart of formatting an ebook by directly manipulating the html. It would give you ultimate control over how your book is presented – if you have the time.
      For me, at least, my formatting demands are quite simple and using Scrivener (which uses KindleGen) means I don’t have to get into this. (yet ;))

      • SimonRSP

        Hey John. Yep, this tutorial goes deep into the HTML side of things (but I hope I make it easy to understand). I use Scrivener myself, but found that the export kept causing various problems in my final book. That might be because it is non-fiction, and has some more complicated elements (tables, “Important” boxes, some images etc).

        But you hit the nail on the head, if you have time, this is worth learning, if not, Scrivener should do a decent enough job. Although for something that will work across all platforms, perfectly, you’ll need to jump into HTML or hire someone :).

        • Simon, yeah, I should have qualified that Scrivener does great mobi files *for the amount of effort* that you have to put into them (next to nothing).
          I’m really looking forward to seeing these videos (which I’ll do when the kids are in bed) with a mind to see how easy it would be to automate the entire process.
          I’ve had a quick search and there doesn’t seem to be a free MS Word plugin to export to mobi, which potentially I could write — depending how complicated it gets. As far as I can tell later versions of word write out to an xml based file format, so I could tackle it with xslt and config files – or write code (Windows only) depending which route was easier.
          It would be good to retain the master in Word, rather than have to go through the entire process again when it came to revisions — though I’m making assumptions at this point as to how you would keep the ebook up to date with latest changes.
          Anyway – fantastic show and resources, I’m really grateful for the amount of work and effort that you put into this 🙂

          • SimonRSP

            Yeah, that would be really really neat. It’s quite a process and while I don’t have the tech skills myself, I was thinking often “surely a computer could do this part at least!” For example, running through the italic and bold formatting in Word.

      • Jason Fuhrman

        Thanks John!

    • SimonRSP

      Yes, still valid. I write in Scrivener, then take it out of the program at the end. Starting the formatting process in a word processor, like Word, makes for an easier transition. 🙂

      Also the track changes feature in Word is far ahead of Scrivener, and makes working with an editor easier!

      Edit: If it helps, I can make a quick plug-in tutorial about bringing the manuscript out of Scrivener and into work. Let me know!

      • Jason Fuhrman

        That would be great, Simon. I’ve exported test files of my book out of scrivener, but there are formatting tweaks I’d like to do, so maybe it will be worth the extra effort.

        • SimonRSP

          You got it Jason, I’ll probably get to this late next week, I’m a bit busy at the moment with book stuff 🙂

          • Jason Fuhrman

            Really appreciate it. Take all the time you need.

          • SimonRSP

            Got it done ahead of schedule: http://youtu.be/ZwSFKmRdY8Q

            Let me know how that works 🙂

          • Jason Fuhrman

            Man that was quick. Perfect! Thanks for all you do, Simon.

          • SimonRSP

            You’re welcome Jason!

          • Going to try this also, as I use Scrivener myself. I’m desperately trying to get my first book ready for release and am realizing that setting the book up is nearly as much work as writing it! :-p Thanks for all this work Simon! And Merry Christmas and Happy New Year!

          • SimonRSP

            Yeah, I found formatting a headache myself. I hope this guide proves useful. Merry Christmas.

  • Pingback: Production Update (Another Sponsored Post) | Jillianne Hamilton()

  • J Scott Sharp

    I have run into some difficulty. I am using Sublime Text instead of Textmate because I have a windows computer. In video 3, you explain how to automate the replacement of apostrophes and quotations using bundles on Textmate, but I don’t know how to do that on Sublime Text. It doesn’t appear to work the same way. However, on the video their is not other explanation, or an alternative way to do this. I wondered if you found anything out for those of us without a Mac. Hopefully, because I don’t have a clue how to proceed. I appreciate these videos more than you know:)

    • SimonRSP

      Hi J, alrighty this requires a slightly different process, but I just checked it out and it should work as follows!

      You’ll need to do this before you insert the tags to each line of the ebook.

      First, select all. Click “Tools” click “Command Palette.” In the window search for “encode” the click “HTML: Encode Special Characters”

      Now, you’ll need to insert the p tags (), which is actually easier to do than it is on a Mac!

      Highlight the entire document by pressing “Ctrl + A,” now, do “Control + Shift + L” then “Alt + Shift + W”

      Done. Let me know if that helps :).

      • J Scott Sharp

        Like a dream, Simon. Like a dream! Awesome. Thank you so much!

        • SimonRSP

          Awesome, happy to help J. I’ll make a quick video and link over to this solution in the video so other people don’t stumble here :). Thanks!

    • SimonRSP

      For those having this same problem, I have now made a video version of the solution:


  • Marie

    Hi Simon thanks for the fantastic videos! Extremely helpful.

    I’ve been using Adobe Dreamweaver to create the HTML file and it seems to be a more straightforward process to convert a Word doc. BTW > I notice that the code you’ve mentioned in Part 7 to create the Table of Contents in Calibre is not available to cut and paste. I’ve just copied the code from a screenshot

    • SimonRSP

      Ah, I must have missed copy and pasting that across, thank you for letting me know. I just updated the text 🙂

  • Rachel Leigh Smith

    I want to share a couple of time saving tips I’ve picked up out of my absolute refusal to use Word. I adore Calibre and use it to produce all of my ARC’s, as well as to put manuscripts on my Nook to do read-throughs.

    The reason Calibre often puts out funky looking ebooks is because of Microsoft Word and all the unnecessary code in the background. Anyone who’s toggled characters on and off in MS Word has seen what I’m talking about.

    Switch to Libre or Open Office. As you’re writing, save your manuscript in whatever format you want. I default to .doc. BUT, when I’m done and ready to import into Calibre, I ditch the .doc. Why? Because Calibre doesn’t natively support the .doc format. You have to convert to a PDF.

    Save your manuscript as .odt, the Open/Libre office file format. Every single problem disappears. Every. Single. One. (in my experience, which is well over a dozen manuscripts I’ve turned into ebooks and put on my Nook). Calibre is built to accept the .odt file format with NO intermediary step like PDF. It has zero issues with paragraph breaks, no issues with italics or bold, or anything else you run into when working with a .doc file.

    When I switched to using .odt files every single problem I had to deal with from using .doc disappeared. It produces a BEAUTIFUL, professional looking book. To date I’ve not found any errors that weren’t my own fault, such as not doing hyperlinks correctly.

    Libre and Open’s AutoCorrect feature can run circles around Word’s. It automatically makes an em-dash as soon as you hit space after the next word. It took me a bit longer to figure out how to make it do a proper ellipsis, and the trick is to space, do the periods, space again, then go back and delete the extra space at the beginning.

    It takes me five minutes to make an ARC with Libre and Calibre, and that includes formatting and using the Calibre Table of Contents tool for epub and AZW. It unfortunately doesn’t work with mobi. I even successfully uploaded epubs created with this method to Google Play and Nook Press, the two most finicky systems currently out there. Both went through on the first try, and I did not run either file through epub validation before trying to upload.

    And if you’re doing Smashwords, if you use Libre or Open the only part of the style guide you have to follow is the Table of Contents. Everything else you can ignore. I’ve done it, and happily thumbed my nose at Coker the whole time. Took me 15 minutes to build the ToC and it went through on the first try after that. With zero errors.

    • SimonRSP

      Great tips, thanks Rachel for such a detailed comment. Yeah, Word leaves such clutter around a document, it’s quite remarkable. I haven’t used Open in a long time, or used Libre ever, but I’ll be certain to check them out.

      I heard the other day that you can upload a clean epub to Amazon and they will do a perfect conversion to mobi for you… Haven’t verified this myself though.

      • Rachel Leigh Smith

        I haven’t used Open since Apache bought it, though I hear great things about it. I switched to Libre a couple years ago. I love the extensions and plugins I can use to make it work exactly the way I want.

        I hadn’t heard that about Kindle either. I may have to try it and see what happens.

        • SimonRSP

          Please let me know if that epub to Kindle upload works neatly for you 🙂

  • Marie

    Some more code that might be useful…. to obtain Full Justified the style code should be changed as follows:


  • Sean

    Hi, Simon, Thanks very much for the video. Just wondering, do you have video for add picture on the ebook editing? Thanks again!!!

  • Serena

    Hi Simon, I have done this tutorial several times now and am actually learning my way around things. At first I ended up with those cute little black boxes at the end of chapters. The ones I hate and have actually found in some authors e-books. I quickly found the code for those and eradicated them. Yeah. Now my books are looking much more professional and I uploaded my first to Amazon. Smile and Amazon didn’t chew it up or spit it out.
    Now to my problem. I have been searching for a way to get hyperlinks in the final version. I seem to be missing the mark is there a link you can give me to look this up?
    Thanks for all your hard work! It has been more than helpful
    I Dare Publications

  • Serena

    Simon, I have no excuses let’s just say I get limited sleep and work my rear off. Anyway I found the hyperlink after I left you a message it seem that working 16 hours and then searching the web for a hyperlink to use in sublime text do not go hand in hand. I tried again after I left my first message because well I am woman here me roar. I can do anything. Please do not quote me on that. Anyway sleep helps! I found it, used it and turned my whole e-book into one big hyperlink! LOL. Anyway I know how that you really have to use both quotation marks. My hyperlinks wors perfectly now and well I am proud of myself. Refer back the I am woman…
    I dare Publications

    • SimonRSP

      Hi Serena, I’m glad you got that sorted, and thanks for posting back here and saving me time going off the research the solution :). Congrats on getting your book neatly formatted :).

  • Another great resource, Simon. I’ve discovered a great tip when using Calibre. Sometimes Mobi files on Calibre are a pain (eg Table of contents issues). However, if you convert your file into an Epub first, Calibre allows you to edit the Epup (it won’t let you do it for Mobi). So, make any changes you want to the Epub file then convert that Epub file to a Mobi file.

    • SimonRSP

      Thanks Deborah. Yeah, you are right about them sometimes being a pain ;). Thanks for the tip.