Wednesday, October 19, 2016

Q&A

I got an email yesterday which will perhaps interest others:
I read your book Notjohn's Guide to .. 2016. Which is very good but I could not find an answer to my basic question. I'm finishing my hopefully sixth and final edit of my non-fiction book which is typed on a current version of Word.

Q: I've typed my book in word in the style in which I would expect to see the final book, namely indented paragraphs at 0.3, justified margins, bold chapter numbers and titles, oversized headings of H1, H2 , etc. If the html style tags ultimately give these same commands to the epub, should I have typed the manuscript with no indentation, no bold or oversized chapter headings, etc? Will html result in excessive paragraph indentation, oversized headings, etc? 
A good question, to which I replied:
Are you going to use Word2CleanHtml.com and Sigil with the style sheet from my blog? If so, it doesn't really matter. Word2Clean will probably show all paragraphs as [p] but if it gets fancy with sometime like [p class="normal"] you can just do a search and replace in Sigil to change them instantly. (I'm using square brackets because Gmail software doesn't permit angled brackets. Of course you would substitute < for [ and so on.)
I use Word to build the basic book, especially if there's going to be a print edition. So all my paragraphs are indented except for the first para in a chapter or major section. Word2Clean doesn't seem to care -- they all come back as plan [p] tags, so all I have to do is go find the ones I don't wanted indented and change that to [p class="first"].
Good luck! -- NJ

Sunday, January 10, 2016

New & improved for 2016!


Notjohn's Guide to Kindle Publishing is now in its seventh edition on the Amazon stores, revised and updated for 2016. And, for the first time, also for sale on Barnes & Noble, Google Play, and several other e-book retailers.

I became an Amazon e-publisher eight years ago, 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.) Then I discovered the wonders of the free and excellent Sigil software, which builds 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 as a fallback I also provide Plan B -- the Ultimate Basic Template that you can adapt to your own book. (And also a Plan C, in case you're still not convinced.) 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

Thursday, November 12, 2015

A new version of Sigil

In my book and on this blog, I often have occasion to recommend the free, open software Sigil as a way of building your e-book. Sigil is regularly improved and updated by a dedicated handful of programmers. The most recent release is Sigil 0.9.X, and it is a major change, as they work toward making the software amenable to the Epub3 format. You can find the latest version here: https://github.com/Sigil-Ebook/Sigil/releases

Likely you want either the Mac package or one of the two Windows versions. I download Windows-Setup.exe because I have a 32-bit machine. Most people running Windows 7, 8, or 10 have 64-bit machines.

Once downloaded, I strongly recommend that you go to Edit > Preferences > General Settings and make sure that Version 2 is selected. If you want to play about with Epub 3, that's great, but learn to walk before you fly.

And download the Flight Crew plug-in from https://github.com/Sigil-Ebook/flightcrew/releases (it's a zip file that, once opened, will install itself when you click on the exe file contained within it). If you don't do this, then you absolutely must validate your epubs online at http://validator.idpf.org/ (a good idea anyhow!).

Tuesday, July 21, 2015

All about e-publishing

What I know about publishing e-books through Amazon's KDP platform (updated August 2015):

Helpful forums

Amazon maintains the Kindle Publishing forum that I visit often, and where I and others will answer  formatting questions. And there's an especially good Kindle Formats forum on MobileRead dot com. And of course Ask the Community on the Kindle support pages, though it's heavy on disgruntled people and bad advice.

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. (The more recent your version of Word, the better it works. Word 2000 is terrible; Word 2013 isn't bad.) If you're determined to go this route, here are some free resources:

Shauna Kelly on using Word (Basic Concepts, Styles, and Tips for Using Styles)
Tech Republic advanced formatting tips
Amazon's simplified guidebook
Mark Coker's Smashwords guide
JT Bigtoad's rules for formatting Word
Tips for Formatting Your Book Correctly in Microsoft 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 it has converted (Step 7 in the publishing process). The downloadable Kindle Previewer gives the best results. Download it and your converted mobi file, and check it in all the available 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.

If all else fails

If you're ready to move on from Word, but html and Sigil terrify you, there are three purpose-built word processors that will help you advance: Jutoh, Scrivener, and Atlantis Word Processor. Each costs about $40 and has a trial version, each will give you some control over formatting, and each will create an epub you can upload to the KDP or any other e-tailer. From my limited experience with these softwares, I would be inclined to favor Jutoh.

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.5em;
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

Copy everything below this paragraph and paste it into a text editor like Notepad++. Paste in your book text as appropriate, preferably as clean html. Save the document with the extension *.htm and open it in Sigil.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<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.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>
</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">2016</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.