How We Published a Book!, Part 1: Publishing to Kindle

In the last few weeks, a project that I was working on with my wife and father-in-law came to fruition: we published a book! Specifically, he wrote the book, Robin helped edit, and I helped him to publish it in both Kindle format and paperback.

TOTALLY BIASED ENDORSEMENT: If you are a runner and looking for some inspiration and lessons learned, I highly recommend it!

It was a long process (over a year, on and off!) and I relied heavily on other bloggers to find tips and tricks to make it all work. I decided that I ought to pay it forward and talk through the process we followed, and the lessons learned. (Ok, I admit that this is as much for remembering it myself when the next book comes around as it is for everyone else to learn.)

These posts will consist of three parts: this one, the first, will explained the process of getting a Kindle book published through Kindle Direct Publishing, or KDP. The second will explain how we generated a PDF and cover to publish a paperback through Createspace. The third and final post will detail a few lessons learned that we will use for the next book and what we recommend to any aspiring self-publishing authors.

Ok, let’s get down to business. One of the best sources I used for creating the Kindle version of the book was How to Make a Kindle eBook from Scratch by Alicia Ramirez.

Overhead

There are three files that you need to have outside the book content. The first two are basically text files with some specialzed tags. First, you’ll need an OPF (Open Packaging Format). The OPF is mostly card-catalog data, including the name of the book, author, and publishing details, plus a list of the files included in the book (called the ‘manifest’). That text file looks like this:

<?xml version="1.0" encoding="utf-8"?>
<package unique-identifier="uid" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:asd="http://www.idpf.org/asdfaf">
<metadata>
<dc-metadata  xmlns:dc="http://purl.org/metadata/dublin_core" xmlns:oebpackage="http://openebook.org/namespaces/oeb-package/1.0/">
<dc:Title>Running Around The World: Lessons Learned from Life on the Roads</dc:Title>
<dc:Language>en</dc:Language>
<dc:Creator>David Bishop</dc:Creator>
<dc:Copyrights>David Bishop</dc:Copyrights>
<dc:Publisher>David Bishop</dc:Publisher>
<x-metadata>
<EmbeddedCover>images/Cover5a.jpg</EmbeddedCover>
</x-metadata>
</dc-metadata>
<meta name="cover" content="images/Cover5a.jpg">
</metadata>
<manifest>
<item id="ncx" media-type="application/x-dtbncx+xml" href="ratw.ncx"/>
<item id="ratw" media-type="text/x-oeb1-document" href="ratw.html"/>
<item id="cover" href="images/Cover5a.jpg" media-type="image/jpeg">
<item id="mobicss" media-type="text/css" href="mobi.css"/>
<item id="ratwcss" media-type="text/css" href="ratw.css"/>
</manifest>
<spine toc="ncx">
<itemref idref="ratw"/>
</spine>
<guide>
<reference type="text" title="Book" href="ratw.html"/>
</guide>
</package>

Additionally, you’ll require an NCX (Navigation Center eXtended) file, which is a set of links to allow your readers to use the Kindle “slide-in pane” to navigate through the book. This isn’t strictly speaking necessary, but it is super annoying to find your place in a book without it. The NCX is also in a text file, using XML syntax. Note the bits that say <content src="ratw.html#something"> — for each of those, there needs to be an HTML tag in the body content that says something like, <h3 id="something>Something</h3>.


<?xml version="1.0"?>
<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN"
"http://www.daisy.org/z3986/2005/ncx-2005-1.dtd">
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
<head>
</head>
<docTitle>
<text>Running Around the World: Lessons Learned from Life on the Roads</text>
</docTitle>
<navMap>
<navPoint id="navpoint-1" playOrder="1"><navLabel><text>Front Matter</text></navLabel><content src="ratw.html#kathy"/></navPoint>
<navPoint id="navpoint-1" playOrder="1"><navLabel><text>Table of Contents</text></navLabel><content src="ratw.html#toc"/></navPoint>
<navPoint id="navpoint-2" playOrder="2"><navLabel><text>Section 1: Family &amp;amp; Friends</text></navLabel><content src="ratw.html#sec1"/></navPoint>
[some stuff omitted ...]
<navPoint id="navpoint-3" playOrder="3"><navLabel><text>Acknowledgements</text></navLabel><content src="ratw.html#acknowledgements"/></navPoint>

</navMap>
</ncx>

Finally, the cover image must be part of the package. I will go into more detail in part 2 about how we created our cover, but please note that this is not a post about graphic design, and I can’t claim any special expertise in that area.

I can say here, though, that the KDP guidelines require an image that is 2560 pixels by 1600 pixels with 350ppi, and be 5 MB or smaller.

Body

The body of the text needs to be written in XHTML (eXtensible Hypertext Markup Language), similar to HTML, which is the language that defines web pages. This is where having your book well-organized comes in: you’ll need to add XHTML tags to delineate chapter titles, TOC items, and paragraphs. Ms. Ramirez did an excellent job of providing examples, so I’ll just replicate them here:

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Your Book Title</title>
<link type="text/css" href="mobi.css" media="amzn-mobi" rel="Stylesheet"/>
<link rel="stylesheet" href="style.css"  type="text/css" />
</head>
<body>
<!-- Your book goes here -->
</body>
</html>
<div id="toc">
<h2>
Table of Contents <br />
<img src="images/ornament.png" width="75" alt="----------" />
</h2>
<ul>
<li><a href="#over">Overture</a></li>
<li><a href="#pro">Prologue</a></li>
<li><a href="#ch1">Chapter 1</a></li>
<li><a href="#ch2">Chapter 2</a></li>
<li><a href="#epi">Epilogue</a></li>
</ul>
</div>
<mbp:pagebreak />
<h2 id="ch2">Chapter Two</h2>

<div class="center"><br><img src="images/ornament.png" width="75" alt="----------"></div>

<h3>Subtitle</h3>

<blockquote>
<p>Some quote</p>
</blockquote>

<p>Lorem ipsum dolor sit amet, consectetur ... </p>
<p>Lorem ipsum dolor sit amet, consectetur ... </p>
<p>Lorem ipsum dolor sit amet, consectetur ... </p>
<p>Lorem ipsum dolor sit amet, consectetur ... </p>
<div class="center">* * *</div>
<p>Lorem ipsum dolor sit amet, consectetur ... </p>
<p>Lorem ipsum dolor sit amet, consectetur ... </p>
<p>Lorem ipsum dolor sit amet, consectetur ... </p>
<mbp:pagebreak />

Also, any “special” characters need to be converted into their html code. For example, emdashes (—) are denoted with &mdash;, the character ä is represented with &auml;.

Finally, you need to have a CSS file that identifies how you want to format each element. For example, the below specifies margins for paragraphs and headings; makes all h3 headings centered and italicized, and creates a class called “center” (used in the above examples) that centers text.

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

h1 {margin-top: 1em}
h2 {margin: 2em 0 1em; text-align: center; font-size: 2.5em;}
h3 {margin: 0 0 2em; font-weight: normal; text-align:center; font-size: 1.5em; font-style: italic;}

.center { text-align: center; }

If the sight of all this code is intimidating, perhaps the best approach is to download the sample books and modifying those files with your own content.

Building the .mobi files

Once all of the files are prepared, then they can be passed through kindlegen, a program that takes your files and produces a MOBI file, the format used in Kindle devices. If there are any problems with your files, the warnings and errors outputted by kindlegen will help you find them.

Previewing the .mobi files

Once the MOBI file has been generated, there are several ways to see what it looks like. For Windows and Mac platforms, there is a program from Amazon called Kindle Previewer that seems intuitive and easy to use. For Linux as well as Mac and Windows, a program called Calibre can do almost the same thing.

Our approach, however, was a little different because we found that desktop programs don’t accurately reflect how the book looks on an actual reading device. To get your new MOBI file on an actual Kindle or Kindle iOS app, you can email it to your Kindle email address, or you can save it to a cloud drive (we used Dropbox) and open the file on your iOS device. Using this process we were able to ensure the book looked the way we wanted it to on the actual device people would be using to read the book.

Uploading to Amazon

Once the book looks the way you want it, it needs to be uploaded to the Amazon website through Kindle Direct Publishing, for which the process is pretty self-explanatory. Perhaps the most difficult part of this process is deciding what price to put on the book!

Alternatives

Admittedly, many authors won’t have the patience to deal with this computer nerd stuff. While writing at the level of HTML gives the author a great deal of control over the look and feel of the book, it may be too steep a learning curve for some. In that case, I recommend taking a look at Scrivener, an all-in-one writing and publishing software available for a small price.

Thoughts on the Cadet Honor Code and Moral Failure, 20 Years In

It occurred to me recently that it was twenty years ago this summer that I entered West Point as a new cadet.  I don’t know why, but I started reflecting on the Cadet Honor Code in light of my time there and perspectives I gained since then.

First, a brief history of the Honor Code.  The Honor Code grew from the Corps of Cadets, and until the 1970s, was completely cadet-administered. The Honor Code says,

A cadet shall not lie, cheat, or steal, nor tolerate those who do.

Violations of the Honor Code were reported to the Honor Committee, who would hold a hearing to determine whether the violation was more likely than not.  Cadets who were found in violation were subject to the Silence–no one would speak to them except for in execution of official duties.  Very few could bear the ostracism and would therefore resign from the Academy.

In the 1970s, however, there were several cases where the Silence was broken because the cadets’ friends couldn’t bear to impose such a punishment.  Additionally, there were questions raised as to the legality of such a system.

Fast forward to the late 1990s, while I was a cadet: the Honor Code had become a formalized feature of Academy life.  Violations of the Honor Code were still examined by a panel of cadets (which, thankfully, I was never a part of on either side). However, a cadet who was found in violation would then be referred to the Superintendent (a 3-star general) who would develop a program for rehabilitation that might include a stint in the Army as an enlisted soldier, or some kind of service, or (in some cases) expulsion.

For the most part, these changes have been good.  A part of the process that got ugly, though, was the inclusion of lawyers in the process. One particular case involved one of my classmates who was caught on-camera our senior year shoplifting watches from the Post Exchange.

This case was about as open and shut as it could be–she clearly had stolen something.  The attorney assigned to the case insisted that the “charges” should specify the number of watches stolen, and insisted that the burden of proof was “beyond a reasonable doubt” rather than “more likely than not”.  When it was not clear in the video whether she had stolen four watches or only three, the attorney threw the case out. When the Honor Captain appealed to the Commandant of Cadets, the Commandant refused to re-start the case for fear of putting somebody in double jeopardy.

This case, among others, caused many cadets to be cynical about the Honor Code. “Don’t believe the hype.” “A cadet shall not lie, cheat, or steal, as long as you can prove it.” We all felt that honor was important, and were frustrated that the true state of honor at USMA didn’t match the facade.  Many, many cadets yearned for a return to the days of the hard line drawn on honor violations, the Silence, and total cadet ownership of the process, including me.

My opinion has changed though.

What happened in the shoplifting case was really bad and unhealthy. But so is an atmosphere of zero-tolerance. In zero-tolerance environments, faults and failures are not caught, are carefully covered up, and there is no room for growth and development that come with repentance.

Cadets in the “good old days” were no more honest than they are today. In fact, the dishonest ones were probably better at hiding their lies because of the catastrophic consequences of being found out. Those bad habits and moral failings remained under the surface, only to found when the stakes were much higher: names such as Jefferey Sinclair, William Ward, and David Hale probably don’t resonate much with the public, but certainly the high-profile failures of David Petraeus do.

Petraeus in particular was a perpetually shooting star: top 5% of his class at West Point, top of his class at Command & General Staff College, commander of some of the most prestigious units throughout his career–the man, most believed, could do no wrong.  In light of his recent misconduct, one is left to wonder: what other moral failings did he have that he successfully hid away?

I hypothesize this was not the first time he acted badly; it was only the first time he got caught. How might things have been different had he been caught doing this kind of thing as a lieutenant or captain? I would argue he may have been forced to recognize his own flaws and develop personal safeguards when confronted by temptation.

A healthy organizational climate recognizes that people can and will fail morally–that all people are sinners–and that a moral failure can be costly, but recoverable. It is in this kind of climate that develops leaders who are robust to failure when it counts most.