Click covers for info. Copyright (C) Rudy Rucker 2021.


Archive for the ‘Rudy’s Blog’ Category

How to Make Ebooks #3. Calibre, Sigil, and HTML

Thursday, May 3rd, 2012

Start Playing With Calibre
I worked as a professor of computer science at San Jose State for about twenty years. I often taught software engineering classes in which I’d have my students carry out large programming projects. I liked to break the class into small teams and have each group create a videogame. One of the principles I tried to teach was this: “Don’t worry too much about making mistakes. To learn software engineering, you have to try things out and make a lot of mistakes. The trick is learning how to make mistakes faster.”

When you’re testing out ways to make your document into an attractive EPUB and MOBI ebook, you’ll need to try out a number of options and you’ll make a bunch of mistakes. But you don’t want to keep trashing whatever progress you’ve made. So you need to set up a directory structure that gives you both an archive and an area in which to play.

Suppose your book is called Mybook. So you’ve got a directory called Mybook with, let’s say, your Mybook.doc file in it. Make a subdirectory called DOCS and copy Mybook.doc into there, only change the file name to something like Mybook_april_29_2012.doc, so it’s easy to tell which version it is. Now make a subdirectory called PLAYPEN and save a Rich Text Format Mybook.rtf into PLAYPEN.

And now fire up Calibre. Before going any further you might as well tweak the Calibre Preferences to make the program easier to use. Be default, the Preferences icon is off to the right of the toolbar, you need to click a little double arrow to see it. Open the Preferences go to Interface | Toolbar | Main Toolbar and get rid of most of the toolbar icons. It’s confusing to have so many. You need to keep Add Books, Edit Metadata, Convert Books, View, Help, Save to Disk, and Preferences.

Now, use the Preferences Import/Export | Save to Disk dialog to simplify how your converted ebooks are shared. Turn off all the checkboxes except for “Show files in browser after saving to disk” and change the Save Template’s Template Editor field to just say {title}. So now if you make an EPUB and save it, it’ll show up as a single file in the directory where you pick to save it, and not in some weird subdirectory.

Okay, now let’s retrace some of the steps I described in How to Make Ebooks #2. Simpler Paths—and then go a bit further. Use the Calibre Add Books button to add your Mybook.rtf as a project. Then try setting some Metadata fields for your ebook with the Metadata dialog. And then click on the Convert Options button, select EPUB as the output as described in my earlier section, tweak some of the settings, close the Convert Options, let Calibre whirl a symbol in the lower right of the window until it’s built an EPUB.

Click on the “EPUB” word in the right window of the Calibre screen and Calibre opens a viewer where you can see how your EPUB looks. If you don’t like what you see, try changing some of the settings in the Convert Books dialog and rebuilding the EPUB. Maybe cycle through this a few times.

Controlling Your Format With Sigil

Some things you might not be able to change within Calibre alone. And the Calibre viewer is going to be deceptive about some things—in particular it will make it look as if your EPUB is formatted in a nice serif font (like Georgia or Times), when in fact the EPUB will show up in a less readable (in my opinion) sans-serif font (like Arial) in other ereaders. By default, Calibre doesn’t in fact specify the font style of your book at all, and it will be up the whim of the individual ereading device or program to pick the style. In some ereaders, the user can pick the font, but in some, the author needs to specify the font themselves.

So now let’s find out how to control the font, the spacing between paragraphs, and the size of the paragraph indents.

Use the Save to Disk option to save the MyBook.EPUB into your PLAYPEN directory. Maybe try viewing the EPUB in some other ereaders to see how it looks in them. And then open it up in Sigil to see if you can tweak the format.

As I mentioned before, Calibre will have shattered your text into a number of small XHTML files, typically it makes one such file for each hard page break in your document, which is why it’s a good idea to put these breaks into your original document—so as to tell Calibre where you’d like the breaks. If you don’t have hard page breaks, Calibre may split the document at the Heading 1 formatted lines.

It’s fine if your book is split into a bunch of little XHTML files. The reason for this is, as I also mentioned earlier, so that ereaders can rapidly open successive chapters of the book without having to load the entire document into memory.

Click on one of the text-filled XHTML sections of your book, visible in the Text section of the Book Browser window on the left side of the Sigils screen. A view of the file opens in the center window. Sigil lets you view it in “book view,” in “code view,” or in a “split view” with both.

Take a look at the code in particular. It’s somewhat ungainly HTML that was automatically generated by algorithms within the Calibre program. You’ll see cryptically named styles like calibre4 or s2. The styles appear in CSS-style class statements such as <div class=”s2″> or <p class=”calibre4″> or <span class=”none2″> .

The HTML div and span tags are container tags simply used to apply class styles to whatever is inside them. You use span for just a few words and you can use div to hold several paragraphs. I dislike div and span, I think they’re ugly and confusing and they suck and I try never to use them in my HTML code.

In any case, the p tag is a good, honest tag with a real meaning. It’s used to mark a paragraph. And even if the p is inside a div, the class assigned to the p takes precedence over any class properties assigned to the div. So lets not worry about any crappy div or, for that matter, the span tags.

Looking into your book’s XHTML files you’ll probably find that most or all of your text paragraphs have the same class applied to them, that is, each paragraph has a form like:

<p class=”calibre4″>Blah blah …. blah. </p>

Of course it might specifically be calibre4, it might be some other name that Calibre generated. But, just for the sake of discussion, I’ll keep saying calibre4. In this case, the definition of the calibre4 style is a key control-point for you.

That is, if you want to tweak the appearance of your text, you want to look at changing the calibre4 style.

Looking through your XHTML files some more, you’ll also find that the Word Heading 1 styles have become h1 in HTML, all of your chapter titles have a single style class to them, perhaps a class called something like calibre2. So a chapter title looks something like the following (possibly with a superfluous unnecessary span tag robotically nested in there).

<h1 class=”calibre2″> Chapter Seven </h1>

So let’s talk about how we can do some quick tweaks to the these kinds of style class attributes like what we’re calling calibre4 and calibre2 in order to make the text and the chapter titles of your ebook to look the way you want.

Font Family, Paragraph Spacing, and Paragraph Indent

Where do the Calibre-defined styles live?

Look at the Sigil Book Browser window again. Under the Styles heading is a file called stylesheet.css. Double click and it opens in a code window-sheet in the central window. Scroll through it, noticing all the weird random style names. (The names appear with a . in front of them when defined in a CSS stylesheet file, but when they’re used over in the XHTML or HTML file, you don’t have the . in front.)

Find the styles that seem to be attached to your paragraphs and your headers in your XHTML files, the styles that I’ve been calling, just to call them something, calibre4 and calibre2. Now try editing these styles in Sigil, and flip over to the pane showing the appearance of your text as the CSS styles change.

Keep in mind here, that Sigil is very responsive software, and whenever you change one component of your EPUB file, the changes immediately percolate out into all the other parts. The style changes are visible right away. And, on a different front, if you change one of XHTML file names, this name change is taken into account in the manifest OPF file and in the TOC table of contents file.

Okay, I’m getting tired of working this post so I’ll be brief here.

Some of the main style things you want to get control of in your text and headers are the following.

*The font family for text and for headers. Go with a serif font. You list fonts in so-called font stacks, and the reader picks the first if it can, then the second, then the third and so on. “serif” just means any old serif font.
font-family: Georgia, Times, serif;

*The font size for headers. The size is measured in “em” which means the default size of a letter m.
font-size: 1.5em;

*The skipped-line or no-skipped-line between paragraphs of text. For no skipped line use the following two lines saying not to skip space before or after your paragraph. If you want space, put in some number as an em value, like 0.5em or 0.75em, meaning to skip that big a percentage of the size of a letter.
margin-bottom: 0;
margin-top: 0;

*The size of the indent in the first line of a text paragraph. Put zero indents for a header style. The following is a good indent for text paragraphs. Again we measure in “em”.
text-indent: 1.75em;

*The alignment of your text or header (left or centered or justified). For headers you want left or centered, for text, justified is better, as it looks more natural in ereaders, and people expect it.
text-align: justify;

So fool with these in Sigil, flipping between your style.css pane and a pane showing your text, until you see what you like. Then Verify your epub file one more time and save it and it’s done.  As an example, you can look at my file rudyebookstyles.css of the style definitions I like to use.

On to How To Make an Ebook #4: Heavy HTML. My fourth 2012 post on these topics. How to roll your own HTML file without Calibre, and how to get better control over images you want to include.

How to Make Ebooks #2. The Simpler Paths.

Monday, April 23rd, 2012

[Note: I slightly revised this post in December, 2016.]

In my previous post, How to Make Ebooks #1: Getting Started, I talked about five levels of workflow for making your own ebooks, (1) Simplest Upload a DOC, (2) Simple Convert a DOC, (3) Medium HTML, (4) Advanced HTM, and (5) Pro InDesign. Today I’ll talk about the (1) Simplest Upload a DOC and (2) Simple Convert a DOC levels. Much of this material carries over to the other levels as well.

This is a lot of material for a blog post. Oh well. I’ll break it up with some photos. When I’m done with these posts, I’ll combine them into a single file with no illos, and make them into an ebook pamphlet How To Make An Ebook.

Cleaning Your Text File

I happen to use Microsoft Word, but these remarks should apply to other word processors as well. Before you start epublishing your book, you want to get it into a reasonable format. To start with, I do a series of Search and Replace All calls.

*Replace double spaces by single spaces—do this several times to squeeze out the triple and quadruple space.

*Make sure your word processor is set to use smart or curly quotes—if not, set it that way, then replace all quote marks by quote marks (they’ll become curly), and do the same for apostrophes.

*Replace all triple hyphens — by the em dash symbol. Then replace any double hyphens — by the em dash as well. In the same vein, replace any triple periods by the ellipsis symbol.

* Get rid of any tabs. In Word this means replacing ^t by nothing. Epub and Mobi won’t show tabs. If you want paragraph indents, change the paragraph format style to do this. An indent of 0.3 inches looks good in epub format—you tend to want a little less of an indent in an epub than you’d want in a normal text printout.

*While you’re at it, get rid of all skipped lines between paragraphs. In Word, this means replacing ^p^p with ^p. If you want skipped lines after paragraphs, the HTML can do that automatically at a later point. If you want to use skipped lines for section breaks, it’s probably better to replace them by a typographic symbol like “***”.

*Use a web-page friendly font. Remember that an Epub or a Mobi is bascially a compact website. I prefer serif fonts as opposed to start sans-serif fonts like Arial. Georgia is a good serif font that you will work for most ereaders.

*What about paragraph alignment: Left or Justified? You’re probably used to working with Left, as otherwise the text jumps around weirdly while you write. But generally Justified looks better on ereaders—it makes it easier to see the paragraph indents. It’s a design decision, and you can try it out both ways.

*You can try putting in page breaks after your title page, after your table of contents, and after each chapter. These may or may not stick to the format when you convert to Epub.

Keep in mind, by the way that you’ll probably want to to multiple builds of your Epub and Mobi, trying out different looks. So the design decisions you make at the start aren’t necessarily irreversible.

Internal Table of Contents.

You might as well autogenerate a TOC or table of contents in your word processor before loading your document to an Epub. The first, crucial step is to make sure that your chapter headings are formatted in what Word calls the Heading 1 style as opposed to a paragraph style. That way when your document is munged into an HTML on the way to becoming an Epub and Mobi, your chapter headers will get a native HTML style called h1.

Word and other processors let you insert an auto-generated TOC into your doc, based on the Heading styles. Typically, you only want the Heading 1 entries in the TOC, so it’s not too cluttered. Or if you have Heading 2 entries, you don’t want more than one or two per chapter.

Anyway, put a simple autogenerated TOC into the start of the word processor doc. And then—crucial step for later use, go to the line before the start of the Table of Contents and ask your word processor to add a so-called Bookmark (or Anchor) with the name “toc.” And then the Kindle reader can use that to find your TOC.

One more thing, the very first page of your document should be a title page, rather than the cover, and the title itself should be given the Heading 1 format. It seems dumb to have the book title in the Table of Contents, but that’s what iBooks wants.

Later we’ll learn that you don’t totally need the internal table of contents, as the Epub format generates its own TOC, and the Mobi can too, but it doesn’t hurt to throw the reader a frikkin’ bone in terms of finding their way around your book.

Cover

For the cover of your Ebook, use an external photo editor to create a cover.jpg file which is about 600 pixels by 800 pixels high. The cover obviously should show your name and the title of the book. Save it in your images mages subdirectory. In World use Insert | Picture to insert this image near the very start of your DOC. Format the paragraph holding the cover image as Left or Centered, rather than Justified.

If you have more images, you can insert them too, although we’ll have more to say about this.

As I mentioned before, the cover should be near the start, but the very first page of your document should be a title page.

If you want you can save a bigger version of your cover as well. When you upload to Amazon or B&N, they’ll as for a cover image, and you can upload the same one you use in the book or you can upload the bigger one.

Simplest of All: Upload a Doc. And Preview It.

Upload your DOC or RTF to Amazon KDP and, if you like, to NOOK. You’ll need to upload a cover image JPG file as well. And Amazon KDP will let you download the MOBI file and NOOK will let you download the EPUB. And then you can look at them.

And remember you can view the Mobi in the Kindle Previewer, which can be set to match various types of Kindles. One thing to remember about the Kindle Previewer is that its images look a little screwed-up on Windows if you’ve set your Display to make the screen text larger than the default 100%. You can temporarily rest your screen text to 100%, or you can download a Kindle app and view the Mobi in that instead.

For EPUB, here are some options:
*Multiplatform Desktop: Firefox EpubReader Add-on .
* Android: The FBReader and Aldiko apps are recommended.
* iPhone/iPad/Mac: The free iBooks app is one of very best ebook readers around.

You’ll probably notice that your Epub looks different in the different ereaders and the Mobi looks different in different kinds of Kindles. Kindle tends to put a large paragraph indent, doesn’t skip a line between paragraphs. Kindle Fire does no indent, skips a line between paragraphs. iPhone does a small indent if you asked for that, doesn’t skip a line. NOOK doesn’t resize images below a certain size. Etc.

There’s not a huge amount you can do about this, although I will talk about formatting in section #3 of these posts. Creating Ebooks is one of those “write once, debug everywhere” software things. Rather than going crazy over this, you need to accept a certain lack of control.

Make An EPUB and a MOBI with Calibre

Suppose you want to get a little further in. Let’s move from the simplest level to the simple level. Try building EPUB and MOBI on your own machine.

Save your document file into the RTF format. Then open Calibre, and use the Add Books button to add your RTF file. Click on the Convert Books button, set the output format in the upper right to EPUB, and fill in some of the info in the Convert Books dialog.

One thing you want to do is fill in some of the Metadata fields. If you have a cover graphic for your book you can add it now, it might as well be color. It can be 600 by 800 pixels, although certain sizes fit better with certain readers.

Looking down along the left margin of the Convert Books dialog you’ll see other subdialogs to play with. Look and Feel gives you some leeway, but not all that much—to really change your appearance you’ll need to take the Medium level workflow and play with some HTML. For now, you might as well leave Look and Feel at its default values.

The Page Setup subdialog is kind of important. The main thing it affects is whether or not Calibre is going to resize any images in your document. If you set Kindle for the output, it’ll crush the images down to about 500 pixels across. I like to change the Output profile to Tablet, which allows images to be up to 1000 pixels across without being resized. Default Input Profile is fine.

We’ll talk about the Table of Contents options below.

So now click the OK button at the bottom of the Convert Books dialog and whirl-whirl-whirl, a little graphic wheel turns at the lower right of the Calibre window and your RTF is converted to an Epub.

Now you can go back to Convert Books and set the Output to MOBI and make a MOBI too. Another way to get from EPUB to MOBI is to open the EPUB in the Kindle Previewer, it does a version as well.

You can preview your Epub and your Mobi by clicking on the file format name beneath the image of your book in the right side of the Calibre window. Note that the Calibre previewer doesn’t preserve the proportions of images like your cover, it distorts them as you change the viewer size—don’t worry about this, you won’t see this bad effect in other ereaders

And you can use the other previewers I mentioned above.

Examine and Verify the Epub with Sigil

Now try opening your Epub with the Sigil tool. Here we’re just opening but note that Sigil can open an HTML and convert it to Epub on the spot. But now just open your new Epub.

Use the Sigil menu item View to put check marks on Book Browser and Table of Contents so you see those windows.

The Book Browser shows all the different components that are hidden inside your EPUB file. Two special weird files are CONTENT.OPF and TOC.NCX. You can click on them to see what’s inside them…computer-code type text.

The other files are under headerings like Text, Images, and Styles. You will probably see quite a few HTML files in the Text section, or more properly they’ll be XHTML (almost the same as HTML). Not just one of them. Where did so many of them come from?

Well, the average ereader has limited computational resources, and it doesn’t like to bite off the whole big book at once. So Calibre, or any online “meatgrinder” conversion program such as the one used by Kindle — when converting your RTF to EPUB, they’ll break your document into a buttload of small XHTML files. That’s why you see so many of these files. By the way you can split up HTML files inside Sigil by hand, and we’ll discuss that later.

Also note that you’re free to rename some of the XHTML files if you want, and the changes will instant percolate out into the other parts of the EPUB build. Sigil is a smart and responsive program, and it constantly updates the whole EPUB to match any changes you make in any part.

The Sigil Table of Contents window should show a Table of Contents. If it’s not there, you can automatically create a Table of Contents 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.

If you didn’t format your book title as a header in Word, you can still do that here in Sigil. Select the title and use the drop-down menu on the upper left corner of the Sigil window and apply a format such as Heading1.

Use the menu item Tools | MetaEditor… to fill in names for the Title, Author, and Language of your EPUB file, if you didn’t do that before.

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…this helps the readers know where your cover is.

Now use the Sigil Tools | Validate EPUB selection to see if you get errors. If you click on the error messages, you’ll see source code for the HTML, showing where the error lies. Often you can get rid of many errors by asking Sigil to rebuild the Tabel of Contents.

For future reference, if you don’t understand a Sigil error message paste it into the Google search box. You can fix them in the HTML files that you see in Sigil, as it allows you to edit the component XHTML files. But I’ll talk about this later.

For now save the Epub. If you made any changes, add the new version to Calibre as a fresh book and generate a Mobi again. Or load the Epub into Kindle Previewer to get a Mobi.

The Mobi TOC Problem

On my first Epub and Mobi builds, the TOC, or Table of Contents, gave me a huge amount of trouble. The weird thing is, your ebook is going to have two tables of contents. One of them will be an ordinary table of contents that’s inside your text.

The other will be a hidden file called TOC.NCX that’s part of the Epub package.

You can see the TOC.NCX if you open your Epub file in Sigil, and you can ask Sigil to generate this TOC.NCX, which is often a good idea, in case the TOC.NCX hasn’t yet been properly filled out.

Regarding the in-text TOC, the easiest way to get one might be to let Calibre make one for you when you covert your Epub to Mobi. To tell Calibre to make a TOC at all, you need to open the Convert Books dialog, set Output to MOBI in the upper right corner, click on the Table of Contents icon on the left. I like to check the “Do not add detected Table of Contents” box, and put these six symbols into the Level 1 TOC (Path Expression) box:

//h:h1

And I leave the Level 2 TOC and Level 3 TOC boxes blank. This tells the Calibre TOC generator only to make listings for the Heading 1 or h1 titles…as opposed to putting in an entry for every dippy little Heading 2 or Heading 3. I could also check the “Force use of auto-generated Table of Contents” box, I suppose, but I tend to leave it unchecked in case I have a hand-made TOC in my file.

Calibre actually puts this TOC into your Mobi file by default at the end. If you want the Calibre generated TOC at the start, you can tweak a setting in the Mobi Output section of the Convert Books dialog.

The other way to get a Mobi TOC is to do it yourself, may god hace mercy on your soul. I did this a few times when I was starting out, but I’ve found ways to avoid doing it—like by letting Calibre make my TOC, or by using InDesign and having it build a TOC on export.

But here, for those who care, is a how-to on hand-made TOC. I mentioned before that you might as well put a simple autogenerated TOC into the start of the word processor doc. And I said you ought to go to the line before the start of the Table of Contents and ask your word processor to add a so-called Bookmark (or Anchor) with the name “toc.” While you’red at it, put a hard pagebreak before and after your internal TOC, which will probably force it into a separate little XHTML document of its own when Calibre shatteres your document into numerous small HTML files.

The Kindle reader can use the bookmark or the separate XHTML fragment to find your in-document TOC, but you have to feed it a so-called guide reference that you edit into place using Sigil on the Epub file.

The so-called guide references live near the end of an Epub component file called CONTENT.OPF. You can browse and edit this file if you open your Epub inside Sigil. Just click on CONTENT.OPF. Typically Kindle only pays attention to three entries with these types: “toc” “cover” and “text.” The “toc” link goes to the Table of Contents. The “cover” link goes to your cover image. The “text” link goes to where you want the beginning of the book to be. You title these references “Table of Contents”, “Cover,” and “Text” or “Beginning.”

The links that you give for these references are either bookmarks within pages or they are individual component XHTML “web pages” of the web site encapsulated in the Epub.

Here are two examples.

Example 1 uses bookmarks within pages, where you’ve also added a “start” bookmark for where you want the reader to begin with your book. The cover reference will probably be autogenerated and the file holding the cover renamed cover.xhtml. See the image below of the code in CONTENT.OPF.

Example 2 is for when your files are shattered into little ones and your in-text table of contents ended up in its own page. You might as well rename this page “toc.html” and while you’re at it, rename the page holding the cover “cover.html” and the initial introductory part of your book “intro.html.” Then the guide material looks like the second part of the image from CONTENT.OPF below.

Yeeeeeeccchhhh.  Too complicated! That sodding TOC! But the difficulty isn’t not insuperable. Tweak around for a bit, and you’ll have a working Mobi table of contents.

To summarize, there are three different ways to fix the Mobi TOC problem. (1) Use Calibre to convert to Mobi, and tell Calibre to generate a TOC in the Mobi output. (2) Generate an internal TOC in your document, put a bookmark on it, and use Sigil to set the Epub CONTENT.OPF guide to reference to this bookmark. (3) Generate an internal TOC in your document, and use Sigil see that it ends up in its own XHTML fragment that you name toc.xhtml, and set the Epub CONTENT.OPF guide to reference to the toc.xhtml file.

Any of these is easier than it sounds. Don’t be afraid to get in there and tinker.

In the next installment we’ll get into text and image formatting issues.

Onward to How To Make an Ebook #3: Calibre, Sigl, and HTML.

How to Make Ebooks #1. Getting Started (2021 Update with Paperbacks Info Link)

Friday, April 20th, 2012

[Note: I added a few more comments in 2021 to make this post more current. And I included a link to my acculmulated tips on how to make your own paperbacks as well.]

I plan to put up a series of four posts about the topic of how to epublish books on your own. In these posts I’ll focus on doing it all yourself. I’m going to describe the specific series of steps that I’m taking to epublish my Transreal Books.

Don’t take everything I say for gospel. There are many paths through the thickets of epub, and I’m only now beginning to find my way. I first posted on this topic in Fall 2011. And then I wrote this present post in April, 2012, and I did a some revisions to this post in December, 2016.

As of 2016, I’m largely using InDesign to create my ebooks. the reason I use inDesign to make ebooks is that I’m already using it to make print books. But learning to use InDesign was a long process with many, many gotchas.  And getting the EPUB export to work right took awhile too.  I’ve made a lot of notes on this process, and I’ve posted a roughly edited version of these notes online as “Using InDesign for Print and Ebooks.” These notes are kind of sequel to the blog posts you see here.

[Note also that in 2012 I combined, expanded and revised my How To Make an Ebook blog posts to make an ebook called How to Make An Ebook, available on Amazon . But this ebook is, as of 2016, a bit out of date, and I have not, as yet, revised it. For now, this post you are reading is my most up-to-date say on this topic.]

Posting the information seems worthwhile as I’ve really had quite a bit of trouble in learning it. Epublishing abounds with gotchas. But clearly its time has come.

Distribution: Kindle, iBook, Direct

So suppose I have a document and I want to make it into an ebook. Let’s start by describing the steps you can use to distribute your ebook once it’s done.

As of 2016, there are three main channels for distributing ebooks:
(1) Amazon Kindle,
(2) the Apple iBook store.
(3) Your own website. You can create MOBI and EPUB format books so as to reach all existing ereaders.

As of 2019, you can reach all of these markets via a sinble site, Draft2Digital.

Regarding the corporate channels, the ebook market share figures are constantly being debated, revised, and spun. As of 2016, it may be that Amazon sells close to 75% of ebooks, iBook around 12%, with Nook, Kobo and Google Play picking up some crumbs.  And it’s a big hassle to get your books onto iBooks.  So bascially, it’s all about Amazon Kindle.

One thing to keep in mind from the start is that you can distribute through all of these channels for free—provided you have a certain amount of patience and a good tolerance for pain. You can pay various intermediaries to set up distribution for you, but don’t make the mistake of paying a large up-front fee for this service and/or the mistake of cutting them in for the lion’s share of your royalties.

Set-Up

You need to set up your corporate distribution accounts. Google for “Amazon KDP” (Kindle Direct Publishing) to get an account for distributing Kindle ebooks. And use Draft2Digital to distribute to Apple iBooks. If you want you can also distribute to Google Play.

There is a direct Apple iBooks channel, but this is a little more complicated.  If you own a Mac or have extensive access to one, you can directly upload an ebook to iBooks using the Apple program iTunes Producer.  More info.  You cannot, however, run iTunes Producer on Windows machines.

Other than Kindle and iBooks and indie, there are alternate paths to the ebooks market.  You might, for instance, search for “NookPress” to get set up for distributing NOOK—if you want to bother with that one. But to keep things simple, I’m going to stick to KDP, Drfat2Digital, and your own indie website.

Another initial step (not absolutely necessary) is to invent a name for your publishing enterprise, and to purchase an ISBN (International Standard Book Number) for your book. You do this by seraching for “Bowker ISBN” and buying one or several ISBNs—they’re not hugely expensive. The gain with having your own ISBN is that it makes it easier to get your distributors to attribute your book to your personal publisher name. Note that some people say that you need a different ISBN for each distribution channel. My preference is to quietly use one particular ISBN for all of a given ebook’s channels.

Now a bit about distributing your ebooks from your own website.

First you want to get a PayPal account so people can easily pay you. Note that PayPal is set up to accept credit card charges from customers who don’t have a PayPal account of their own.

Second you need a service to handle the process of collecting money from the customers and getting copies of the ebook to them. In the past the relatively inexpensive service E-Junkie worked well for me. Be careful here, there are some rip-off services that do the same thing, but who charge you a very high monthly fee and who take something like 10% of all your sales. E-Junkie, on the other hand, was a good deal. Bit now its importance is fasing.

As of 2021, the best and easiest way to distribute ebooks is to upload an EPUB of the book to Draft2Digital, who will distribute the book to virtually all ebook platforms. You don’t have to pay them anything at all, but they do take a small cut of your profits.

Third you’ll need to set up a webpage describing your ebook or ebooks, complete with purchase links (which will redirect them to, let us say, E-Junkie, who’ll collect customer info, chage them via PayPal and email the customers a download link).  Note here that, in 2021, it’s a good idea to use a universal ebook link; you can make them for free at Books2Read.

EPUB and MOBI Formats

Ebooks are distributed in two main formats: EPUB and MOBI. What are they?

EPUB is the more generic format. Basically, an EPUB file is like a compressed website. It’s a package file that holds all the elements of a website. Specifically, an EPUB holds a Text directory with one or more HTML or XHTML files with your text in it, a Styles directory with a CSS style sheet to control the styles used in your text, an Images directory with JPG image files for each image in your text, a TOC file with a table of contents, and a funky OPF “manifest” file that describes how the pieces fit together. It’s a website wrapped in a package.  A virtue of working with EPUB files is that it’s possible to edit them.

The iBook, NOOK, and all the other ebook readers use EPUB.

There are various ways to turn your DOC or RTF text file into an EPUB file—I’ll discuss both an easy way and a harder way of doing this.

MOBI is a close variation on the proprietary Kindle ebook file format. Like EPUB, a MOBI holds text, images, table of contents, and a “manifest.” Amazon actually uses a variation on the MOBI format called AZW, but Kindles will read MOBI files. It’s rather easy to convert an EPUB file into a MOBI. We’ll talk about this in a bit. The thing to remember is that first you need to make an EPUB, and making the MOBI after that is practically effortless (modulo a bit of screwing around with some tags). The reason you want an EPUB file is that it’s reasonably easy to edit EPUB files, but hard to edit a MOBI file.

Keep in mind that if you want to give away or to sell your book from your own website, you’ll need to make EPUB and MOBI versions of it at home. The MOBI is for Kindle users, and the EPUB is for everyone else. If you have these two formats, then you can reach all the ereading devices or apps in existence.

But—if you can’t face the tweaking ordeal of making EPUB and MOBI and getting into an indie-distribution website, you can simply sell your book via the big channels.  And here, once again, it’s Amazon that really matters.  You send a a book file to them, and they do the rest.

Amazon KDP . Will accept EPUB, HTML, DOC or RTF.  In general I prefer to send an EPUB to Amazon.  I do like to make the EPUB myself so I have some control over how the ebook will look.

Apple iBooks.  If you have a Mac, you can use iTunes Producer to upload an EPUB.  If you have Windows (or a Mac) you can go use Draft2Digital. They will accept EPUB, DOC, or RTF.

Scraps. Barnes & Noble will accept EPUB, HTML, DOC, or RTF fot their Nook line.  You can go to them direclty, or distribute to them via Draft2Digital.

Once again, if you don’t want to do indie distribution, and don’t want to do ebook conversion at all, you can just clean up your DOC or RTF and upload it to Amazon. And upload a clean DOC to Draft2Diital for iBook, and Barnes & Noble, and Kobo market and others.

Making your own EPUB and MOBI: Why and How?

There are two main reasons to make your own EPUB and MOBI.

First of all, it gives you better control over how your ebook will actually look.

Secondly, if you want to distribute indie ebooks on your own, you need to get them into EPUB and MOBI—and really this just means getting them into EPUB, as the EPUB to MOBI conversion is so simple.

So now lets talk about how you make an EPUB and a MOBI.

You’re going to use three very good free software tools. (1) Calibre . (2) Sigil . Scroll to the bottom of this GitHub page to find the download links. (3) The Kindle Previewer. These tools do different things, and you need all of them. They’re constantly being updated, so check for updates every so often.

Calibre converts files from one format to another. And can use Calibre to edit the so-called metadata (title, author’s name, ISBN, publisher name, etc.) in your files.

Typically you use Calibre to convert RTF or HTML into EPUB and then into MOBI. That is, you shoot for getting the EPUB the way you want it first, and only then do you convert to MOBI.

The Calibre conversion process is automatic, although there are a rather large number of Conversion settings you can tweak to affect the outputs. It usually takes multiple iterations until you get the settings and the outputs just right. Calibre also has a primitive ereader window that lets you look at the current states of your EPUB and your MOBI. And you can, to some extent, directly edit your EPUB in Calibre. When you’re happy you can save your EPUB and MOBI files to disk, and try them out in other ereaders. And you’re free to return to Calibre and change the files some more.

Sigil allows you to tweak your EPUB file directly in various ways: you can edit or wholly replace the text, add or remove images, alter the Table of Contents, and more. Sigil also has the ability to verify if your current EPUB has any format errors in it, and it helps you fix them. Sigil has become a shareware “GitHub” program, rather than a program with a single developer, but it’s still very good. People who dump on it don’t know what they’re talking about.  I’ve been using it since 2012, and have never had a problem with it.

Kindle Previewer autoconverts an EPUB into a MOBI and lets you preview how the MOBI will look on the various kinds of Kindle devices.  The Kindle Previwer also writes a copy of the MOBI to your hard disk, so this is a very easy way to convert EPUB to MOBI.

Four Work Flows

I’ve used five different work flows in making your EPUB and MOBI. (1) Simplest Upload Word DOC, (2) Simple Convert a DOC (3) Medium Level HTML, (4) Advanced Level HTML, and (5) Pro Level InDesign Export.

Simplest Level Just Upload a DOC
* Clean up your DOC or RTF file.
* Upload to Amazon KDP to get the MOBI file via the ‘Download Book Preview’ file option.
* Upload to NOOK or Lulu to download the preview EPUB file.

Simple Convert a DOC
* Clean up your DOC or RTF file.
* If you’ve been using DOC, now save it as an RTF.
* Use Calibre to convert your RTF into an EPUB.
* Use the Sigil software to verify the EPUB and to do minor edits on it.
* Use Calibre or the Kindle Previewer to convert the EPUB into a MOBI.

Medium Level HTML (Only if you’re an HTML coder)
* Clean up your DOC or RTF file.
* Convert your DOC or RTF into an HTML file, then tweak the HTML
* Use Calibre to convert your HTML into an EPUB.
* Use the Sigil software to verify and to correct problems in the EPUB.
* Use Calibre or the Kindle Previewer to convert the EPUB into a MOBI.

Advanced Level HTML (Don’t bother with this one)
* Clean up your DOC file.
* Use Dreamweaver to convert your DOC into an HTML file, then use Dreamweaver to clean and tweak the HTML. Create a CSS stylesheet for the HTML.
* Use Sigil to directly create an EPUB from your HTML, from an associated CSS stylesheet you’ve created, and from images that you’ve properly sized.
* Bounce back and forth between Dreamweaver and Sigil, finding and correcting problems in the EPUB.
* Use Calibre or the Kindle Previewer to convert the EPUB into a MOBI.

Pro Level InDesign Export (My current favorite)
*”Place” your DOC into an InDesign file.
*(Optional) Tweak the polish the InDesign file so you can save off a PDF copy for paperback publication via Amazon CreateSpace
*Use the InDesign Export function to save off an EPUB.
*Use Kindle Previewer to convert the EPUB into a MOBI.

Regarding the use of InDesignfor my fifth, and now-preferred, workflow, as I mentioned at the start of this post—-it took a long time to learn how to do it. On December 4, 2016, I posted a roughly edited set of notes about it as a web page, titled “Using InDesign for Print and Ebooks.”

In the later posts in this series of blog posts at hand, I’ll talk about the steps of the first four workflows, and about such issues as how to handle covers, internal images, tables, styles and tables of contents.

And if you’re eager to start experimenting, you could try the (1) Upload a Doc. Try it right now. I describe that one in the next post, How To Make an Ebook #2, with the link down below.

Or try (2) Simple Level Convert a Doc workflow level a try, just to see what your MOBI or EPUB might look like. Make a copy of some document you like, put it into a Playpen directory, and let Calibre munge on it. One thing worth stressing: always keep an Archive directory where you keep the best forms of your DOC, EPUB, HTML or whatever files for your ebook. Calibre has a way of screwing with the files that you load into it, and you don’t want to overwrite your archived files with the screwed-with files.

For getting started, there’s an online Calibre user manual to help you along. The MobileRead forums have a huge amount of info if you use the Search box. And simply Googling your questions often leads to good answers—although there’s a lot of inaccurate jabbering as well#2:

Go on to How To Make an Ebook #2, the Simpler Paths…

Collected Essays, at Transreal Books

Monday, April 16th, 2012

A new Transreal Books title goes live today!

Now selling for $4.95. Go to the Transreal Books page to buy the book from Amazon or to buy the Epub or Mobi (for Kindle) files directly from Transreal Books. Barnes & Noble link coming soon. Book will eventually be in the iBook store as well.

Collected Essays includes the nonfiction pieces from my two earlier collections, Transreal! (1991) and Seek! (1999). And many, many newer essays have been added as well. How to write, history of Silicon Valley, semi-technical articles on graphics, the philosophy of computer science, travel notes, off-beat memoirs—it’s all here.

Collected Essays weighs in at twice the length of an ordinary book, with sixty articles and about a hundred illustrations, many in color.

The essays fall into seven parts:

(1) “The Art of Writing.” Manifestos and talks about writing science-fiction.

(2) “Silicon Valley.” Cool scenes Rucker witnessed as he rode the Silicon Valley computer wave for over twenty years, starting in 1986.

(3) “Weird Screens.” Graphical programs that have obsessed Rucker—cellular automata, artificial life, fractals, space curves, and virtual reality.

(4) “Futurology.” Playful raps and speculations about the coming times.

(5) “The Philosophy of Computation.” Digital immortality, artificial intelligence, and the birth of a universal mind.

(6) “Personal Stories.” Tall tales and reminscences of strange times.

(7) “Mentors.” Appreciations of the great minds and wild freaks who led Rucker along his path: Kurt Gödel, Martin Gardner, Robert Scheckley, William Burroughs, Allen Ginsberg, Ivan Stang and Stephen Wolfram.

Go get it at Transreal Books .


Rudy's Blog is powered by WordPress