Making Your Own Ebooks

This is one of those posts where I describe something obscenely complex that I did with my computer. The reason I want to post it is so I can find the description after I've totally forgotten the details in six months. Computer knowledge has such a short half-life.


As I often do, I'll be using photo illos with absolutely no connection to the subject at hand. I took these photos at Nick Herbert's house in Boulder Creek, on a dude ranch in Wyoming, and in the park at Wilder Ranch in Santa Cruz.



Tools

So suppose I have a document and I want to make it into a EPUB-formatted ebook.


Tools I'm going to mention: Microsoft Word, Adobe Dreamweaver, the free Calibre ebook software, the free Sigil epub software, and the free Epubcheck software.


Certainly you can use text editors other than Word. But I own a copy and am very accustomed to it. Again, I use Dreamweaver because I happen to own a copy. I'm not knowledgeable enough to recommend others, probably there are some decent free ones out there.


For a DOC with no images, you save the DOC as an RTF then go direct from RTF to EPUB with Calibre, and then tweak the resulting EPUB with Sigil.


For purposes of EPUB conversion of a DOC with images, I need to use a more complicated workflow.


For files with images, I convert from Word DOC to HTML to EPUB, using Dreamweaver to get from DOC to HTML and using Sigil to get from HTML to EPUB. Calibre doesn't come into the picture here.



Setup

I make a directory for my project and put my Word document in there. It's important at this point to format all of your chapter or section headings with a Header style such as Header 1, Header 2, etc. The EPUB file is going to want to make a table of contents, and it will build them by finding Header-formatted lines.


Regarding the images you want to include, even if you inserted them into your Word DOC from somewhere else on your hard drive, put copies of all the images that in a subdirectory of your project directory and name the subdirectory Images. Use some photo editing software to adjust the sizes of these images not to be more than, say, 800 pixels across, and you can even get by with 600 pixels.



Converting DOC directly to EPUB

The free EPUB software Calibre will convert a DOC into an EPUB file very easily. It's kind of a no-brainer.


First save your DOC file into the non-proprietary RTF format. Word will do this. And of course any other word-processor will make RTF files as well.


Use the Add Books button in Calibre to add the RTF file. Then click the Convert Books button to convert to EPUB. The conversion process shows you a dialog box where you can fill in Title and Author, also you can get a cover image onto the clipboard and right click on the cover area to paste it in. And then a little symbol spins at the lower right of the screen for a minute or two. And then it's done.


You can click on the EPUB word beneath the name of your book to check it out. And you can save the EPUB wherever you want. Be sure to save your EPUB file with a name that has no spaces in it, or there may be trouble later on.


Downside: if your original DOC, and the RTF, had images in them, the images probably aren't going to be present in your Calibre-made EPUB.


Even you don't have images, there probably will be some catches and error messages if you try and distribute this quick and easy EPUB, like to your iPhone. Generally you need to load the EPUB from Calibre into Sigil to do some tweaks, such as fixing the table of contents and set-ting the Title, Author, and Language fields. Jump down to the "Tweaking in Sigil" section below.



Converting DOC to HTML

Usually I turn Word documents into HTML by opening the Word doc, selecting everything in it, copying that to the clipboard, and pasting the clipboard contents into the Design area of an empty HTML file in Dreamweaver.


If I have a lot of images in my document, this isn't a good approach—because Dreamweaver will make crummy little clip-art copies of the images that are linked into the document. I'd like to have more control over my images.


So, still in Word, I save the Word file as a "filtered HTML" file. Filtered means there's less Word crap in the file. And I open this file in Dreamweaver and use Commands | Clean Up Word HTML… to get rid of more Word crap. When I save the "Filtered HTML" file, Word makes a directory of extra files in my directory, but there's actually nothing in that directory that matters, and you can delete it.


Either way, I've now got an HTML of the file that I want to make into an EPUB.



Tweaking the HTML.

While you're in HTML, look at the image links, and make sure they all point to file-names to the Images subdirectory that you made. You may need to use the Edit | Find and Replace dialog to get things set.


It's better not have the size of the images hardcoded. That way you're free to force in larger images if you want. Use the Edit | Find and Replace dialog and for the Search: field select Specific Tag and set to img, then for the Action: field select Remove Attribute and set to width. Then do the same for height. Then do the same for border.


Fill in the Title field for your HTML. Delete the body attributes link and vlink, but if you don't, you can later get rid of these in Sigil.


Don't use any font larger than about 18 points for titles or sections, or it'll look too big on a smartphone.


It's nice to have separators between your sections. Up at the top of your HTML file, inside the style block of definitions, add this line

hr {page-break-after:always;}


And then, wherever you want a break in your document, insert the symbol < then the letters hr then the symbol >, and you get a nice looking line like below, which plays the role of a page break. I can't write out what you actually put, because then you just get the pagebreak line!




Tweaking HTML and EPUB in Sigil



So now you've made an HTML file with Dreamweaver or perhaps you've made an EPUB file with Calibre. Open the HTML or EPUB file in Sigil. As soon as you open you file in Sigil, it's converted into an EPUB file that you can save and distribute. But first do some tweaks.


Use the menu item View to put check marks on Book Browser and Table of Contents.

The Book Browser shows all the different components that are hidden inside your EPUB file.


The Table of Contents window should show a Table of Contents. You can create a Table of Con-tents by clicking Generate TOC from Headings, and then clicking OK in the Heading Selector. You can see if it worked by double clicking on some of the items in the Table of Contents box.


Use the menu item Tools|MetaEditor… to fill in names for the Title, Author, and Language of your EPUB file.


For the cover of your Ebook, use an external photo editor to create a cover.jpg file which is 612 pixels wide and 792 pixels high. It should include your name and the title of the book. Save it in somewhere in your project directory, perhaps in the Images subdirectory. In Sigil use Insert|Image to insert this image at the very start of your EPUB document.


In the Book Browser window in the left hand side of your Sigil window, find the Images directory and look for contents.jpg in there. Right click on it, select Add Semantics, and check Cover Image.


Now before you save and distribute your EPUB, use the Sigil Tools|Validate EPUB selec-tion to see if you get errors. If you click on the error messages, you'll see source code for the EPUB where you can try and correct the problem.


As with Calibre, be sure to save your EPUB file with a name with no spaces.



Validating with Epubcheck.

Install the Epubcheck ware on your computer, it probably ends up in Program Files\Epubcheck. Make a sample subdirectory of the Epubcheck directory and put a copy of your current EPUB file there. Suppose it's called betterworlds.epub.


Then go to the Command Line interface for your computer, navigate into the directory where epubcheck lives, like to Program Files\Epubcheck. Now run a command like this:

java -jar epubcheck-3.0b2.jar sample/betterworlds1.epub


Of course the letters and numbers after epubcheck depend on which version of the software you have. And the name of the epub file depends on what file you're checking.


If all goes well, epubcheck will either print a "No Errors Found" message, or it will spew out a lot of error messages. You can scroll up and down to see them all. Most common causes of errors are (1) you forgot to build a table of contents using the Sigil Table of Contents window, or (2) you didn't fill in the Name, Title and Language fields using Sigil Metatool, or (3) the Epub ware is confused because you gave your epub file a name with spaces in it. If you see an error you can't understand, try copying into the Google search bar to see what other people say about it.



Publish on Lulu?

Once you've got your EPUB file looking pretty good, you can publish it online in some form or another. Right now, one of the easiest ways to do this is via Lulu, although eventually I may try and figure out how to start selling ebooks and print-on-demand books myself.


Check out my two newly made EPUB ebooks, $1.99 each on Lulu:

Rudy Rucker, Better Worlds (Ebook)

Terry Bisson and Rudy Rucker, Billy's Picture Book.


Share

 •  0 comments  •  flag
Share on Twitter
Published on September 23, 2011 14:11
No comments have been added yet.


Rudy Rucker's Blog

Rudy Rucker
Rudy Rucker isn't a Goodreads Author (yet), but they do have a blog, so here are some recent posts imported from their feed.
Follow Rudy Rucker's blog with rss.