July 22, 2010

Converting to epub for Apple's iBookstore

Two of my books are now available in Apple's iBookstore in electronic format, with the third one `pending', i.e. ready for sale soon. (And my first sales have taken place too.) As an independent author, I chose to publish and submit the books directly rather than through one of the approved Apple iBookstore aggregators, a. because I could and b. because it saves a boatload of money. 

Getting set up as a content provider and getting your ebook into the iBookstore is all relatively straightforward. You do need a Mac, of which there's one in our household though I do most of my work on an Acer Travelmate laptop I've had since 2004.

Since I have an iPod, I already had an iTunes account which is needed to become a content provider in the iBookstore. That all went pretty smooth. I filled out the information about my books, titles, ISBNs, and soon I was given my login for https://itunesconnect.apple.com

For me the most challenging and time-consuming part was figuring out how to convert my books (in Word documents) to the required epub format for the iBookstore. It took me days, which is why I am writing this post so it may save you some time. (Note: the chapter structure of my books is very straightforward, chapters 1 through X. My books also do not have any graphics or tables.)

If you have written more than one book, I suggest you begin with the one that has the lowest number of chapters. I first converted my book Powered From Within: Stories About Running and Triathlon because it has only 13 chapters, compared with 54 for Running Shoes Are a Girl’s Best Friend and 33 for A Work in Progress: Exercises in Writing.

First, create a new folder (with Windows Explorer) on your computer for the process I am about to describe. I created a sub-folder in the main folder for my book Powered From Within and called it Powered From Within EPUB. If you have a jpeg file of your book's cover, copy and paste it in this new folder. All we want to have in this folder are the plain text files we are going to create below and the book's cover image. Nothing else.  

Now open up the text document of your book, mine was in Word. Then open up a plain text writer such as Notepad. You need to chop your book into separate plain text files. Start with the front matter of your book—i.e. title page, bibliography, copyright page, dedication, acknowledgments, introduction, etc. You can, but do not need to, do this for the (Table of) Contents page. In fact, it worked better for me when I didn't (as I found by the time I reformatted my third book).

Each page needs to be a separate document, so cut and paste the title page from your, say, Word file to Notepad and save as FILE NAME Title Page 1 in that new folder you created (in my case it is called Powered From Within EPUB), SAVE AS TYPE, Text Documents .(txt) and ENCODING UTF-8.

Make sure you save each page with the encoding UTF-8.

I numbered the file names of the front matter to make it easy to rearrange the order later. For example, the second page in my books is the bibliography, so I cut that page from Word to Notepad and saved as FILENAME Bibliography 2 (again make sure you choose encoding UTF-8). 

This process is a little tedious but goes quite quickly. Once you are finished with the front matter, do the  chapters. You must cut, paste and save each chapter as a separate document. You can save them as FILENAME CHAPTER 1, CHAPTER 2, etc. Whatever is on the first line of each Notepad (or plain text) document will be included in the Table of Contents - though we will be able to adjust that later.

After this process you should have a list of plain text files in your dedicated EPUB folder, (mine is called Powered From Within EPUB) that reflects the table of contents of your book.

Now it is time to download free software (you can donate). Start with downloading eCub, here.
After you've downloaded the version for your computer, open up eCub and choose New Project. Fill out the details of your book (Title, Identifier for which I use the ebook’s dedicated ISBN number (different from the paperback version), Author) in the respective fields. Then you go to the Next Page.

Here I leave the file name as suggested, in my case PoweredFromWithinStoriesAboutRunningTriathlon, and Browse for the project file folder - the one you have saved all the plain text files in (in my case Powered From Within EPUB). I just want to make an epub file (not mobipocket) and click Next.

At the Choose Import Method I select the first option From existing text of HTML files in the project file folder. Click Next. On the Convert text files page, I leave the options as suggested and click Next. On the page Content I see all the files from my project folder and leave them all checked EXCEPT the jpg file of my book’s cover. Click Next.

For the Cover Design I use an existing file that should automatically show the jpg file I copied and pasted into my project folder. (I will not use it for the iBookstore since they ask for a separate file for the cover but at this point you must choose something). Click Finish.

eCub generates your book’s file and you see them in the order they will appear on the left hand side of the screen. The order of the files will probably need rearranging which is very easy to do (especially if you've numbered the plain text files in the file names, as suggested). Put your cursor on the file and then click the up and down arrows in the area just underneath the file list to move each file up or down.

Once you have arranged the files in the correct order, click on each one (starting at the top and working my way down to the bottom) and add the Guide Type in the bottom left corner by choosing the correct type, starting with Title Page, Bibliography, Copyright Page, Acknowledgements, and Preface for your Introduction. All the chapters are Text.

Now that's done, hit Compile in the top toolbar and your epub file is created.

Time to download another free software program, called Sigil which will allow us to make some simple changes, including to the layout of our epub file. To download Sigil, go here.Once downloaded, open the program and your new epub file that you generated through eCub.

You can use Sigil to make some basic changes by clicking on each page and/or chapter and then saving after you’ve edited it. Changes include removing pages and/or chapters. I removed the CoverPage for example. If you do too, ALSO go to the Images files (near the bottom) to remove the image jpeg file there. eCub asks you to give your document a cover but the iBookstore will do this separately.

You can make simple changes to the layout, centering text for example, or moving text around etc.

Make sure to save the changes and now your ePub file should be ready, including for uploading it through iTunes Producer! I hope that this post has helped to save time. If you have any questions, please feel free to ask and I will try to help if I can.


das rot said...

i try to create a sub-title/chapter description to each chapter in table of content of eCub.
is that possible??

Margreet Dietz said...

That's a good question. Have you tried doing that in Sigil already?

das rot said...

no - not yet...thanks for the tip