Anda di halaman 1dari 23

Creating Kindle Ready eBooks with formatting

Formatting Your Ebook for Kindle: .Mobi File Format – The .HTML Component – Part 1

Harpooning .Mobi Dick

No one calls me Ishmael, but I’m taking on the white whale first–the .mobi file format for Amazon’s
Kindle. It’s not my intention to give an exhaustive review of all the possible ebook formatting
options. This is a clip and paste-able resource to format your own ebook from my files because my
formatting looks good and has better functionality that some major publishers.

As I stated on the prior post in this series, there are three required files, not counting image files, to
generate the .mobi file: the .html file, the toc.ncx file, and the .opf file. I’m going to discuss the .html
file first.

The actual name is 3LIES.html. I created it using Macromedia’s Dreamweaver. There are a zillion html
editors out there. I used Dreamweaver because I own it and because it let me keep my paragraph and
italic formatting intact when I clipped and pasted my manuscript from Word to Dreamweaver. More on
that in a later post.

Keep all the files you create for this in a separate folder on your computer. There’s a good reason for
this, and I’ll explain the reason, later. Mine is named 3LIESMG, where MG stands for .mobi
generation. Don’t put any spaces in your file names. .Mobi won’t care, but if you want to pub on Apple
iBooks, the matter will come up later. Better to use clean practices to keep from going crazy later, in my
opinion.

My assumption is that you have some experience with HTML, or at least your spirit is intrepid. If you
can clip and paste, you can format your own ebook for Kindle. I will present the code in the order it is
listed in my .html file from beginning to end. My novel, 3 LIES, has ninety chapters, so my examples will
be complete, i.e. working, but will not show the redundant functionality for all ninety chapters. If you
start with the HTML code in this post, add to it the HTML code from the subsequent posts in this series,
and keep it precisely in order presented, it will be a complete HTML sample file from which you can
create an HTML file for your book, and–along with the other required files–generate your own working
.mobi file. Then upload.

Like I said, clip and paste, baby, clip and paste.

NOTE: When you clip & paste into Notepad ++ the quote marks may get changed to so-called smart
quotes. If so, use search function and replace with straight quotes.

I’ve listed below the beginning <html> declaration (the close is at the end of my .html file), <head> , the
<title>, the <meta>, and the <style> sections of my .html file. The <title> is in BOLD because you will
need to change this to your own title. Any item shown in BOLD within the code needs to be replaced
with your information. But I think you will figure this out:

<html>

<head>

<title>3 LIES</title>

<meta http-equiv=”Content-Type” content=”text/html; charset=ANSI” />

<style type=”text/css”>

h1 {

text-align: center;

text-indent: 0;

h2 {

text-align: center;

text-indent: 0;

h3 {

text-align: center;

text-indent: 0;

h4 {

text-align: center;

text-indent: 0;

h5 {

text-indent: 0;

}
.center {

text-align: center;

text-indent: 0;

.noind {

text-indent: 0;

.right {

text-indent: 0;

text-align: right;

.left {

text-align: left;

.gray {color:#808080;}

</style>

</head>

I didn’t even use all the <style> declarations that are in this section, such as h1, h2, h3, et cetera. I
clipped and pasted this myself, remember.

Next up, the <body> section. This will not close until the end, as this is where all your precious words
will reside:

<body>

<h1 height=”20″><img src=”3LiesTitle.png” alt=”img” /></h1>

<p height=”10″>by</p>

<p height=”20″><img src=”HelenHanson.png” alt=”img” /></p>

<p>&nbsp;</p>
<p height=”30″><img src=”Dominologo1.jpg” alt=”img” /></p>

<mbp:pagebreak />

The above code creates a title page. It shows up just after my embedded cover image. The cover image
is listed in the .opf file, not in the .html file, so you’ll have to trust me on this. I have three images on
this title page, the logo of my book name, my name in logo form, and the logo of my publishing
company. The <mbp:pagebreak /> tag is required to generate a page break.

I admit, I had to fuss with this page to get it the way I wanted it to look. Even then, Kindle and Kindle for
PC will display things differently. The h1 designator, as shown in the <style> section above,
automatically centered my 3 LIES title logo. But I wasn’t happy using the h1 for the other items, as the
spacing between each wasn’t right.

Formatting Your Ebook for Kindle: .Mobi File Format – The .HTML Component – Part 2

The Heart of the Whale – The .html file – Table of Contents

Now that we have .mobi’s head and body on a harpoon, lets get to the heart of the beast. First up, the
table of contents. When done correctly, this will appear in your ebook as a clickable link list that the
reader can use to jump to that particular section of the book. In addition to chapters, you can set up
sections for acknowledgements, excerpts from other books, or whatever else you might want to put in
the thing.

NOTE: When you clip & paste into Notepad ++ the quote marks may get changed to so-called smart
quotes. If so, use search function and replace with straight quotes.

When a reader uses the Kindle Menu to Go To the Table of Contents, it takes the reader to a page that
looks like in my book, 3 LIES;

TABLE OF CONTENTS

Chapter One

Chapter Two

Chapter Three

Chapter Four

Chapter Five

Chapter Six

Chapter Seven
Here’s what the code in the .html file will look like:

<a id=”TOC”/><h3>TABLE OF CONTENTS</h3>

<p width=”-30″ class=”left” height=”10″><a href=”#start”>Chapter One</a></p>

<p width=”-30″ class=”left”><a href=”#chap2“>Chapter Two</a></p>

<p width=”-30″ class=”left”><a href=”#chap3“>Chapter Three</a></p>

<p width=”-30″ class=”left”><a href=”#chap4“>Chapter Four</a></p>

<p width=”-30″ class=”left”><a href=”#chap5“>Chapter Five</a></p>

<p width=”-30″ class=”left”><a href=”#chap6“>Chapter Six</a></p>

<p width=”-30″ class=”left”><a href=”#chap7“>Chapter Seven</a></p>

<mbp:pagebreak />

Let’s discuss the two parts of this section that are critical and changeable, the anchor and the name of
the link:

<p width=”-30″ class=”left”><a href=”#chap2“>Chapter Two</a></p>

The name of the link is Chapter Two. This is the part that readers will see and where they will expect to
land. Whatever you type in that section will appear with an underline, indicating that it is a link.

This piece: <a href=”#chap2“> holds the anchor. Precisely, the anchor the bolded characters between
the # and ” make up the name of the anchor, in this case, chap2 is the anchor. Anchors are like an
address that marks the landing spot for anyone clicking on that link. Anchor names must be unique, as
addresses can only refer to one specific place.

Anchor names are never seen by the reader. It’s used for internal purposes only. I’ll show you the
landing spots, or how the anchors are used when we get to that section. For now, they need to be
declared.

I used anchor names that made sense to me, chap2 for Chapter Two, chap3 for Chapter Three, and so
on. Whatever you use for chapter or section names here, should be the same thing you repeat at the
beginning of your chapter or section later in the .html file. I’ll show you this, too, when we get there.
Some people prefer chapter titles with non-numerical names. That works, just be consistent.

NOTE: The anchor for Chapter One is different, it is called start. Unless you have a prologue, keep
the start anchor on your first chapter, and it must be the exact word, start. This designates the
beginning of the book when the ebook file is first opened or when using the Kindle Menu to GO TO the
Beginning. Unless you’ve got a really good reason to force people elsewhere, people expect the
beginning to be the first section of your manuscript.
For my novel, I had all ninety chapters listed with corresponding anchors in my table of contents. I also
included other sections which were not part of the manuscript, but were part of the published
ebook. My Table of Contents link list went for several Kindle pages.

To add more chapters for your table of contents, clip and paste one of the chapter lines, change the
anchor and chapter name. Rinse and repeat until you have enough to cover your needs. Make sure
that the final item on this section is the page break, as shown in my code above: <mbp:pagebreak />

Formatting Your Ebook for Kindle: .Mobi File Format – The .HTML Component – Part 3

.Mobi – The Whale’s Tail

Today I’m going to finish the .html file. Ta. Da.The first chapter of my novel, 3 LIES, is quite short, but
for ease of moving through this, I’ve only included the first five paragraphs. Think of it this way: It’s like
adding a column of numbers with a calculator. Once you know how to add two numbers, including the
third through tenth is easy.

NOTE: When you clip & paste into Notepad ++ the quote marks may get changed to so-called smart
quotes. If so, use search function and replace with straight quotes.

The hardest part, for me–in moving my written words from my document to an html format–was
keeping the indentation and italics. I didn’t have a lot of unusual formatting, but I also didn’t want to
have to hand code this stuff. Specifically, I didn’t want to add the <p> at the beginning of each paragraph
and the </p> at the end of each paragraph, as shown in the example below. This entire section of code is
a working chapter, starting with an anchor and ending with a page break:

<a id=”start”/>

<p>&nbsp;</p><p>&nbsp;</p>

<h3>Chapter One</h3>

<p>&nbsp;</p><p>&nbsp;</p>

<p>The water bead on her chest slalomed south to join the others on the black-diamond run to her
groin. Beth Sutton wrapped the thick, white towel around her dripping hair. Both hung to her hip. As
she stepped onto the bath mat, the arterial catheter bounced off her inner thigh muscle. She wiped
down the rest of her body and draped the towel on the rack.</p>

<p>Clint left her house at eleven the night before with a promise to return for breakfast prior to their
fishing trip. Another evening absorbed in unguarded conversation. Their two months together passed
with an easy contentment.</p>
<p>She should have dialyzed last night, but she’d fallen asleep too soon, cocooned in fading dreams,
down, and enchantment. The evening proved too satisfying to interrupt for blood filtering. He’d
offered to help. Again.</p>

<p>Maybe he could really handle it. Maybe not. Maybe she wasn’t ready to test him.</p>

<p>A knock came from her door as she dressed.</p>

<mbp:pagebreak />

I could have added the <p> at beginning and the </p> at the end of each paragraph. It works. Instead, I
clipped the entire chapter from my .doc file and used the Paste Special, option, within Macromedia’s
Dreamweaver which maintained the paragraph, quotation, and italics formatting already in my
manuscript. And it didn’t add other junk. This worked best for me. Other HTML editors likely do this. If
anyone has a consistently clean way to move text with limited formatting, I’d love to hear about it.

UPDATE:

Thanks to this post by Guido Henkel, I now know how to clip and paste from a word processor to an
HTML editor without hand coding the tedious stuff. I no longer need to rely on Dreamweaver. I used his
method to clip, paste, and adjust my text in NotePad ++, a free html editor, and it worked. Mystery
solved.

Nice, clean and predictable in HTML

Open your programming editor (See Part III of the series for a quick discussion of programming editors),
create a new file and paste your text into it. You will notice that all formatting is lost, and that is just as
well. In fact, that is what we want. It is probably the most important step of the entire process, to get rid
of the unpredictable word processor formatting. We will now begin to massage our text back to shape
with a few, elegantly applied steps.

Once you got over the shock that all formatting is lost, you may also notice that every paragraph of your
original text is now in one single, long line. (If that is not the case, you should adjust the line width of the
editor to its maximal possible length through the Options settings.)

We will use this fact to our advantage and wrap every single line with a paragraph tag. This can be easily
done using a regular expression search and replace. Regular expressions are extremely cryptic and I do
not expect you to understand how they work, so just follow the next few instructions, if you may.

Open the search and replace window in your editor and make sure Regular Expressions are enabled.
Occasionally you may find a checkbox in the search window, so give it a quick look. Now enter ^(.+)$ as
the search term. Then enter <p>$1</p> in the replacement line. Run the search and replace across the
entire text and take a look at your results. Every line of text should now be wrapped neatly by an
opening <p> and a closing </p> tag. If they are not, your editor might use a slightly different syntax.
Undo whatever the editor just did and enter <p>\1</p> in the replacement line instead of the previously
used enter <p>$1</p> replacement term. Run the replacement and check the results. If it is still not
correct, your editor might not support regular expressions.

In theory you could do these replacements in your word processor also, though quite honestly, I don’t
really trust them that well, and personally prefer the use of a programming editor instead, which is also
significantly faster.

END UPDATE

Notice the first item from the section of code above is the tag <a id=”start”/>.This is the first anchor to
show up from the table of contents created in the last post. Since the anchor is start, it declares this spot
to be the exact beginning of the book. Not a line up. Not a line down. Exactly. Since the last line before
this anchor is a page break, I can place my chapter name precisely. Also, it is not in bold, so don’t change
the name of the start anchor.

I like two blank lines above my chapter name and two below. I tried using just the paragraph tag with
nothing in between, <p></p>, but it did nothing. I used the code <p>&nbsp;</p><p>&nbsp;</p> to force
hard spaces, essentially a paragraph with a blank line. It’s got the paragraph markers, but the odd bit in
the middle – &nbsp; – forces a hard space. This gives me two blank lines above and below my chapter
title, which I think looks best.

You don’t like it. Do it another way.

Be advised, it looks the way I want it to on the actual Kindle, but I don’t get all my blank lines in the
Kindle for PC. Go figure. If anyone knows why this is so, please leave a comment. I could spend a lot of
time figuring out why, but I only have so many arrows in my quiver. I intend to make them count.

For all other chapters or sections, remember, you need to define your own anchors. I used chap2 and
chap3, as anchor names for, you guessed it, Chapter Two, and Chapter Three. These would be laid out
identically as the above section. Here’s a complete, if brief, Chapter Two which would follow on the
heels of the above code for Chapter One:

<a id=”chap2“/>
<p>&nbsp;</p><p>&nbsp;</p>

<h3>Chapter Two</h3>

<p>&nbsp;</p><p>&nbsp;</p>

<p>According to Paige Masters, Clint’s almost ex-wife, he never noticed anything. But the white Chevy
van pulling out of Beth’s road caught his attention. At least the sound of the V-8 engine rumbling
under the hood did. Between a full-size and a mini, that van never left the factory boasting anything
larger than a V-6. Dull and gutless by reputation, the piece of junk couldn’t get jacked during a
riot.</p>

<p>A throaty roar from the vehicle broke his expectation, like a Swedish accent from the lips of a
black man. While the kiddies tried to give the illusion of raw power under the hood without the
trouble of an actual engine swap, this van camouflaged its strength with exhaust silencers. With rear-
wheel drive and a torquey V-8, that homely white box could spank a Mustang in a quarter mile.</p>

<p>Don’t say he didn’t notice anything. Hell yes, he noticed.</p>

<mbp:pagebreak />

Do chapter three next, and rinse and repeat until you get to the last chapter or section of your book.
Leave off the page break after the last section because it only gives the reader an unnecessary blank
page at the end of the book

I promised to have all the code necessary to create a working .mobi file at the end of this series. So I
need to add this section of code to keep that promise:

<a id=”chap3“/>

<p>&nbsp;</p><p>&nbsp;</p>

<h3>Chapter Three</h3>

<p>&nbsp;</p><p>&nbsp;</p>

<p>From the ambient light of the building, Amir tracked a snowflake as it fluttered earthward. It
joined a trillion others from the endless Colorado winter that already lay on the four hundred-acre ski
resort. At this altitude, the mountain would wear black for perhaps another hour—no more. With
eighty-seven inches of base snow and another four of fine, fresh powder, skiers from across the globe
looked forward to a day on the slopes. Amir, however, was not there for pleasure.</p>

<p>He unstrapped the modified 9 mm Glock from under his pant cuff and connected it to the silencer.
The weapon slid into the pocket of his parka, awaiting orders. Dark sunglasses covered his eyes and a
faux fur-lined hood shrouded his face. The padded clothing belied the dense musculature of his
physique. </p>

<mbp:pagebreak />

<a id=”chap4“/>

<p>&nbsp;</p><p>&nbsp;</p>

<h3>Chapter Four</h3>

<p>&nbsp;</p><p>&nbsp;</p>

<p>Paige extended a velvety hand to Clint that he took by rote. Her wedding ring still clung to her
finger. She unfolded–slowly, deliberately, closely–into a long, limpid woman. Her sable hair scraped
the purple silk on her shoulders as she swayed. </p>

<p>His chest thumped in rhythm to each of her steps down the ladder. Her signature perfume
congested his thoughts. He grabbed the aft rail to steady his shaking knees and drew deeply from a
salted breeze to blow it out of his brain.</p>

<p>Her eyes were the same color as a quail’s. He’d forgotten that. He’d known Paige for twenty-five
of his thirty-two years–nine of them as man and wife–yet he’d forgotten the color of her eyes in only
three months. He remembered them blacker and harder with none of the warmth that now spread
over him. </p>

<mbp:pagebreak />

<a id=”chap5“/>

<p>&nbsp;</p><p>&nbsp;</p>

<h3>Chapter Five</h3>

<p>&nbsp;</p><p>&nbsp;</p>

<p>The pain in Beth’s hip throbbed her awake. She rubbed the tender spot, felt a knot within her
flesh. Her eyes struggled to open under the assault of harsh light. With each flicker of vision, she
calculated her surroundings. She wasn’t at home. Nor did she think she was anywhere she’d ever
been before, not even a place she’d drifted to in the realm of her dreams. </p>

<mbp:pagebreak />

<a id=”chap6“/>

<p>&nbsp;</p><p>&nbsp;</p>

<h3>Chapter Six</h3>
<p>&nbsp;</p><p>&nbsp;</p>

<p>He and Paige lived in different houses for over nine months. Months before that she started to
keep her distance. How they landed in bed at all that night still baffled him.</p>

<p>What a moron. He thought sex meant reconciliation. He asked her again to join him in marriage
counseling. Her answer came to his door a week later as a summons.</p>

<mbp:pagebreak />

<a id=”chap7“/>

<p>&nbsp;</p><p>&nbsp;</p>

<h3>Chapter Seven</h3>

<p>&nbsp;</p><p>&nbsp;</p>

<p>What the hell was this?</p>

<p>Routine agent updates, surveillance reports, even the occasional defector–each transaction
corresponded to a code, which might appear on the daily activity report. Doug Bryant knew these
codes like grocery checkers knew the codes for produce. Field agents or the operatives running the
missions entered some of the activities listed on his report. Computers generated other codes due to
anomalies in monitored activities. The code that showed on today’s report was entirely
unfamiliar. </p>

</body>

</html>

If you have particular coding needs, you may need to learn a bit of HTML to get your ebook to appear as
you want it. Google it. HTML italics–For instance, and you will get more webpage hits than you can
handle. When I clipped and pasted my stuff, it kept the paragraph formatting and the italics
formatting. But here’s an example of how it is done

What did you say to him?

This is what that code would look like in the .html file:

What did you <em>say</em> to him?

Wrapping the word – say – in the <em></em> tag makes it look italicized when it is displayed.
There are a zillion things you can do to fancy-up your book’s display in an ereader, and these are
beyond the scope of my mission. If you take all the code sections I’ve presented, place them in the
proper order, you’ve got a working .html file to use when you generate your .mobi file.

From here, fancy it on up. The .html file skeleton is complete. I’m dusting off my hands.

Formatting Your Ebook for Kindle: .Mobi File Format – The toc.ncx File – Part 4

The toc.ncx stands for Table of Contents Navigation and Control for XML or eXtended Markup
Language. It’s a straightforward, if dull, little file. One of the benefits is that it activates the Kindle
joystick to recognize Chapter Jumps. This allows the reader to sequentially jump to the first page of
each chapter by using the joystick. I’ve seen ebooks published by big houses that don’t use this feature,
including a For Dummies book. This feature is handy on a novel but essential on a nonfiction
work. There’s no excuse not to have it.

Like George Foreman’s sons, this file keeps the same name over and over, regardless of the name of
your book. Consequently, I have multiple versions of a file called toc.ncx on my hard drive. That’s
another reason I create a new folder for each book. I need to keep these straight.

NOTE: When you clip & paste into Notepad ++ the quote marks may get changed to so-called smart
quotes. If so, use search function and replace with straight quotes.

The entire toc.ncx file is listed below. Remember to change the sections in bold type as needed to suit
your work.

<?xml version=”1.0″ encoding=”UTF-8″?>

<!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″>

<docTitle>

<text>3 LIES</text>

</docTitle>

<navMap>

<navPoint playOrder=”1″>

<navLabel>

<text>Chapter One</text>
</navLabel>

<content src=”3LIES.html#start”/>

</navPoint>

<navPoint playOrder=”2″>

<navLabel>

<text>Chapter Two</text>

</navLabel>

<content src=”3LIES.html#Chap2“/>

</navPoint>

<navPoint playOrder=”3″>

<navLabel>

<text>Chapter Three</text>

</navLabel>

<content src=”3LIES.html#Chap3“/>

</navPoint>

<navPoint playOrder=”4″>

<navLabel>

<text>Chapter Four</text>

</navLabel>

<content src=”3LIES.html#Chap4“/>

</navPoint>

<navPoint playOrder=”5″>

<navLabel>

<text>Chapter Five</text>

</navLabel>
<content src=”3LIES.html#Chap5“/>

</navPoint>

<navPoint playOrder=”6″>

<navLabel>

<text>Chapter Six</text>

</navLabel>

<content src=”3LIES.html#Chap6“/>

</navPoint>

<navPoint playOrder=”7″>

<navLabel>

<text>Chapter Seven</text>

</navLabel>

<content src=”3LIES.html#Chap7“/>

</navPoint>

</navMap>

</ncx>

Everything above the tag <doc file> documents the file type in use. Next comes the <doc title>. Then
the main function: <nav map> or the navigation map.

The navigation map section is the bulk of the file and contains the <nav point> tags or navigation point
for every chapter or section of your ebook. My novel, 3 LIES, contained over ninety of these, ninety
chapters, plus some other sections. Clip, paste, and modify this section to cover all your chapters and
ebook sections. This file repeats some of the information contained in the .html file, but it serves a
slightly different purpose. Let’s look more closely at the first <nav point> in the file for my Chapter One:

<navPoint playOrder=”1″>

<navLabel>

<text>Chapter One</text>

</navLabel>
<content src=”3LIES.html#start”/>

</navPoint>

Note the first line within the nav point tag where it lists: id=”navPoint-1″ playOrder=”1″. This identifies
this nav point as number 1. This number is unique to this item. The playOrder determines the order of
the Chapter Jumps via the joystick. This also should be an unique number.

In my example file above, my play order consists of only seven elements. These are : Chapter One,
Chapter Two, Chapter Three, Chapter Four, and so on to Chapter Seven. If I am reading this seven-
chapter book on my Kindle, and I am on the first page of Chapter Three, moving the joystick to the right
will land me on the first page of Chapter Four. Moving the joystick to the left will land me on the first
page of Chapter Two. Makes sense, eh?

As you add chapters or sections, you need to change the navPoint number and the playOrder. For my
chapters 1 through 7, the navPoint number and the playOrder also increment from 1 to 7.

The <Nav Label> is next and lists the name of my chapter. This should match exactly with the names I
used in my .html file. The <content source> tag identifies the name of the .html file where the chapter
identified actually exists. This is the .html file created in the previous posts. Whatever name you called
that file must be used here.

The <content source> tag also lists the exact same anchor we used in the .html file for each chapter and
section. The anchor listed for Chapter One is start. For Chapter Two it is chap2. For Chapter Three it
is chap3. And for Chapter Four it is chap4, and so on. To add chapters, copy, paste, and modify this nav
point code, before the </navMap> tag, until your book is complete.

Formatting Your Ebook for Kindle: .Mobi File Format – .OPF File – Part 5

The final player in our .Mobi drama is the .opf file – Open Packaging Format. It is what is known as a
build file. The Kindlegen program will use the .opf file to call the other files to generate the .mobi file for
your ebook.

NOTE: When you clip & paste into Notepad ++ the quote marks may get changed to so-called smart
quotes. If so, use search function and replace with straight quotes.

I’m extremely fond of disclaimers, so here’s a big one: In the same way that I don’t understand every
the facet of the car I drive, the word processor I use, or the cell phone service I employ, I don’t know
what every line of this code in this file does, exactly. I could research it and document it here, but I
don’t care. I know that it works, and all I wanted was a reliable recipe for ebooks.

With that said . . . the entire file, which I have named 3LIESforBlog.opf, is listed below:
<?xml version=”1.0″ encoding=”utf-8″?>

<package unique-identifier=”uid”>

<metadata>

<dc-metadata xmlns:dc=”http://purl.org/metadata/dublin_core”
xmlns:oebpackage=”http://openebook.org/namespaces/oeb-package/1.0/”>

<dc:Title>3 LIES</dc:Title>

<dc:Language>en-us</dc:Language>

<dc:Identifier id=”uid”>978-0-9832027-0-7</dc:Identifier>

<dc:Creator>Hanson, Helen</dc:Creator>

<dc:Publisher>DOMINO INK</dc:Publisher>

<dc:Subject BASICCode=”FIC031000“>Thriller</dc:Subject>

<dc:Description>At CIA headquarters, a young officer discovers that terrorists may have
commandeered their computer systems to launch an unauthorized mission. Elsewhere, conspirators
abduct nine people to manipulate the rules of their game. Two disparate ambitions — Clint Masters
becomes the reluctant link in the chain of danger.<br />

Ever since Clint’s almost ex-wife dumped him, he bobs along the Massachusetts coast in a sailboat
with his black lab for company. He avoids all forms of technology, a counterintuitive effort for the
burned-out founder of CatSat Laboratories. Tired of clutching the brass ring, he needed to untether,
step off the corporate treadmill, and smell a flower. Fortunately, he met one, a beautiful, unspoiled
woman who doesn’t treat him like a commodity. His relationship with Beth offers more promise than
his marriage ever did, even if she is on dialysis for her recovering kidneys, until she disappears.<br />

In spite of the evidence, her family refuses to admit she’s in danger. Without routine dialysis, she
won’t survive. As Clint realizes that he loves Beth, damn-near ex-wife Paige sashays back into his life
with disturbing news.<br />

While the CIA young gun tracks his quarry, Clint enlists the help of two men to find Beth, a blithe Brit
named Merlin, and Todd, his playboy partner-in-tech. But Clint must find Beth before her kidneys fail.
And before someone unloads a bullet in his head.<br />

</dc:Description>

<dc:Date>12/3/2010</dc:Date>

</dc-metadata>

<x-metadata>
<output encoding=”utf-8″ content-type=”text/x-oeb1-document”></output>

<EmbeddedCover>3Lies6X8-1.png</EmbeddedCover>

<SRP Currency=”USD“>2.99</SRP>

<Demo>3LIESSample.prc</Demo>

</x-metadata>

</metadata>

<manifest>

<item id=”item1″ media-type=”text/x-oeb1-document” href=”3LIES.html“></item>

<item id=”toc” media-type=”application/x-dtbncx+xml” href=”toc.ncx”></item>

</manifest>

<spine toc=”toc”>

<itemref idref=”item1″/>

</spine>

<tours></tours>

<guide>

<reference type=”toc” title=”Table of Contents” href=”3LIES.html%23TOC”></reference>

<reference type=”start” title=”Startup Page” href=”3LIES.html%23start”></reference>

</guide>

</package>

For discussion purposes, I’m skipping down to the line that starts with <dc:Title>. All the code above
that point contains document declarations. If you want more details, check out the Dublin Core site.
They defined the standards and that is what the dc in <dc:Title> stands for. Other than that, I’m not
interested.

But from the <dc:Title> on down, you can start making changes to suit your ebook where the
information is in bold. These <dc: tags are highly self-explanatory and contain the following
information, in order: my book title, the language in which the book is written, my ISBN, my name, the
name of my publishing Co, and the BISAC code and the genre.
I just noticed that the BISAC code is misspelled as BASIC. It didn’t throw an error, so maybe it doesn’t
matter. Maybe it’s supposed to show somewhere and doesn’t. Need to investigate, but not today.

11/15/11 UPDATE: I recently released my new novel DARK POOL. In the course of generating my new
.mobi file, I corrected the misspelling of BISAC (from BASIC), and it worked just fine. It’s likely that the
prior information was ignored when I misspelled it. I corrected my 3 LIES files as well.

Look up your BISAC code. It stands for Book Industry Systems Advisory Committee, and I’ll read up on it
some time when I can’t sleep.

Next comes the description of my novel, 3 LIES, and the publication date.

Okay, now back to something interesting:

<x-metadata>

<output encoding=”utf-8″ content-type=”text/x-oeb1-document”></output>

<EmbeddedCover>3Lies6X8-1.png</EmbeddedCover>

<SRP Currency=”USD”>2.99</SRP>

<Demo>3LIESSample.prc</Demo>

</x-metadata>

There are two pieces you want to edit here. The Embedded Cover is what a reader who buys your book
will see when they use the MENU button on the Kindle and then Go To the cover. You still need to
upload a second file at Amazon so that a cover will show up in the Kindle Store.

I uploaded the same file at Amazon that I embedded here. To use all the real estate on your Kindle
screen, you want an image that is exactly 600 pixels wide by 800 pixels tall. This will fill the frame and
won’t add any white space. I use .png files and .jpg files interchangeably, at least for this purpose.

SIDE NOTE ON COVER ART: When you upload later at Amazon, they allow an image that can be as small
as 500 pixels or as large as 1280 pixels on a side. Again I used the same 600 X 800 file. The actual space
Amazon makes available at the sales page is a square. For instance, if I copy the image for 3 LIES from
the sales page to my hard drive, I get a 300 X 300 square with my rectangular cover art nicely centered
amid white space. If I click on the “see larger image” link and download that, it is 500 X 500. Whatever
you upload, they will shrink to meet their specs, but retain the aspect ratio of the original. Since I
wanted mine to look like a book, as opposed to a square CD cover, and didn’t want the image distorted,
I used the same file. If you search on the MP3 downloads available at Amazon, those covers are usually
square.

Moving on, the next item after my embedded cover file is the price. My novel is set at an affordable
price of $2.99 USD. Ta. Da.
This next line <Demo>3LIESSample.prc</Demo> is a bit of a puzzler. I’m not entirely sure what it
does. I think it becomes the name of the sample file that is used at Amazon. Kindles can read .prc
files. If anyone reading this has better information on this, please leave a comment. I matched the
name of my HTML file with this. For example, if your HTML file is called JAWS.html, then I would name
this piece JAWSSample.prc. Get in the habit of being sensitive to case, epub formatting can be case
sensitive.

Finally we get to the manifest, where your other two files are called out for processing. You just need to
make sure your file name matches exactly here. Again, I don’t recommend spaces in file names:

<manifest>

<item id=”item1″ media-type=”text/x-oeb1-document” href=”3LIES.html“></item>

<item id=”toc” media-type=”application/x-dtbncx+xml” href=”toc.ncx”></item>

</manifest>

I have no idea what this section does. It somehow defines the table of contents and the start position
within the book. Other than that, well, you know, if it works, I’m good.

<guide>

<reference type=”toc” title=”Table of Contents” href=”3LIES.html%23TOC”></reference>

<reference type=”start” title=”Startup Page” href=”3LIES.html%23start”></reference>

</guide>

I do try to investigate the unknowns because I don’t like to share information if I don’t understand
it. But the time involved in spent in figuring it out, isn’t worth it to me. I don’t do this for hire. So if the
answers don’t come quickly AND the thing works, I move on. I’ve got a novel to finish.

Formatting Your Ebook for Kindle: .Mobi File Format – Kindlegen.exe – Part 6

I hope someone is looking forward to this post because I’m not. Trying to explain the DOS prompt to
people who have never seen it, to people who had no idea it was still available on Windows, or to
people who danced in the streets the day Windows 95 finally introduced GUI to the PC-compatible
market may well tax my communication skills to the breaking point.

But, hey, a promise is a promise.

Before we get to DOS prompts, let’s review what we need in place before we can start. You should have
all the data files and image files within a single folder on your hard drive. As I stated in a previous post,
I created a folder on my C: drive called 3LIESMG. You can create your folder wherever you like, but you
need to know the path to it. Based on what I’ve presented in previous posts, these are the files I have in
my folder:

3LIES.html

toc.ncx

3LIESforBlog.opf

3Lies6X8-1.png

3LiesTitle.png

HelenHanson.png

Dominologo1.jpg

We need to add one more file to this folder: kindlegen.exe. On this page there’s a Kindle previewer you
can download to emulate a Kindle to verify what your ebook will look like. I prefer this to the Kindle for
PC program, as it really does look like the output as if it were on a Kindle, Kindle for PC doesn’t in every
case. Plus, it’s easier that moving the file to my actual Kindle. Download that too, if you wish.

I keep several copies of Kindlegen.exe. Whenever I have a new project, or I’m experimenting, I drop a
copy of it into the appropriate folder. In my 3LIESMG folder, there are now eight items: three data files,
four image files, and kindlegen.exe

Now we come to the command prompt, or DOS prompt. Here’s how you find it on Windows 7. They
this link if you have a different operating system.

You need to follow this series of four links on Windows to find the Command Prompt. Ready?

Go to: Start, All Programs, Accessories, Command Prompt.

Did you find it? If you did, the command prompt looks like an old-timey blackboard. Depending on your
operating system, and the computer path, the information listed will look something like this:

Microsoft Windows [Version 6.1.7601]

Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Helen>

The part that reads C:\Users\Helen> is the path to a folder called Helen. Notice your cursor is blinking
just after the >. You can type on this blackboard. The first thing you need to do is change the path to
point to your desired folder. This is the path to my folder: C:\3LIESMG
Now I can’t just type that in. I must now summons my early education and use some old-fashioned DOS
commands., in this case change directory, or cd. Here’s what I will type on the command line at the
blinking cursor to change the existing path to my desired path.

cd c:\3LIESMG

Now my old-timey blackboard shows the following:

Microsoft Windows [Version 6.1.7601]

Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Helen>cd c:\3LIESMG

c:\3liesmg>

The blackboard adds the new bits, along with a running list of everything I typed and everything that
existed prior, until it scrolls off the top. The command prompt should now list the correct path to your
folder. If not, find someone old-timey to help you get there.

Now comes the moment we’ve all been waiting for, you type two more things and Voila!, you should
have a shiny new file in your folder called 3LIESforBlog.mobi. Here’s what you type at the flashing
cursor next to the path to the folder:

c:\3liesmg>kindlegen 3LIESforBlog.opf

Then hit enter and stand back.

The following is a list of the line-by-line processing outputs that occurs when the .mobi file is being
generated, starting at the line of asterisks. If there was an error, it would choke somewhere along the
way. Where it chokes is a clue as to the thing causing it to fail. In this case, notice the last line of the
processing, before it dumps me back at the command prompt: Info(prcgen): MOBI File successfully
generated! Ta! Da!

Microsoft Windows [Version 6.1.7601]

Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Helen>cd c:\3LIESMG

c:\3liesmg>kindlegen 3LIESforBlog.opf

***********************************************

* Amazon.com kindlegen(Windows) V1.1 build 99 *

* A command line e-book compiler *


* Copyright Amazon.com 2010 *

***********************************************

opt version: try to minimize (default)

Info(prcgen): Added metadata dc:Title “3 LIES”

Info(prcgen): Added metadata dc:Date “12/3/2010″

Info(prcgen): Added metadata dc:Creator “Hanson, Helen”

Info(prcgen): Added metadata dc:Publisher “DOMINO INK”

Info(prcgen): Added metadata BASICCode “FIC031000″

Info(prcgen): Added metadata dc:Subject ”Thriller”

Info(prcgen): Added metadata dc:Description “At CIA headquarters, a young offic

er discovers that terrorists may have commandeered their computer systems to lau

nch an unauthorized mission. Elsewhere, conspirators abduct nine people to manip

ulate the rules of their game. Two disparate ambitions ? Clint Masters becomes t

he reluc

Info(prcgen): Added metadata Retail price “2.99″

Info(prcgen): Added metadata Retail currency “USD”

Info(prcgen): Parsing files 0000001

Info(prcgen): Resolving hyperlinks

Info(prcgen): Building table of content URL: c:\3liesmg\toc.ncx

Info(prcgen): Computing UNICODE ranges used in the book

Info(prcgen): Found UNICODE range: Basic Latin [20..7E]

Info(prcgen): Found UNICODE range: General Punctuation – Windows 1252 [2018..201

A]

Info(prcgen): Building MOBI file, record count: 0000002

Info(prcgen): Compiling HTML Parser restart information


Info(prcgen): Final stats – text compressed to (in % of original size): 055.03%

Info(prcgen): The document identifier is: “3_LIES”

Info(prcgen): The file format version is V6

Info(prcgen): Saving MOBI file

Info(prcgen): MOBI File successfully generated!

c:\3liesmg>

Check your folder for the new .mobi file. With this in hand, you can put it up on your Kindle or an
emulator and verify that you are happy-happy-happy with the end result before you slap your name and
a price tag on it for the reading public.

Anda mungkin juga menyukai