Saturday, January 25, 2014

Your Guide is waiting!

Notjohn's Guide to Kindle Publishing is now in its fourth edition on the Amazon stores. (Though I usually also publish my books to Barnes & Noble, the Apple iBookstore, and Kobo, I don't sell my Guide there. The other retailers would get upset by my constant references to Amazon.com. Anyhow I figure that most authors are interested primarily in Amazon's worldwide Kindle stores, now including the United States, Canada, Britain, Australia, Germany, France, Italy, Spain, Brazil, Mexico, India, and Japan.) The price is $6.99, but if you subscribe to Amazon Prime it's a free loan.

I became an Amazon e-publisher in November 2007, uploading a few Word docs to what was then called the Digital Text Platform. I soon changed to Html, the markup language used to build web pages. (All e-books are web pages at heart.) But more recently I discovered the wonders of the free and excellent Sigil software, which turns out an "epub" of the sort used by Amazon's rivals in the e-book industry. It is by all measures the best way to format your e-book, creating a single file that can be uploaded to any retailer.

I outline the process in ten steps, with screenshots of my progress along the way. It's simple enough that anyone should be able to follow it, but just in case I also provide Plan B -- the Ultimate Basic Template that you can adapt to your own book. The Guide is intended to be used in connection with this blog.

I'll be happy to answer questions about the process. Just use the Comment window. -- NJ

Tuesday, January 14, 2014

All about e-publishing

What I know about publishing e-books through Amazon's KDP platform:

MS Word

I prefer to work in html and upload an epub (see below) because it gives me complete control over the book. There's a learning curve, but the same is true of any method of submitting books to the KDP. However, the Amazon software does a fair job of converting *.doc files, if you are religious about using Styles. If you want to go this route, here are some free resources:

Shauna Kelly on using Styles
Amazon's simplified guidebook
Mark Coker's Smashwords guide
JT Bigtoad's rules for formatting Word

And for transitioning from Word to html:

Joshua Tallent: Html Basics for Kindle
Guido Henkel: Take Pride in Your Formatting

And whatever you do, PREVIEW that book after uploading it (Step 6 in the publishing process). The downloadable Kindle Previewer gives the best results. Download it and your converted mobi file, and check it in the Kindle, Fire, iPad, and smartphone emulations.

Epubs

I have settled on a single book file, style sheet, and format across all retailers. That requires me to build an epub. This is more challenging than Word, html, or mobi format, because epubs must be validated in order to get on the iBookstore. This is my system (subject to change, as always):

1) For a variety of reason, I generally wind up with my book in the form of a Word document. To turn it into a workable html file, I run the it through word2cleanhtml.com on the web, a free service. (This also works for an Open Office file: just save it as in Microsoft Word 1997/2000/XP format.)

2) I then paste the html file into a template I have previously created. It contains the basic framework of a web page and a link to my standard style sheet. Clean up the word2cleanhtml file as needed (it's not 100 percent accurate) and validate the result at http://validator.w3.org/ -- vital for building an epub, and a good idea for uploading to the KDP. Though the KDP conversion is fairly forgiving, as applied to the e-ink Kindles, good html has become more necesssary with the advent of the Fire and especially for the Look Inside preview.

3) I open the html in Sigil (a free download) and break it into chapters (epub devices prefer mutiple files to one large file). I use the Semantics and Metadata tools to build the OPF and NCX files, and I validate the result at http://validator.idpf.org/ -- vital for the iBookstore.

The resulting epub will work on the KDP, on Barnes & Noble, on Kobo, and (through Lulu) will pass muster at the iBookstore.

Friday, August 9, 2013

The e-book template (full version)


The template for an e-book is an html  package containing a head and a body. Each can contain several elements. In my basic template, the head contains the book's title, the author's name, and a link to the external style sheet posted earlier.

<!DOCTYPE html>
<html>
<head>
<title>Your Book Title Goes Here</title>
<link rel="stylesheet" type="text/css" href="epub.css">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
</head>
<body>

<!--Insert your title page here-->

<!--Insert your table of contents here-->

<!--Insert your book file here-->

<!--Insert copyright and author pages here-->

</body>
</html>

"Html" stands for "hyper-text mark-up language," a typically geeky title for what is really a very simple system for building web pages. All e-books are html at heart. Most html tags are doubled: the plain tag comes in front of the word or section to be affected, and a similar tag with a diagonal slash closes it off. Thus the statement <b>bold</b> comes out looking as bold. If you forget the closing tag, the rest of your book will be bolded.

There are excellent tutorials on the internet about html and style sheets (usually called CSS for cascading style sheet, another geeky term). Unfortunately most of them describe styling far beyond the needs of the author-publisher.

In other posts, I describe how I build the table of contents, title page, and text chapters of my e-books. Because I use the epub format, the html can be very simple. The html  shown here, for example, won't pass a validation test because it omits most of the throat-clearing that makes html look so frightening. E-books don't need that all that stuff--and if the truth be known, neither do most web pages. If uploaded to a website, the template above will work as a web page just as it is, with the only content being the statement "Your book content goes here". (In addition, "Your Book Title Goes Here" will appear as the name of the page.)

Wednesday, July 17, 2013

A style sheet for e-books

Here is the style sheet I am currently using. It has the name epub.css and it is a plain-text file unto itself. You are welcome to copy it or adapt it for your own use. - NJ

p {
margin-top:0.0em;
margin-bottom:0.0em;
text-indent:1.0em;
text-align:justify;
}

p.first {
margin-top:0.5em;
margin-bottom: 0.0em;
text-indent:0.0em;
text-align:justify;
}

p.left {
margin-top:0.5em;
margin-bottom: 0.0em;
text-indent:0.0em;
text-align:left;
}

p.center {
margin-top:0.0em;
margin-bottom:0.25em;
text-indent:0.0em;
text-align:center;
}

h2 {
margin-top:1em;
font-size: 150%;
text-indent: 0em;
font-style: italic;
text-align:center;
}

h3 {
margin-top:1em;
font-size: 125%;
text-indent: 0em;
text-align:center;
}

h4 {
margin-top:1em;
font-size: 125%;
text-indent: 0em;
text-align:left;
}

p.large {
font-weight: bold;
margin-top:1em;
margin-bottom:1em;
font-size: 200%;
font-style: italic;
text-indent: 0em;
text-align:center;
}

p.medium {
font-weight: bold;
font-size: 150%;
font-style: italic;
margin-top:1.0em;
margin-bottom:1.0em;
text-indent: 0em;
text-align:center;
}

p.small {
font-weight: bold;
margin-bottom:1em;
font-size: 125%;
text-indent: 0em;
text-align:center;
}

p.block {
font-family: courier, monospace;
text-indent: 1em;
text-align:left;
margin:0em 0em 0em 1em;
}

p.blockfirst {
font-family: courier, monospace;
text-indent: 1em;
text-align:left;
margin:0.5em 0em 0em 1em;
}

p.blockcenter {
font-family: courier, monospace;
text-align:center;
margin:0.5em 0em 0em 1em;
}

span.smallcap {
font-size: 90%;
font-weight: bold;
}

div.image {
text-align:center;
margin-bottom: 0.25em;
}

div.icon {
text-align:center;
margin-bottom: 1em;
}

div.caption {
margin-bottom: 1em;
text-align:center;
font-style:italic;
}


Tuesday, April 9, 2013

How wide the image?

I don't own a large tablet, so I was slow to realize that Amazon's 8.9 inch Fire HD was seriously degrading the images in Kindle editions. (The same doesn't seem to be true of the Apple iPad.) The problem arises with the larger, high-resolution screen, combined with the lack of a software default that would enlarge an image to fill the screen, or something close to that.

For years Amazon has recommended that we use images sized to a 600 by 800 pixel ratio, and that is what I have used in recent years. But even when the image was smaller than the recommendation, it was enlarged to full screen in most Kindles and Kindle apps. With the advent of the Fire HD tablets, this no longer seems to be the case.

As a fix, I have made two changes. First, I now upload images that are 800 pixels wide by however tall. (Some formatters use 1000 pixels wide, but I think the smaller images expand quite well. Second, I changed the html for my images to include a width="100%" instruction. This solves the problem on the Fire HD and on its larger sister, which I think of as The iPad Killer, and it makes no difference whatever in the e-ink Kindles or the various Kindle apps. This is what the html looks like in the case of the Sony Data Discman illustration early in my Guide:

<div class="image" id="disc"><img alt="Sony Data Discman" width="100%" src="discman.jpg" /></div>

The "class" tells the Kindle or app to follow the instructions in the style sheet for formatting an image. The "id"  links the illustration to the table of contents. The "alt" tells the Kindle text-to-speech feature what to say when it encounters the illustration. The "width" instruction provides an enlarged image in the HD tablets. And the "src" (short for source) points to the image file itself.

Saturday, January 26, 2013

A simple table of contents


<h2 id='toc'>Contents</h2>

<p class='center'><a href='#chapter01'>Chapter One</a></p>

<p class='center'><a href='#chapter02'>Chapter Two</a></p>

<p class='center'><a href='#chapter03'>Chapter Three</a></p>

<p class='center'><a href='#chapter04'>Chapter Four</a></p>

<p class='center'><a href='#chapter05'>Chapter Five</a></p>

<p class='center'><a href='#copy'>Copyright - About the Author</a></p>

You will of course add as many chapters as needed, advancing the link (#chapter06, #chapter07, etc.) with each addition. I like to number them as shown, but if you like you can give the link a descriptive name, as I have done for the final section (#copy) containing the copyright information and a brief biography of the author.

Update: If you work in Sigil, as I recommend, this task is simplified for you. First, you can actually build an "html table of contents" using the Tools option on the top menu. (Click on Tools > Table of Contents > Create HTML Table of Contents.) I don't do this because I prefer my own layout, and it's a chore to edit Sigil's version. Second, you don't have to put anchors in the chapter headings or even to use the href= instruction.. By breaking the large html file into separate chapters and sections, you can use the Insert > Link option on the top menu to quickly connect an item in the TOC to that chapter. Just swipe the mouse cursor over, say, Chapter Five, then link it to the appropriate file. The link will look something like this: <a href="../Text/Section0005.html">.

Wednesday, January 16, 2013

Plan B: The Ultimate Basic Template

<!DOCTYPE html>
<html>
<head>
<title>Your Book Title Goes Here</title>

<!--First we have a basic style sheet, sufficient to format our book-->

<style type="text/css"> 

p { margin: 0em; text-indent: 1em; text-align:justify; } 

p.breakhere { page-break-before: always } 

p.first { margin-top:0.5em; margin-bottom: 0.0em; text-indent:0.0em; text-align:justify; }

p.center { margin-top:0.0em; margin-bottom:0.25em; text-indent:0.0em; text-align:center; }

h2 { margin-top:1em; font-size: 150%; text-indent: 0em; text-align:center; }

p.large { font-weight: bold; margin-top:1em; font-size: 200%; text-indent: 0em; text-align:center; }

p.medium { margin-top:1em; font-weight: bold; font-size: 150%;
margin-top:1.0em; text-indent: 0em; text-align:center; }

p.small { font-weight: bold; margin-top:1em; font-size: 125%; text-indent: 0em; text-align:center; }

</style>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
</head>
<body>

<!--Next we have a title page with each line centered-->

<p class="large" id="start">Your Book Title</p>

<p class="medium">The Sub-title</p>

<p class="small">Author</p>

<p class="small">Publisher <a href="#copy">2013</a></p>

<!--Which is followed by the Table of Contents, also centered-->

<p class="breakhere"></p>

<h2 id="toc">Contents</h2>

<p class="center">1 - <a href="#chapter01">Chapter One</a></p>

<p class="center">2 - <a href="#chapter02">Chapter Two</a></p>

<p class="center">3 - <a href="#chapter03">Chapter Three</a></p>

<p class="center"><a href="#copy">Copyright</a></p>

<!--And now the text chapters, as many as you like-->

<p class="breakhere"></p>

<h2 id="chapter01">Chapter One</h2>

<p class="first">

<!--The first paragraph is flush left with a few words capitalized-->

</p>

<p>

<!--Following paragraphs are indented, and each ends with a closing tag-->

</p>

<p class="breakhere"></p>

<h2 id="chapter02">Chapter Two</h2>

<p class="first"> </p>

<p> </p>

<p class="breakhere"></p>

<h2 id="chapter03">Chapter Three</h2>

<p class="first"> </p>

<p> </p>

<!--Adapt for as many chapters as you have, then end with the copyright-->

<p class="breakhere"></p>

<h2 id="copy">Copyright</h2>

<p class="first"> </p>

</body>
</html>

Wednesday, January 9, 2013

An html title page


Over the course of five years and nearly two dozen books, I have settled on this simple and (in my opinion) handsome format for the title page:

<p class="large">Title</p>

<p class="medium">Sub-title</p>

<p class="small">Author</p>

<p class="small">Publisher</p>

Just copy and paste it to a convenient file, where you can substitute your information for the rudimentary stuff here. With the style sheet posted earlier on this blog, your title will be displayed at twice the size of the text in your book, bold-faced, centered on the page, and dropped down just a small bit from the top of the page. The sub-title, author name, and publisher name will follow in the same format and in progressively smaller type.

If you want to get fancy, you can italicize the title, or put the entire title in capital letters, or both. You can also use a publisher's colophon or logo (a small symbol) to separate the author and publisher names. This is mine:

<div class="icon"><img src="njlogo.gif" alt="Image of book"></a></div>

Again, the style sheet specifies that the colophon will be centered on the page and dropped down a bit from the author name.