Pages

Wednesday, August 28, 2013

EPUB STUFF - PART TWO

Continuing the saga of ePub creation. Here's the ePub version of toc.ncx:

<?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 version="2005-1" xml:lang="en" xmlns="http://www.daisy.org/z3986/2005/ncx/">
   
<head>
<meta name="dtb:uid" content="268a4670-ca8a-11e2-8b8b-0800200c9a66" />
<meta name="dtb:depth" content="1" />
<meta name="dtb:totalPageCount" content="0" />
<meta name="dtb:maxPageNumber" content="0" />
</head>

<docTitle>
<text>Your Title</text>
</docTitle>

<docAuthor>
<text>Lastname, Firstname</text>
</docAuthor>

<navMap>

<navPoint id="cp" playOrder="1">
<navLabel><text>Cover</text></navLabel>
<content src="cover_page.xhtml" />
</navPoint>

<navPoint id="tp" playOrder="2">
<navLabel><text>Title Page</text></navLabel>
<content src="title_page.xhtml" />
</navPoint>

<navPoint id="copy" playOrder="3">
<navLabel><text>Copyright Page</text></navLabel>
<content src="copyright.xhtml" />
</navPoint>

<navPoint id="c1" playOrder="4">
<navLabel><text>Chapter 1</text></navLabel>
<content src="chap_1.xhtml" />
</navPoint>

<navPoint id="c2" playOrder="5">
<navLabel><text>Chapter 2</text></navLabel>
<content src="chap_2.xhtml" />
</navPoint>

<navPoint id="c3" playOrder="6">
<navLabel><text>Chapter 3</text></navLabel>
<content src="chap_3.xhtml" />
</navPoint>

<navPoint id="c4" playOrder="7">
<navLabel><text>Chapter 4</text></navLabel>
<content src="chap_4.xhtml" />
</navPoint>

<navPoint id="about" playOrder="8">
<navLabel><text>About the Author</text></navLabel>
<content src="about.xhtml" />
</navPoint>

</navMap>

</ncx>


Copy and paste it into Notepad++. Save a copy in your ePub Making Kit folder before modifying it for the current book.

It would probably be a good idea to get a different identifier number for the ePub edition of your book. You can go back to www.famkruithof.net/uuid/uuidgen and get more than a hundred at a time. Keep a text file with UUID numbers in your book making kit folders; update the list by ticking off the numbers used (saying for what book, what edition, and so forth).

But here’s a tumbling block: Depending on your use of the ePub file, you might now have to get an ISBN from somebody. I believe some distributors (like Smashwords) supply a number for free. You need to look into it.

The first “playOrder” item is the book’s cover. That’s a change. The href is to cover_page.xhtml, the file that contains the tag for the cover image.

After that comes the title page, the copyright page, the chapters (listed one by one, just as in the Kindle ncx file), and ends with the About the Author page. What’s missing is the HTML Table of Contents. That file isn’t strictly necessary for ePub.

Add listings for all your chapters. Save the modified copy of the ncx file in the same folder you've been using to collect your other book parts. If you added navPoints for new chapters, you will probably want to save these changes before closing the template.

Next, the content.opf template:

<?xml version="1.0"?>
<package version="2.0" xmlns="http://www.idpf.org/2007/opf" unique-identifier="BookId">

<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
<dc:title>Your Title</dc:title>
<dc:language>en</dc:language>
<dc:identifier id="BookId" opf:scheme="UUID">268a4670-ca8a-11e2-8b8b-0800200c9a66</dc:identifier>>
<dc:creator opf:file-as="Lastname, Firstname" opf:role="aut">Your Name</dc:creator>
<dc:publisher>Fake-out Publications</dc:publisher>
<dc:date>YYYY-MM-DD</dc:date>
<dc:subject>Type of book</dc:subject>
<dc:description>Say a few words about your book.</dc:description>
<meta name="cover" content="cover" />
</metadata>

<manifest>
<item id="cover_page" href="cover_page.xhtml" media-type="application/xhtml+xml" />
<item id="title_page" href="title_page.xhtml" media-type="application/xhtml+xml" />
<item id="copyright" href="copyright.xhtml" media-type="application/xhtml+xml" />
<item id="chap1" href="chap_1.xhtml" media-type="application/xhtml+xml" />
<item id="chap2" href="chap_2.xhtml" media-type="application/xhtml+xml" />
<item id="chap3" href="chap_3.xhtml" media-type="application/xhtml+xml" />
<item id="chap4" href="chap_4.xhtml" media-type="application/xhtml+xml" />
<item id="about" href="about.xhtml" media-type="application/xhtml+xml" />
<item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml" />
<item id="stylesheet" href="style.css" media-type="text/css" />
<item id="cover" href="cover.jpg" media-type="image/jpeg" />
<item id="title" href="title_page.jpg" media-type="image/jpeg" />
<item id="chap1_start" href="cs-1.jpg" media-type="image/jpeg" />
<item id="chap2_start" href="cs-2.jpg" media-type="image/jpeg" />
<item id="chap3_start" href="cs-3.jpg" media-type="image/jpeg" />
<item id="chap4_start" href="cs-4.jpg" media-type="image/jpeg" />
</manifest>

<spine toc="ncx">
<itemref idref="cover_page" />
<itemref idref="title_page" />
<itemref idref="copyright" />
<itemref idref="chap1" />
<itemref idref="chap2" />
<itemref idref="chap3" />
<itemref idref="chap4" />
<itemref idref="about" />
</spine>

</package>


You’ll find it’s a lot longer, but should be pretty familiar. Save a copy in your ePub Making Kit before making changes.

Modify the Dublin Core for the current book, including the new identifier number. If you’re now using an ISBN in that section, change the “opf:scheme” from UUID to ISBN.

You’ll see the cover listed at the end of the <meta> section, just like before:

<meta name="cover" content="cover" />

It’s also listed in the second half of the <manifest> section, but this time it’s heading up a list of other images: title page and chapter-starts. Delete mention of any images you’re not actually using.

In Kindle you could use jpg, pgn, gif, or bmp images inside the book; in ePub it’s jpg, png, gif, or svg (scalable vector graphics).

There are listings here for just four chapters (with chapter-start image support built in). The version in the Templates section goes to twenty. Add or subtract as needed.

But remember, everything in your book (except the mimetype file and the META-INF folder) needs to be listed in the <manifest>. Otherwise, it won’t pass the validator.

You don’t really need an XHTML TOC in your book, since most e-readers create one from your ncx file. But if you want to add one anyway, just in case, here’s how: Grab the core info from your HTML TOC—from the beginning of the Title header code to the end of the </div> tag—and drop it into one of your book chunk templates. Probably wouldn’t hurt to save this file as a template in your ePub Making Kit.

You’ll have to add this new item to the ncx file and the opf file, naturally. For the ePub’s opf file, it’s almost the same line as in your Kindle-ready version:

<item id="toc" href="toc.xhtml" media-type="application/xhtml+xml" />

Put it somewhere in the <manifest> section. Then add this to the bottom of the <spine>, after the “about” reference:

<itemref idref="toc" />

Put the appropriate listing in your ncx file, too. Again, I suggest you add it at the end. It’s easier. Plus, if a particular e-reader does create a TOC from the navigation map, it would be good to tuck the XHTML version out of the way. The listing is the same as it was in the Kindle ncx file—just add the x in front of the “html” extension.

Your cover image can remain the Kindle-preferred jpg version, but you could have other types mixed in here (for chapter starts or whatever). Just remember to change the media-type. Except for that rascal jpg, media-types copy the image file extension name, letter for letter.

If you followed my advice and let KindleGen resize your display cover when it built your mobi file, you should load the full-size image back into GIMP and make it smaller. Depending on the final destination for this ePub, there may be different specs to follow. I’ve seen 600 x 730 for nook, but also 750 x 1100.

Using the class="wide" notation inside the <img> tag will set your images at 98%, whatever their pixel size.

In the <spine> section you’ll find listed all the relevant stuff: cover page, title page, copyright, chapters, About the Author (and maybe TOC). This is the order they’ll be assembled and listed. Remove any items you’re not using.

If you want your book to open with the cover, you need do nothing. If you’d rather see your title page jump up first, you need to modify the listing:

<itemref idref="cover" linear="no" />

The start of your book will default to the next item on the list, though “Cover” remains the number one guy on your Table of Contents. You can also add the linear="no" spec on the listings for your title page and copyright page, so your book opens on the first page of Chapter One. Up to you.

As you can see, there is no <guide> to worry about in an ePub book’s opf file.

I’m going to break with tradition and suggest you just dump all your images in the OEBPS folder. Of course, if you don’t have chapter-start images, there’s only going to be one or two images to dump there. Some ePub creator programs like to segregate all your stuff into folders: one for the text files, one for images, one for style sheets. But who’s going to see it if you just let everything flop around in one big folder? Take a break—you don’t have to tidy up for anybody.

Also, this way you won’t have to go back and add an IMAGES folder to the path for your images, or a TEXT folder path for your XHTML files, etc.

Now, at last, you’re ready to assemble the package. Open Windows Explorer and navigate to the assembly folder for your book. It should have just three items in there: the mimetype file, a META-INF folder (with “container” inside), and a fully populated OEBPS folder. Right-click on an empty part of the window to open a menu. Maneuver down the list with the cursor to “New” and another list will open. Somewhere (possibly at the bottom) is the selection called “Compressed (zipped) Folder.” Left click there to create an empty zipped folder. Name it for your new book, but keep the zip extension (for now).

Normally I use xplorer2lite for file fiddling. If you have this program, follow the above instructions, but click "Shell new" at the bottom of the menu. Inside you’ll find the same Compressed Folder selection as in Windows Explorer.

Proceed in the following order (it’s important): First, drag the mimetype to the zipped folder. I like to use the right-click drag, selecting Copy from the menu; this way I keep a copy of the files outside the zipped archive—I’ll almost certainly need to fiddle with the HTML before getting the ePub file to validate. Next, tuck the META-INF folder inside. Finally, the OEBPS folder. Now right click the zipped folder, select Rename, and change the extension from zip to epub.

And there you go: an epub version of your book. Not that bad, right?

The official ePub validation Website is run by idpf.org (International Digital Publishing Forum).The site hosts ePubCheck 3.01. You can also download a copy and run this program from your computer, but you need to have Java installed. And you have to run it from the Command Prompt. That's annoying.

I found a program called ePubChecker that runs an older version of ePubCheck (1.0.5) in a Windows GUI environment. It’s a lot easier to use. Just browse to the file you want checked and set it loose. I’ve heard a rival program (Flightcrew) has error messages that are easier to understand. But if you followed my instructions exactly, you’re probably saying, “What error messages?”

After it passes the validation process, go online and run the file through the big guy, ePubCheck 3.01.

I want to thank Aaron Demott (Yoda47) and Liza Daly for their tutorials on ePub creation.

Wednesday, August 21, 2013

EPUB TEMPLATES

<!--here are the files and templates you need to convert your Kindle material to an ePub book-->

<!--the container, which goes inside the META-INF folder-->

<?xml version="1.0"?>
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
<rootfiles>
<rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml" />
</rootfiles>
</container>

<!--this is the contents of the mimetype file-->

application/epub+zip

<!--these are the three items inside an ePub file-->

META-INF
OEBPS
mimetype

<!--the css file template; leave out text-align for ragged right margin-->

body
    {margin-left:3%;
    margin-right:3%;
    margin-top:3%;
    margin-bottom:3%;
    text-align:justify;}

[Add your <style> units here, omit beginning and ending tags.]

=========================================================

<!--this is the template for your book chunk XHTML files; clone them and name them: title page, copyright page, chapter one through whatever, about-the-author page, cover page, and maybe XHTML Table of Contents-->

<?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>EPub Template</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>

[New content goes here...]

</body>
</html>

=======================================================

<!--ncx file template-->

<?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 version="2005-1" xml:lang="en" xmlns="http://www.daisy.org/z3986/2005/ncx/">

<head>
<meta name="dtb:uid" content="[large unique number which matches the one in the opf file - see www.framkruithof.net/uuid/uuidgen]" />
<meta name="dtb:depth" content="1" />
<meta name="dtb:totalPageCount" content="0" />
<meta name="dtb:maxPageNumber" content="0" />
</head>

<docTitle>
<text>Your Title</text>
</docTitle>

<docAuthor>
<text>Lastname, Firstname</text>
</docAuthor>

<navMap>

<navPoint id="cp" playOrder="1">
<navLabel><text>Cover</text></navLabel>
<content src="cover_page.xhtml" />
</navPoint>

<navPoint id="tp" playOrder="2">
<navLabel><text>Title Page</text></navLabel>
<content src="title_page.xhtml" />
</navPoint>

<navPoint id="copy" playOrder="3">
<navLabel><text>Copyright Page</text></navLabel>
<content src="copyright.xhtml" />
</navPoint>

<navPoint id="c1" playOrder="4">
<navLabel><text>Chapter 1</text></navLabel>
<content src="chap_1.xhtml" />
</navPoint>

<navPoint id="c2" playOrder="5">
<navLabel><text>Chapter 2</text></navLabel>
<content src="chap_2.xhtml" />
</navPoint>

<navPoint id="c3" playOrder="6">
<navLabel><text>Chapter 3</text></navLabel>
<content src="chap_3.xhtml" />
</navPoint>

<navPoint id="c4" playOrder="7">
<navLabel><text>Chapter 4</text></navLabel>
<content src="chap_4.xhtml" />
</navPoint>

<navPoint id="c5" playOrder="8">
<navLabel><text>Chapter 5</text></navLabel>
<content src="chap_5.xhtml" />
</navPoint>

<navPoint id="c6" playOrder="9">
<navLabel><text>Chapter 6</text></navLabel>
<content src="chap_6.xhtml" />
</navPoint>

<navPoint id="c7" playOrder="10">
<navLabel><text>Chapter 7</text></navLabel>
<content src="chap_7.xhtml" />
</navPoint>

<navPoint id="c8" playOrder="11">
<navLabel><text>Chapter 8</text></navLabel>
<content src="chap_8.xhtml" />
</navPoint>

<navPoint id="c9" playOrder="12">
<navLabel><text>Chapter 9</text></navLabel>
<content src="chap_9.xhtml" />
</navPoint>

<navPoint id="c10" playOrder="13">
<navLabel><text>Chapter 10</text></navLabel>
<content src="chap_10.xhtml" />
</navPoint>

<navPoint id="c11" playOrder="14">
<navLabel><text>Chapter 11</text></navLabel>
<content src="chap_11.xhtml" />
</navPoint>

<navPoint id="c12" playOrder="15">
<navLabel><text>Chapter 12</text></navLabel>
<content src="chap_12.xhtml" />
</navPoint>

<navPoint id="c13" playOrder="16">
<navLabel><text>Chapter 13</text></navLabel>
<content src="chap_13.xhtml" />
</navPoint>

<navPoint id="c14" playOrder="17">
<navLabel><text>Chapter 14</text></navLabel>
<content src="chap_14.xhtml" />
</navPoint>

<navPoint id="c15" playOrder="18">
<navLabel><text>Chapter 15</text></navLabel>
<content src="chap_15.xhtml" />
</navPoint>

<navPoint id="c16" playOrder="19">
<navLabel><text>Chapter 16</text></navLabel>
<content src="chap_16.xhtml" />
</navPoint>

<navPoint id="c17" playOrder="20">
<navLabel><text>Chapter 17</text></navLabel>
<content src="chap_17.xhtml" />
</navPoint>

<navPoint id="c18" playOrder="21">
<navLabel><text>Chapter 18</text></navLabel>
<content src="chap_18.xhtml" />
</navPoint>

<navPoint id="c19" playOrder="22">
<navLabel><text>Chapter 19</text></navLabel>
<content src="chap_19.xhtml" />
</navPoint>

<navPoint id="c20" playOrder="23">
<navLabel><text>Chapter 20</text></navLabel>
<content src="chap_20.xhtml" />
</navPoint>

<navPoint id="about" playOrder="24">
<navLabel><text>About the Author</text></navLabel>
<content src="about.xhtml" />
</navPoint>

</navMap>

</ncx>

==========================================================

<!--the opf file template-->

<?xml version="1.0"?>
<package version="2.0" xmlns="http://www.idpf.org/2007/opf" unique-identifier="BookId">

<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
<dc:title>Your Title</dc:title>
<dc:language>en</dc:language>
<dc:identifier id="BookId" opf:scheme="uuid">[large unique number which matches the one in the ncx file - see www.framkruithof.net/uuid/uuidgen]</dc:identifier>
<dc:creator opf:file-as="Lastname, Firstname" opf:role="aut">Firstname Lastname</dc:creator>
<dc:publisher>Fake-out Publications</dc:publisher>
<dc:date>YYYY-MM-DD</dc:date>
<dc:subject>Type of book</dc:subject>
<dc:description>Say a few words about your book.</dc:description>
<meta name="cover" content="cover" />
</metadata>

<manifest>
<item id="cover_page" href="cover_page.xhtml" media-type="application/xhtml+xml" />
<item id="title_page" href="title_page.xhtml" media-type="application/xhtml+xml" />
<item id="copyright" href="copyright.xhtml" media-type="application/xhtml+xml" />
<item id="chap1" href="chap_1.xhtml" media-type="application/xhtml+xml" />
<item id="chap2" href="chap_2.xhtml" media-type="application/xhtml+xml" />
<item id="chap3" href="chap_3.xhtml" media-type="application/xhtml+xml" />
<item id="chap4" href="chap_4.xhtml" media-type="application/xhtml+xml" />
<item id="chap5" href="chap_5.xhtml" media-type="application/xhtml+xml" />
<item id="chap6" href="chap_6.xhtml" media-type="application/xhtml+xml" />
<item id="chap7" href="chap_7.xhtml" media-type="application/xhtml+xml" />
<item id="chap8" href="chap_8.xhtml" media-type="application/xhtml+xml" />
<item id="chap9" href="chap_9.xhtml" media-type="application/xhtml+xml" />
<item id="chap10" href="chap_10.xhtml" media-type="application/xhtml+xml" />
<item id="chap11" href="chap_11.xhtml" media-type="application/xhtml+xml" />
<item id="chap12" href="chap_12.xhtml" media-type="application/xhtml+xml" />
<item id="chap13" href="chap_13.xhtml" media-type="application/xhtml+xml" />
<item id="chap14" href="chap_14.xhtml" media-type="application/xhtml+xml" />
<item id="chap15" href="chap_15.xhtml" media-type="application/xhtml+xml" />
<item id="chap16" href="chap_16.xhtml" media-type="application/xhtml+xml" />
<item id="chap17" href="chap_17.xhtml" media-type="application/xhtml+xml" />
<item id="chap18" href="chap_18.xhtml" media-type="application/xhtml+xml" />
<item id="chap19" href="chap_19.xhtml" media-type="application/xhtml+xml" />
<item id="chap20" href="chap_20.xhtml" media-type="application/xhtml+xml" />
<item id="about" href="about.xhtml" media-type="application/xhtml+xml" />
<item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>
<item id="stylesheet" href="style.css" media-type="text/css" />
<item id="cover" href="cover.jpg" media-type="image/jpeg" />
<item id="title" href="title_page.gif" media-type="image/gif" />
<item id="chap1_start" href="cs-1.gif" media-type="image/gif" />
<item id="chap2_start" href="cs-2.gif" media-type="image/gif" />
<item id="chap3_start" href="cs-3.gif" media-type="image/gif" />
<item id="chap4_start" href="cs-4.gif" media-type="image/gif" />
<item id="chap5_start" href="cs-5.gif" media-type="image/gif" />
<item id="chap6_start" href="cs-6.gif" media-type="image/gif" />
<item id="chap7_start" href="cs-7.gif" media-type="image/gif" />
<item id="chap8_start" href="cs-8.gif" media-type="image/gif" />
<item id="chap9_start" href="cs-9.gif" media-type="image/gif" />
<item id="chap10_start" href="cs-10.gif" media-type="image/gif" />
<item id="chap11_start" href="cs-11.gif" media-type="image/gif" />
<item id="chap12_start" href="cs-12.gif" media-type="image/gif" />
<item id="chap13_start" href="cs-13.gif" media-type="image/gif" />
<item id="chap14_start" href="cs-14.gif" media-type="image/gif" />
<item id="chap15_start" href="cs-15.gif" media-type="image/gif" />
<item id="chap16_start" href="cs-16.gif" media-type="image/gif" />
<item id="chap17_start" href="cs-17.gif" media-type="image/gif" />
<item id="chap18_start" href="cs-18.gif" media-type="image/gif" />
<item id="chap19_start" href="cs-19.gif" media-type="image/gif" />
<item id="chap20_start" href="cs-20.gif" media-type="image/gif" />
</manifest>

<spine toc="ncx">
<itemref idref="cover_page" />
<itemref idref="title_page" />
<itemref idref="copyright" />
<itemref idref="chap1" />
<itemref idref="chap2" />
<itemref idref="chap3" />
<itemref idref="chap4" />
<itemref idref="chap5" />
<itemref idref="chap6" />
<itemref idref="chap7" />
<itemref idref="chap8" />
<itemref idref="chap9" />
<itemref idref="chap10" />
<itemref idref="chap11" />
<itemref idref="chap12" />
<itemref idref="chap13" />
<itemref idref="chap14" />
<itemref idref="chap15" />
<itemref idref="chap16" />
<itemref idref="chap17" />
<itemref idref="chap18" />
<itemref idref="chap19" />
<itemref idref="chap20" />
<itemref idref="about" />
</spine>

</package>

======================

<!--if you add an XHTML TOC, add this to the <manifest> section-->

<item id="toc" href="toc.xhtml" media-type="application/xhtml+xml" />

<!--add this to the bottom of the <spine>-->

<itemref idref="toc" />

<!--to get your ePub to open after the cover page, modify the listing in the <spine> section-->

<itemref idref="cover" linear="no" />

=========================================================

<!--assembling the ePub file with zip.exe, use these lines at the command prompt-->

zip book.epub -DX0 mimetype

zip book.epub -rDX9 META-INF OEBPS

<!--end of ePub templates-->








EPUB STUFF - PART ONE

Here's one way to convert your Kindle book into an ePub. This is mostly just busy work, filling out templates, copying stuff from one place to another, and making the final assembly.

Start off by creating a new folder on your computer. It can run right alongside “Kindle Books” and could be called “ePub Books.” Inside that folder create another called “ePub Making Kit” or the equivalent.

In many ways, the ePub version resembles a Kindle book: HTML files of your text, an opf file to direct traffic, an ncx file to create your Table of Contents, a style sheet to boss folks around, tell ’em how to do their jobs. All of these guys are packed into a folder traditionally called OEBPS (Open EBook Publication Structure).

Sitting next to the OEBPS folder is another one called META-INF. Inside that folder is a single file, called the “container.” The container tells the ebook reader where to find the opf file—even though everybody expects to find the opf file in the same place: the folder called OEBPS.

Here’s the text of the container:

   <?xml version="1.0"?>
   <container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
   <rootfiles>
   <rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml" />
   </rootfiles>
   </container>


Once you’ve assembled your first META-INF folder, you can use it for every ePub book you make.

Sitting beside these two folders (OEBPS and META-INF) is a file called the “mimetype.” This file contains one short line of text:

   application/epub+zip
And it’s the same for every ePub book you’ll ever create.

As you approach the final assembly, you’ll have a folder dedicated to your new book with just those three items:

   META-INF
   OEBPS
   mimetype


You will then zip these items into a single file. I’ll get into the details in a future post.

The main work of putting together an ePub is tearing your HTML file apart, dropping the parts into separate XHTML templates, and lining everything up in the OEBPS folder.

Here's the template for the standard chunk:

   <?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>EPub Template</title>
   <link rel="stylesheet" type="text/css" href="style.css" />
   </head>
   <body>
   
   [New content goes here...]
   
   </body>
   </html>

First, prepare your ePub Making Kit. Load copies of the mimetype. Create a META-INF folder and put the “container” file inside. Paste a copy of the “book chunk” template into Notepad++ and clone it repeatedly, naming the copies for: title page, copyright page, chapters one through whatever, the “about the author” page, and the cover page. Save the files like this in your ePub Making Kit folder:

    title_page.xhtml
    copyright.xhtml
    chap_1.xhtml
    chap_2.xhtml
    chap_3.xhtml    (etc.)
    about.xhtml
    cover_page.xhtml


Open your ePub Books folder and create the assembly folder named for this book. Working from your ePub Making Kit, put a copy of the mimetype file there, as well as a copy of the META-INF folder (with the “container” file inside). Finally, make a new folder for everything else called OEBPS.

Open the HTML file of your book in Notepad++. If you’re at all worried the file might be damaged, create a backup copy and open that instead.

Make sure it says “ANSI as UTF-8” in the bottom right of the screen. If it says something else, click “Encoding” and select “Convert to UTF-8 without BOM.” Save the file, then check Encoding again: It should be set to Encode in UTF-8 without BOM.

Open a new document in Notepad++. This is going to be your style sheet template. Start by adding this code (it's also found in the ePub Making Template on the right-hand sidebar):

   body
       {margin-left:3%;
       margin-right:3%;
       margin-top:3%;
       margin-bottom:3%;
       text-align:justify;}


This code begins by creating a border margin for everything. There's also a fascinating little item called “text-align.” Leave that guy set to “justify” and you’re going to have the same problems with your ePub book as you did with the Kindle edition.

Delete that line and you get a ragged right margin. You could even run your completed ePub file through KindleGen and create a mobi that would allow Kindle Fire apps to follow suit. (Mobi apps stay justified, however.)

Below this starting portion, add the contents of the <style> section of your HTML file. Leave off the top and bottom tags.

IMPORTANT: Don’t click the “save” icon, which may be your habit by now after making changes to a file.

Instead, click File and select “Save a Copy As”; drop the item in the OEBPS folder you just created for your new ePub book. Name it:

    style.css

Undo the latest changes to the template (but keep the first chunk) and save it in the ePub Making Kit folder, ready for use on your next book.

Open the title_page.xhtml template and copy either the title page image tag or the header code from your book. Don’t include the ID code unless you also plan to add an XHTML Table of Contents. It would probably be best to remove any width and height specs that call the size in pixels. Rely on your 98% spec for width, either by writing it into the tag or using the wide class. (You do have a wide class copied to your CSS style sheet, right?) Save a copy in the OEBPS folder; undo changes and close the template.

(Actually, if you use an image file for your title page—and you always call the image “title_page.jpg,” you could keep the changes to the completed template file. Saving it now will update the template for use in your next book.)

Open the copyright.xhtml template. Copy the copyright chunk out of your book into the template. Save a copy in the OEBPS folder; undo changes and close the template.

(Again, you could save the populated template; it would be good for the rest of the year, at least.)

Open up the chap_1.xhtml template. Highlight the contents of chapter one in your book—everything from the beginning of its chapter-start (image tag or header code) to just before the page-break code at the end—and drop it into the template. Save a copy in the OEBPS folder; undo changes in the template and close.

Repeat for the rest of your chapters. If you need more templates, copy one and name it appropriately. When you’re done saving the new chapter, empty out the template and save it for the next book.

Open the about.xhtml template and drop in your “About the Author” section. Save a copy in your OEBPS folder; undo the changes and close the template.

(Or keep the changes and update the file with every new book—especially if you end your profile with a list of available books.)

Open the cover_page.xhtml template. This is where you put the image tag that points to your cover. You’ll have to write one just for the ePub version of your book. Following the pattern, save a copy in the OEBPS folder; undo the changes and close the template. (Or save it just the way it is, as long as the names of all your cover images stay “cover.jpg.”)

Close the HTML file of your book, you’re done with it.

Next time, the special files—the ncx file, the opf file, an XHTML Table of Contents; plus: how to assemble and test your ePub book.

Tuesday, August 20, 2013

TWO FREE BOOKS - RESULTS

Two of my books were recently on the free list at Amazon.

The last two times I gave away books, the total for the first day alone equaled nearly 90% of the entire run. This time it was a little different.

First day for MAD MINUTE: 60% of the total.

First day for EXPLODING WIZARD: 40% of the total.

Sales of HOT STATUS: 67% of the total.

For the first four days, totals dropped every day for MAD MINUTE. WIZARD followed that trend, with the exception of the fourth day, which saw nearly a fifty percent rise over the third day.

The first TWO days business averaged 72% of the eventual total action.

The first four days ran in a row from Tuesday to Friday and the event was advertised on five book promotion sites. The fifth day came a few days later and was unadvertised. (I was running out of time to use up my Select promo days, so I dumped them all out there.)

The totals from the fifth day were better than the fourth day of the advertised session. That means folks were stumbling onto these books on their own, just by perusing Amazon's site.

Although the percent-of-total number was not nearly as dramatic as the first two giveaways, I still think it makes sense to limit these freebie sessions to one or two days at a time.

And definitely get some listings on the promotion sites.

Comparing the two thrillers, well more than twice as many copies of MAD MINUTE were given out on the first day as the first days for HOT STATUS. Probably a lot of folks who got the earlier book for free took the opportunity to grab the sequel for free, too.

But overall there were 50% more copies of the sequel given out than the prequel, so I think that represents progress.

Comparing the adult thriller to the kid's fantasy novel: MAD MINUTE accounted for two and a half times the downloads.

On the other hand, the thriller had THREE and a half times the words. And took one hell of a lot longer to write.

All in all, having three or four books in a children's fantasy series out there would probably make you more money than one thriller. More books means more exposure.

And if you had four books in a series, you could probably give the first one away for free every day. That couldn't hurt.

Speaking of four books, MY fourth book is due out any minute now, but it's not part of any series. It's not even fiction.

More about that later.

Sooner, than later...

Monday, August 12, 2013

TWO FREE BOOKS

Since I'm approaching the end of my first ninety day period of Kindle Select, I've decide to put my other two book out there for free.

Starting tonight at midnight and running through Friday, MAD MINUTE and THE EXPLODING WIZARD'S RIGHT-HAND BOY will be free on Amazon. Four free days.

MAD MINUTE is the sequel to HOT STATUS. They're both techno thrillers and action/adventure novels about air defense missile.

WIZARD is a middle-grade chapter book, a whimsical fantasy set in an alternate Los Angeles in the 1950s.

I'll let you know the results.

Last time, when I gave away HOT STATUS for two days, I had seventy-some downloads (90% in the first day)—and five sales of the other books (four of them the sequel, MAD MINUTE).

Inch by inch, right?