In this post, we’ll do the unthinkable! We’re gonna take that huge interior file you created in Part 2 and Part 3 of this series and convert it into an eBook. All by ourselves! Did you know that the base programming language of all eBooks is HTML? Yup, the same stuff used to build websites like this blog you’re reading. But fret not! Website creation may be difficult and stress-inducing, but when it comes to creating your eBook, it’s gonna be a breeze.

Prerequisites

Calibre is by far the best eBook creation software available free of charge. Even if you don’t know the HTML necessary to compile the interior, the necessary coding is super simple to pick up. Calibre handles the metadata, conversion and stitching together of the final book. All you have to do is tell it what to do. So let’s get started!

Importing the Interior File

  1. Open your interior file in your word processor. Save it as a”WebPage” or anything with a .html or .htm extension. The interior file must be in HTML to be convertible and editable by Calibre.

    Save as a WebPage

    Save as a WebPage

  2. Open Calibre. You may be asked to update Calibre, especially if you installed the program more than a month ago. Go ahead an update it before moving on to the next step if prompted.
  3. Once in Calibre, click the Add Books Icon and open the HTM version of the interior file you just saved. AddBooks
  4. Ensure your book is selected and click the Edit Metadata icon. EditMetadata
  5. Edit the metadata of your book, including the cover. When finished, click OK.

    The Metadata (identifying information) of your Book

    The Metadata (identifying information) of your Book

  6. Back in the Calibre main window, select your novel and click the Convert icon. ConvertBooks
  7. Choose the export format as EPUB and leave the rest of the options as is. Honestly, they’re confusing and it’s just easier to edit the HTML source. Click OK when you’re done.

    Convert to EPUB

    Convert to EPUB

  8. Now it’s time to edit the EPUB. Right-click on the book and choose Edit Book.

    Edit your Book

    Edit your Book

 

Scary eBook Coding. Ooooh

No really, HTML is the most basic of programming languages. It’s what the internet runs off of, so it makes sense that your eBook will run off of the same language. There’s nothing scary about it! scared_colbert

The first thing we’re going to do is a little house keeping. If you’ve organized your interior file well enough with a Table of Contents and proper section breaks and Headings, this should be a walk in the park with very little code-monkeying-around. But if you’ve missed something or need to tweek, then this section will help you make those tweeks.

Instead of trying to walk your through this process step by step, I’ll give you the tools you need to do the most basic fixes, and you will use your best judgement as to what needs to be done.

Renaming the eBook part files

When you convert your interior file to an EPUB, Calibre will break the file apart by section break and headings into part files. It can be difficult to determine which part file you are in when making changes. I recommend renaming the part files to something more recognizable, like chapter numbers.

Keep in mind that each chapter should be contained in at least one part file, as you will need the chapters separated in order to create a table of contents. If you need to break apart the part files, I’ll show you how to do that a little later. For now, you first need to get your book organized.

To rename the part files:

  1. Right click on an eBook part file and choose “Rename” to rename it.

    Rename a part file

    Rename a part file

  2. Ensure the “.htm” remains at the end of the file name when you rename it or Calibre cannot use it.
  3. Rename each of the files in your EPUB before moving on. This will make the next steps easier.

Breaking a File into Multiple Files

Calibre will also try to out-smart you and break your interior file into part files using its own dastardly means. This can often lead to chapters broken apart too many times, or not enough times. To break a file apart:

  1. Determine how many files you need to break the file into. In my case, my single file needs to be broken into 3 separate files.
  2. Create a new file in your part list by clicking the “New File” icon. Name the file, ensuring you add the “.htm” to the end of your file name.

    Create a new part file

    Create a new part file

  3. The new file will be added at the end of your part list. Drag-and-drop it into the part list where you want the file to be. Sequencing is important as this is the order in which the files will be compiled into the final eBook.
  4. Copy the style sheets from the source file into the new file in the same location.

    Copy stylesheets

    Copy stylesheets

  5. Now, we need to move the book code from the old file into the new file. To find where the code begins, double-click on the first word or icon in the preview pane of the section you want to move. Calibre will highlight the corresponding book code for you.

    Calibre highlights the starting point in yellow

    Calibre highlights the starting point in yellow

  6. Using that as the starting point, select the text you wish to move to the new file. Ensure the last html tag you select is a </p> tag.

    Find the last tag

    Find the last tag

  7. Cut this text from the source file (Ctrl+X) and paste it between the <body> tags in the new file (Ctrl+V).

    Paste!

    Paste!

  8. Repeat for each file as necessary.
  9. You may be tempted to move on to the Table of Contents at this point, but hold that thought. Instead, go through all files in your part list: you should have at least one file for each chapter and each section, such as appendices and author bio’s. Finish up this task before moving on to the Table of Contents.

Table of Contents

Formatting a TOC in an eBook with page numbers is a mess. The great thing about eBooks is that you can turn your Table of Contents into a huge list of links. This makes it easy for your readers to move between chapters without having to swipe through the book.

Yuck!

Yuck!

There are two types of TOC’s in Calibre: one is the native TOC (a TOCcreated electronically by Calibre) and an embeded TOC (a physical page in the eBook). I’ll run you through how to create both of them.

Native TOC

  1. Open the Table of Contents editor.

    TOC Editor

    TOC Editor

  2. If you’re missing an item in your TOC, click on “Create New Entry”.

    Add an Item

    Add an Item

  3. Choose the file where you want your TOC entry to point and give it a name.TOC3
  4. Continue this process to build your TOC.

Embeded TOC

  1. If you haven’t done so already, create a part file for the TOC.

    TOC part file

    TOC part file

  2. If the TOC is not created, add the listing of chapters and book sections to the part file.
  3. For each item in the TOC, surround the text of the chapter with anchor links as such:
    <a href=”filename.html“>Chapter Text</a>

    Adding an anchor link

    Adding an anchor link

  4. Continue for each item in your TOC

Pretty up the code

Calibre has several tools to help you check for unused images, styles and other files. This helps ‘beautify’ the files (yes, beautify is a word) and makes them perform quicker for the user. This also reduced the errors that may be encountered in your eBook.

  1. Remove unused styles, fix HTM and pretty up the book by running each of these tools from the Tools menu. This will help you clean up the EPUB and make it less prone to errors in parsing by Amazon and Kindle.

    See? Beautify is a word!

    See? Beautify is a word!

  2. Next, from the tools menu, click on ‘Check Book’ to check the code for errors.CheckBook
  3. This will show you unused files and any glaring errors in the book which may make it not function properly in eBook readers. You can ignore CSS Property errors, but I would suggest deleting any unused image files as you have a file limit when uploading to Kindle Direct Publishing.

    Errors in my Book

    Errors in my Book

Minor Tweeks

Sometimes you just need to do some minor editing, such as centering text or creating a link to your website. Here are some quick how-to’s

Centering Text

Surround the text you want to centre with the tags <center> </center>

Adding a Website Link

Surround the text you want to set as the clickable link with <a href=”WebsiteURLGoesHere”>Link Text Goes Here < /a>

Saving the EPUB

Now that you’ve edited your eBook, it’s time to save it so you can upload it to Amazon! To save the EPUB:

  1. In Calibre, choose File –> Save a Copy and save your EPUB. We will use this file in the next post when we finally finish the publishing process and publish our book on Amazon!

    Save the EPUB

    Save the EPUB

In the Next Post . . .

It’s here! The final step of the publishing process! In the next post, we’ll take the EPUB we just created, plug it into Amazon and rule the world! Mwa-ha-ha! And maybe we’ll publish a book along the way.DrEvil1