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


Archive for the ‘Rudy’s Blog’ Category

How to Make an Ebook #4 — Heavy HTML

Thursday, May 10th, 2012

This is the last of four 2012 blog posts on the topic of how to make your own ebooks, and which I revised somewhat in 2016. In 2012, I combined, expanded and revised these entries to make, fittingly, an ebook called How to Make An Ebook, available from Amazon. Note that this ebook is a 2012 edition, and it does not include any updates of the material that I made to these blog posts in 2016.

My How to Make An Ebook includes quite a bit of additional material, it’s more tightly organized, and it doesn’t include the perhaps too distracting photos that tend to clutter my blog posts! But it do

And now let’s get down to some Heavy Metal…I mean Heavy HTML.

Advanced Level: Dreamweaver & HTML

For full control, our workflow is to go from DOC or RTF to HTML, and then from HTML to EPUB. We’ll edit the HTML extensively. As I mentioned before, I myself use Dreamweaver, which is a commercial product from Adobe, but it’s possible that you could do a lot of this with some free HTML editor.

In all honesty, I should tell you that the process I’m about to describe is kind of complicated and probably not, in fact, a really good workflow to use.  As I’ll mention at the end of this post, I now use a much simpler pro-level process.  I import my books into InDesign and export my EPUB files from there.  But before I learned how to use InDesign, I found the “Heavy HTML” workflow useful.

Converting DOC to HTML. Preliminary cleanup.

For full control, our workflow is to go from DOC or RTF to HTML, and then from HTML to EPUB.

In “Do-It-Yourself Ebooks #2. The Simpler Paths” I talked about ways to clean up your Word file before using it for an EPUB. But now there’s another thing you want to do. You want to stop using the Word Normal style, and get rid of as many other Word styles as you can.

The first thing you want to do about your Word styles is to ditch as many of htem as you can, as otherwise they’ll show up as extra crap at the top of your HTML. For this, go to Developer | Templates | Organizer, and look at the list of styles in your document in the left pane of the Organizer dialog. Most of them are styles you aren’t using in your document, and you ought to delete them. You can select them all by clicking at the top, holding down the shift key and scrolling down. Before pressing delete look over the list and see if there are any special styles you defined and that you love and don’t want to lose. Then press Delete. Word won’t actually delete the most essential styles like Normal, Heading 1, and a few others. But most of them go away. Note, by the way, that if you delete a style and it was in fact applied to some text in your document, the text stays in place, but its style reverts to Normal. If you do in fact erase some style that was doing something useful, you can redfine it.

An optional second step is make a new Style called, let’s say, epubtext. To do this, select a normal block of text, right click and select Styles | Save selection as a new Quick Style, and name the new style epubtext. Now use Find and Replace | More | Format | Styles to set the Find what box to be empty but with the Normal Style, and the Replace with box to be empty but with the epubtext style. You might also make up other special styles for things like epubextendedquote, or epubtextnoindent, and so on. If this seems to weird and complicated you can do it later over in the HTML file, replacing MsoNormal by epubtext in the class specifications on the p tags for starters.

There are two ways to turn your DOC into an HTML.

(MAKE THE HTML YOURSELF) Use File | New to make a new HTML document in Dreamweaver, specifying that the Doc Type be XHTML. And then I select my whole DOC, copy the text of the full book to the clipboard, and paste it into the the Design View. Before doing this, go to Edit | Preferences | Copy/Paste and (a) set your Edit>Paste radio-buttons to the last option, “Text with structure plus full formatting (bold, italic, styles)”. For sure you want to keep your italic and bold formats. And you want to bring along your DOC styles, although you will now need to edit them a bit in the HTML doc. Also check the “Retain line breaks” box, otherwise the file will come through as one single giant paragraph.

Okay, fine, but now when you go to paste your DOC into Dreamweaver it may object and says the file is too big. So you have to teach Dreamweaver a lesson. This link describes a way to alter the default size of a file that Dreamweaver is willing to accept. To use this trick, close Dreamweaver, go to find InsertOfficeDoc.js, open it in the Text Pad editor, and add zeroes to the ends of the WarnThreshold and MaxThreshold numbers. Then open Dreamweaver again, and it’ll let you paste in a big book-sized file. Save your newly made HTML or XHTML (either file extension is okay) file in the directory where you’re keeping your files for this book. Now start cleaning up the file.

Note that pasting text into the Code view instead of the Design view is much trickier, and isn’t recommented, as pasting into Code view is likely to strip away all your formatting, especially your vital italics and, for that matter, your paragraph breaks.

(USE WORD TO MAKE THE HTML) In Word, save the Word file of your book as a “Web Page, Filtered” or 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. By the way, when you saved the “Filtered HTML” file, Word made a directory of extra files in my directory, but there’s actually nothing in that directory that matters, and you can delete it. Word will put a lot of extra crap into your HTML file itself, and you will probably want to run the Dreamweave Commands | Clean up Word HTML tool. To remove more Microsoft crap, do a search and replace and delete all the style attributes from your paragraph p tags. Word will have jammed a bunch of unnecessary style specifictions into that attribute, and all the style you need is going to be in your class=”epubtext” attribute.

So okay, at this point, whichever method you used, you’ve got an HTML file of your book. Now you’re going to edit this file so you can make a nice EPUB out of it.

Tip: Stick to the Code view as much as possible. Dreamweaver lags and reacts slowly if you use the Design or the Split view. Now and then you’ll want to see the WYSIWYG views, yes, but stick to Code view most of the time and the program runs much smoother. And, oh yeah, Dreamweaver also runs faster in Code view if you close the Properties window.

Now we need a few more tweaks so that the HTML can be used to build an EPUB.

* Fill in the Title field for your HTML in Dreamweaver.

*Delete the body attributes link and vlink if they’re present.

*Remove all the align attributes of the p tags

*Remove all the clear attributes of the br tags

*You will have some anchor tags that make your Word-built Table of contents and in-document links work. The EPUB standard likes the id attribute but not the name attribute, and either one works. If your anchors have both name and id attributes, remove all the name attributes. If your anchors have only the name attributes, change them to id attributes doing a search and replace to change every occurrence of <a name=somenumber to <a id=somenumber

*Look at your span tags. Many of them are doing much for you, they’ll be things like span style=“font-family:’Georgia’,’serif’; font-size:12.0pt; color:black; “. It’s pretty safe just to search for all span tags with a style attribute and remove the tags (but not the contents of the tags). If you want to style your text you’ll do it with a class attribute on your p tag or, if necessary, a class tag on a span tag.

And now you want to work on your styles some more, which deserves a separate subsection.

Styles

You will see some code like this in between the <head> and </head> tags at the top of your HTML file. The contents of the style definitions will be different, but you’ll see something like the following, which is called an “internal style sheet.” (We will soon switch to an “external style sheet”.)

<style type="text/css">
p.epubtext
{ text-align: justified;
text-indent: 1.5em;
margin-top: 0px;
margin-bottom: 0px;
font-family:"Georgia", serif; }

h1 {
text-align: left;
font-size: 1.5em;
font-weight: normal;
font-family:"Georgia", serif;
margin-bottom: 0.67em;
margin-top: 0.67em;
page-break-before: always;
}
</style>

As I mentioned above, you might have erased most of the Word file styles, but if you didn’t you’ll see a lot of them here as part of the inernal style sheet. You can simply delete most of these, although you can use a Search command to check if they’re being used in your document. Many of them have “Mso” at the start of their name. You can eleminate them from your HTML document now.

If you haven’t yet changed from the Word Normal style will be called MsoNormal in your HTML. Search and replace to change “MsoNormal” to “epubtext” everywhere.

At this point you can also the Commands | Clean Up Word HTML, but if you made your HTML by cutting and pasting rather than letting Word save as HTML, you don’t really need this tool.

By now you’ll see that most of your paragraphs start with the tag </p class=“epubtext”. And the chapter headers should have a tag like </h1 class=“epubh1″

When you converted the Word DOC to HTML, the Heading 1 styles automatically changed to h1. You can simply change the style of h1, as in the sample code above, or you can define an epubh1 style and apply that to the h1 tags as a class attribute.

At this point you really want to switch to an external style sheet.

To make an external style sheet, put a line like this into in between the <head> and </head> tags at the top of your HTML file.

<link href="../Styles/epubstyles.css" rel="stylesheet" type="text/css" />

And now make a new file called epubstyles.css in the Styles directory. Just a text file, you can ask Dreamweaver to make a new CSS file if you like, it might have a @namespace or info line at the top, but this doesn’t much matter.  Here’s 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.

And now you put style definitions into the epubstyles.css file. The general rule is that styles start with a . in the style sheet, but you don’t use the . in the code.

Here’s a really good “cheatsheet” link about CSS.

HTML for EPUB and MOBI

There’s a lot of specialized things about tweaking HTML so it looks good on an ereader. I’ll just mention a couple of things here.

Never set margin-left to anything but 0. Otherwise you can, for obscure reasions, end up with an indent that shoves your text halfway across the reader screen.

If you want to set off your text, use blockquote, which is a really great HTML tag. It indents your text a little on the left and and right and skips a half-line or so before and after your block of text. You can put <p> tags inside a blockquote block. Some advise against this practice but it works well for me.

I like to format my extended-quote or blockquote text a little differently. I like to make the font a little smaller, and to use a left alignment with a ragged right edge instead of the default justified alignment that goes for even left and right edges. I have to put in the class=”epub_extended_quote” attribute by hand on the <p> tags inside my blockquote.

Here’s what I do in my epubstyle.CSS to define epub_extended_quote. I include four styles here, epubtext, epubtext_noindent, epub_extended_quote, and epub_centered. A nice thing in a CSS file is that you can get styles to share some attritube properies by listing them separated by commas in an initial group definition. And add modifications to the attributes in separate blocks. I’ll print some code here, and just for fun I’ll format with the <code> tag like I’ve been doing, and I’ll put it inside a <blockquote> tag as well, although I’ll leave the text style as epubtext for now.


.epubtext, .epubtext_noindent, .epub_extended_quote, .epub_centered {
display: block;
font-family: Georgia, Times, "Times New Roman", serif;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0;
text-align: justify;
text-indent: 1.75em
}

.epubtext_noindent {
text-indent: 0in
}

.epub_extended_quote {
text-align: left;
font-size:0.9em;
}

.epub_centered {

text-align: center;
}

And here’s a paragraph inside a blockquote tag and with the text in epub_extended_quote style.

And that’s all I have for you right now. But I found out a lot about HTML for EPUB and MOBI from this great link.

Synching your EPUB with your HTML and CSS “Source Code”

You want to save your big big HTML file and your epubstyle.CSS as a kind of source code. Once you have your HTML in a reasonable state, you can open it in Sigil and it will drag the Images and the CSS along, making copies of them within the container EPUB file.

Sigil will not save a file as HTML or XHTML, so you have to use a trick to move your “source code” HTML file back and forth. When you have it open in a code window Sigil, you can use Ctrl+A to select all of the HTML file code contents, then Ctrl+C to copy it to the clipboard, then go over to Dreamweaver with your source code HTML open in a window there and then do a Ctrl+A to select the contents of the source code file and then to Ctrl+V to paste the clipboarded code from Sigil onto your Dreamweaver file. You can edit the file for awhile in Dreamweaver, then bring it back into Sigil by reversing the procedure. Select the whoel file in Dreamweaver, copy to clipbaord with Ctrl+C, go over to Sigil, select the whole main HTML code and use a Ctrl+V to overwrite it with the source code HTML from Dreamweaver.

By the same token you will have a source code epubstyle.CSS file and one that’s inside the EPUB file in Sigil, and you can edit this file either in Sigil or in Dreamweaver, making sure to use Ctrl+C and Ctrl+V to move it back and forth, keeping the EPUB in synch with your “source code” HTML and CSS.

You can either edit your file in Sigil, or you can copy the file back into Dreamweaver and edit it there. Editing a lot in Sigil is a little bit flaky. Two issues. As of the May, 2012, release of Sigil if you do a big Search and Replace in Sigil it sometimes crashes. Not all that often, but often enough to matter. It’s safer to do those big mass replace moves in Dreamweaver. Another flaw in Sigil is that it’s an imperfect WYSIWYG editor. Editing the code view window in Sigil is fine, but if you try and edit in the Book View window, you’ll get “turd-bit” characters in the code view after deleting characters in the book view. So: (a) always save your EPUB before doing a big Search and Replace in Sigil, (b) only edit in the Code View window of Sigil, and (c) if you want to do a whole lot of editing, copy your Sigil EPUB HTML or XHTML file over to your “source code” file in Dreamweaver.

Images

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.

You’ll have at least one image, your cover. 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.

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 to be, let’s say, 700 pixels across so they can fill up an iPad reader page. This way you have control of what images get used. The thing to keep in balance is, on the one hand the size of your EPUB file and, on the other hand, the quality of your images. Maybe 600 pixels across is enough. A 700-pixel image uses forty-percent as much memory as a 600-pixel image. On the other hand, people don’t mind big files these days, so maybe 10 Megabytes instead of 6 Megabytes is okay.

One crucial thing to keep in mind. I mentioned it before but I need to say it again: DON’T let any width or height attributes sneak into your image tags, or the image may not resize well. Your tag should be clean and simple like.

<img src=“../Images/fabsnap.jpg”>

This assumes that you are using the directory structure I mentioned before, with three directories, HTML Text, Images, and Styles, with your source HTML in HTML Text, the jpg files in Images, and your CSS file in Styles.

Breaking up the HTML

I mentioned before that you ought to put hard page breaks into your DOC after each chapter. When you convert the DOC into an HTML web page, these page breaks will show up as a break or br tag like this

<br style="page-break-before:always;" />

What you want to do in the HTML file now is to replace these tags by “horizontal rule” or hr tags like this:

<hr class="sigilChapterBreak" />

Sigil can read these tags and convert them into Sigil chapter breaks for shattering your monolithic HTML file into small files. But postpone shattering in Sigil at the last minute, as you want to keep a single big HTML or XHTML file as your EPUB “source code”.

A hard page break in a Word file becomes the following code when you transform the DOC into an HTML

So you can do a search and replace, changing the Word-generated page break code with the Sigil “shatter here” code

<hr class="sigilChapterBreak" /> An alternate approach is the following: To make a separator, insert the symbol <hr /> where hr stands for horizontal rule and you get a nice looking line like below.


You can use an attributes to make the horizontal rule take up only some percent of the page, have it be centered or on the left or on the right.

Validate with EPUBcheck & Build MOBI.

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 Meta tool, 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.

As before, do the fixes in Dreamweaver, save the fixed HTML, reload in Sigil, save off a fresh EPUB and try epubcheck again. Then save your perfect EPUB.

And now you can use Calibre to turn your EPUB into a MOBI, or use the Kindle Previewer, as I discussed in “The Simpler Paths.” When you use Calibre for a conversion of your EPUB file, be sure to put the contents of your CSS file into the Convert Books | Look and Feel | Extra CSS box so that Calibre keeps your styles. (Remove the very first line of the CSS file, but keep the style definitions).

Back to DOC

If you load a shattered EPUB into Calibre and save as HTMLZ you’ll get a kind of ZIP file that has a single merged HTML or XHTML file in it plus the images, and the CSS stylesheet The zip file has the extensions HTMLZ, which most unzippers don’t recognize. In Windows you can open it with a free program called 7-zip that you can find on the web.

Word won’t open an XHTML file, but it will open an HTML file that you can then save as a DOC or as a PDF. You can change an XHTML file to an HTML just by changing first line. Look at a pair of HTML and XHTML files to see what you need to change.

One reason you’d want to get Word to open you final EPUB text is that then you save it as…a DOC file whose appearance you can tweak so as to save the book as PDF and publish it in paper as well. I won’t get into the whole paper thing here, but for now, I’ll just say that from what I’m reading online, it seems Createspace (yeat another Amazon subsidiary, it’s a bit sad to say) let you sell print-on-demand paper books at the lowest price per book to you.

Pro Level: InDesign

In 2016, I’m exclusively using InDesign to build my ebooks.  Reason is that I’m also making paperbacks of all my ebooks, which menas I need to use InDesign anyway, so as to get a goodlooking PDF image of the printed book.  I send the PDF to Amazon’s subsidiary CreateSpace and also to Lightning or to IngramSpark.  And InDesign has a very good EPUB export feature.

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.”

Go for it! Self-publish your ass off! And let a thousand flowers bloom.

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…


Rudy's Blog is powered by WordPress