My eBook eXperience -- part four of many
Warning -- this is the most technical entry of the series. I'm mostly putting in all the nerdy details so the next person who runs into one of these problems can find an easy solution.
Second warning -- it took a long time to write this up, and I have other work to do, so I am going to let the typos remain unfixed. (I'm a messy typist.)
To recap, I made a Kindle version of my book, loading a Word doc into Open Office, writing it out as html, and running it through Mobipocket Creator. Now, I wanted to make an ePub version. A bit of surfing revealed that most people did this by means of a pair of programs. Calibre converts files from one eBook fomrat to another. It has a lot of power and a lot of conversion options. Sigil is an editor specifically for ePub files. I loaded my prc file into Calibre. Set it to convert from prc to ePub. (At the top, make sure it is set for PRC as input and EBPU as output.On the PAGE SETUP page, make sure input is Kindle and output is Nook.) I'm going to jump ahead of myself and mention one other thing for the conversion. On the EPUB OUTPUT page, uncheck "Preserve cover aspect ratio." If you don't do this, you might get an epubcheck error.
I wrote out the ePub version. (Right click the book on the main page, select "save to disk" then select "save single format" then select EPUB.) Now, I had a file I could load into Sigil. And this is where I was able to get rid of the bullets in my table of contents (TOC). At the bottom of the list of files in Sigil, there's a folder for styles, containing the file "stylesheet.css." If you have an unordered list, replace the word "disc" and the word "circle" with "none." (They occur in the lines "list-style-type: circle;" and list-style-type: disc;.") Those are the commands that put the bullets into the list. (This doesn't work on the Kindle.)
Okay, my ePub file is almost finished. But I had a huge TOC. This isn't a problem in the book itself. But I didn't want it in the TOC that pops up from the Nook menu. Happily, Sigil lets you select which items you want to appear in that TOC. I made those changes. Now, there was just one last piece of software to deal with. ePubcheck is a program that makes sure the file doesn't have any errors. (Sigil, itself, scans for this, but Barnes and Noble specifically wanted the file to pass ePubcheck.) You can run the check online, but they encourage people who will be using it repeatedly to download it. Which gets us to the last really techie part of this.
ePubcheck is a Java program. To run it, you have to add it to your system path. But I was lazy, so I took a different approach. Here's what I did. I extracted the ePubcheck files to a directory. Let's call it "estuff." I also put my ePub file in that directory. Then I opened up Wordpad and wrote the following two lines:
cd\c:\program files\java\jre6\bin
java -jar c:\estuff\epubcheck-1.2.jar c:\estuff\mybook.epub
I saved this file as "epc.bat" in the directory c:\windows\system32
Now, from the DOS command prompt, I just had to type "epc" and the batch file would run epubcheck on "mybook.epub."
There are lots of other ways to do this. (For example, instead of sticking the ePub file name into the batch file as mybook.epub, I could have called it %1.epub, which would have allowed me to pass the name from the command line as "epc mybook") But I was being lazy.
I was surprised to get ten errors. But eight of them were for the same problem. Since others might have some of these problems, let me list them, and the solutions.
The error "Value of attribute 'PreserveAspectRatio' is invalid" was fixed by unchecking Calibre's "preserve aspect ratio" box. The line created by Calibre when this box is checked seems valid, so the problem might be with ePubcheck.
The error "attribute 'type'" not allowed here, came from a line that included "type='FOOTER'." Tracking back to the html created by Open Office, I saw it had put an empty footer section at the end of the file. I deleted this in the html.
Now, for the last error. "element 'ul' not allowed here." It popped up 8 times, giving me a huge clue. My TOC had 8 major sections. I looked in Sigil at the file containing the html for my TOC. For some reason, Calibre added the line (with brackets):
li style="list-style: none; display: inline"
before each of the nested "ul" parts. This is what ePubcheck didn't like, though it didn't seem to casue a problem. I removed that line wherever it occurred, along with the matching "/li" at the end of each section. That fixed things.
So, now I had a viable ePub file. I figured I'd put up the Kindle and Nook files, and the get to work on the Smashwords format while the money rolled in. But first, I needed a cover. I'll cover that tomorrow.
Second warning -- it took a long time to write this up, and I have other work to do, so I am going to let the typos remain unfixed. (I'm a messy typist.)
To recap, I made a Kindle version of my book, loading a Word doc into Open Office, writing it out as html, and running it through Mobipocket Creator. Now, I wanted to make an ePub version. A bit of surfing revealed that most people did this by means of a pair of programs. Calibre converts files from one eBook fomrat to another. It has a lot of power and a lot of conversion options. Sigil is an editor specifically for ePub files. I loaded my prc file into Calibre. Set it to convert from prc to ePub. (At the top, make sure it is set for PRC as input and EBPU as output.On the PAGE SETUP page, make sure input is Kindle and output is Nook.) I'm going to jump ahead of myself and mention one other thing for the conversion. On the EPUB OUTPUT page, uncheck "Preserve cover aspect ratio." If you don't do this, you might get an epubcheck error.
I wrote out the ePub version. (Right click the book on the main page, select "save to disk" then select "save single format" then select EPUB.) Now, I had a file I could load into Sigil. And this is where I was able to get rid of the bullets in my table of contents (TOC). At the bottom of the list of files in Sigil, there's a folder for styles, containing the file "stylesheet.css." If you have an unordered list, replace the word "disc" and the word "circle" with "none." (They occur in the lines "list-style-type: circle;" and list-style-type: disc;.") Those are the commands that put the bullets into the list. (This doesn't work on the Kindle.)
Okay, my ePub file is almost finished. But I had a huge TOC. This isn't a problem in the book itself. But I didn't want it in the TOC that pops up from the Nook menu. Happily, Sigil lets you select which items you want to appear in that TOC. I made those changes. Now, there was just one last piece of software to deal with. ePubcheck is a program that makes sure the file doesn't have any errors. (Sigil, itself, scans for this, but Barnes and Noble specifically wanted the file to pass ePubcheck.) You can run the check online, but they encourage people who will be using it repeatedly to download it. Which gets us to the last really techie part of this.
ePubcheck is a Java program. To run it, you have to add it to your system path. But I was lazy, so I took a different approach. Here's what I did. I extracted the ePubcheck files to a directory. Let's call it "estuff." I also put my ePub file in that directory. Then I opened up Wordpad and wrote the following two lines:
cd\c:\program files\java\jre6\bin
java -jar c:\estuff\epubcheck-1.2.jar c:\estuff\mybook.epub
I saved this file as "epc.bat" in the directory c:\windows\system32
Now, from the DOS command prompt, I just had to type "epc" and the batch file would run epubcheck on "mybook.epub."
There are lots of other ways to do this. (For example, instead of sticking the ePub file name into the batch file as mybook.epub, I could have called it %1.epub, which would have allowed me to pass the name from the command line as "epc mybook") But I was being lazy.
I was surprised to get ten errors. But eight of them were for the same problem. Since others might have some of these problems, let me list them, and the solutions.
The error "Value of attribute 'PreserveAspectRatio' is invalid" was fixed by unchecking Calibre's "preserve aspect ratio" box. The line created by Calibre when this box is checked seems valid, so the problem might be with ePubcheck.
The error "attribute 'type'" not allowed here, came from a line that included "type='FOOTER'." Tracking back to the html created by Open Office, I saw it had put an empty footer section at the end of the file. I deleted this in the html.
Now, for the last error. "element 'ul' not allowed here." It popped up 8 times, giving me a huge clue. My TOC had 8 major sections. I looked in Sigil at the file containing the html for my TOC. For some reason, Calibre added the line (with brackets):
li style="list-style: none; display: inline"
before each of the nested "ul" parts. This is what ePubcheck didn't like, though it didn't seem to casue a problem. I removed that line wherever it occurred, along with the matching "/li" at the end of each section. That fixed things.
So, now I had a viable ePub file. I figured I'd put up the Kindle and Nook files, and the get to work on the Smashwords format while the money rolled in. But first, I needed a cover. I'll cover that tomorrow.

Published on November 10, 2011 07:08
No comments have been added yet.
David Lubar's Blog
- David Lubar's profile
- 244 followers
David Lubar isn't a Goodreads Author
(yet),
but they
do have a blog,
so here are some recent posts imported from
their feed.
