Book Read Free

Kindle Formatting: The Complete Guide to Formatting Books for the Amazon Kindle

Page 9

by Joshua Tallent


 

D



 

date formats, 24



 

     See also specific types of transfers



 

data packets



 

     bus protocol overview, 22



 

     packet field formats, 97-99



 

     in transfers, 56, 67 Fig. 3



 

data signal rise and fall time. See rise and fall times



 

E



 

“end” encoding, 45



  When the text is formatted, you can add links to the page numbers. This is most easily done with a regular expression like this:

  Find: (, )([0-9-]+)(-*[0-9]*)

  Replace: 123

  That RegEx will find all of the numbers in the index that are preceded by a comma, including page number ranges. With the number links added, you should have something like this:

 

D



 

date formats, 24



 

     See also specific types of transfers



 

data packets



 

     bus protocol overview, 22



 

     packet field formats, 97-99



 

     in transfers, 56, 67 Fig. 3



 

data signal rise and fall time. See rise and fall times



 

E



 

“end” encoding, 45



  Notice that the page range is only linked to the beginning page. The reader can easily move forward in the book from that point, so there is no need to split the numbers out and link each one. Also, the link to Figure 3 on page 67 is not a regular page number link. I do suggest that you take the reader directly to the item they are being pointed to, especially when that item is not the first thing on the page. In addition, the “See” link is pointing the reader to another section of the Index. The link name can be anything you want, but I suggest leaving it similar to the topic text, but without any spaces. You will need to add an tag in front of that entry in the index.

  On the Kindle 1, when the user clicks their scroll-wheel on the line of their choice, a dropdown menu will appear with a list of the active links on that line. If any of your index items has a long list of numbers, you will need to add some
tags to the paragraph to break it up a bit. The drop-down menu only shows a total of 13 items, and then only when none of those items is long enough to wrap in the menu.

  If your index is long, you will probably want to add a list of alphabetical links at the top of the index so that your users can easily skip around and find what they are looking for. For example:

 

A  |  B  |  C  |  D  |  E

  F  |  G  |  H  |  I  |  J

  K  |  L  |  M  |  N  |  O

  P  |  Q  |  R  |  S  |  T

  U  |  V  |  W  |  X  |  Y  |  Z



  Notice that I have used four non-breaking spaces and a vertical line (  |  ) to separate the letters. Those could be replaced with only non-breaking spaces, with commas, or with anything else that breaks up the letters a little. Also, I centered the list using the stylesheet class name “center” discussed on page 55.

  The subheadings for your index will need anchors to match these links, and you may want to add a page break in front of each subheading to break up the list.

  Chapter 7

  Creating a Mobipocket eBook

  Amazon’s purchase of Mobipocket in 2005 gave them a soild foundational format on which to base their Kindle books. While the ePub format offers more formatting options and supports more CSS rules, the Mobipocket format is certainly robust enough to handle a large array of book types.

  Since the Kindle format is essentially the Mobipocket format, the DTP will automatically create a basic Mobipocket book from the files you upload. If you give it a Word document, you will get the same essential results from the DTP that you would get from loading that Word document into the Mobipocket Creator software. If you upload your source HTML, the process works the same way.

  However, there are some tangible benefits to creating your own Mobipocket file and uploading that to the DTP. (Also, if you are large publisher who is providing books to Amazon directly, you are much better off handling this part of the process yourself if at all possible.)

  One main benefit is the addition of a key navigation feature to the final book on the Kindle 2. If you add a toc.ncx file to your Mobipocket book as described below, the Kindle 2 will include navigational waypoints along the path of your book. A Kindle 2 user could then click the joystick right or left when reading to move between these waypoints. Unfortunately, this feature is not available on the Kindle 1.

  Another benefit to making a Mobipocket file is that it gives you the opportunity to sell your book through Mobipocket’s eBookBase, an eBook distribution system that reaches many more readers through a long list of online retailers. In addition, there are other marketing and sales opportunities that become available when you have your file in the widely-accepted Mobipocket format.

  A third potential benefit of creating a Mobipocket file is the ability to encrypt your Kindle book with Digital Rights Management (DRM), if you are so inclined. Books uploaded to the DTP as an HTML file will be sold in a DRM-free format. That means the purchaser can change the extension on the AZW file to PRC and read the book on any Mobipocket-supported device or on a PC. DRM locks the AZW file specifically to the purchaser’s Kindle account. If you want your book to be sold with DRM encryption, you can create a DRMed Mobipocket file and upload that to Amazon. Without getting into the pros and cons of using DRM here, I will say that I usually suggest to my clients that they not use DRM, since it removes the ability for the purchaser of the book to transfer it between devices, effectively tying the user to one device for as long as they own the book.

  Getting Set Up

  Now that you know the reasons why to create a Mobipocket file, let’s talk about how to get ready to do that. First, Mobipocket Creator, the program you will be using, only runs on Windows. If you are using a Mac or Linux computer you will need to switch over to a Windows machine to use the software. There are some other programs that will create a Mobipocket file from a variety of file types (the best I know of is calibre—http://calibre.kovidgoyal.net/), but think Mobipocket Creator is the easiest to use, especially since it is made for that one purpose. You can download Mobipocket Creator here:

  http://www.mobipocket.com/en/downloadSoft/ProductDetailsCreator.asp

  Once you have installed it, open the program and you will be taken to the Home screen. The Home screen gives you a variety of options f
or creating new Mobipocket books, importing and converting a book, and publishing books to Mobipocket’s eBookBase. When you create or import a file in Mobipocket, the program will save your file to a default Publications location, usually in your Documents directory. If you would like to change that default directory, you can do so using the Settings button at the top of the window.

  Importing and Preparing the Book

  To import your HTML file into Creator, drag and drop it onto the Creator Window. Alternatively, you can click on “Import from Existing File, HTML Document”, then click the Browse button and find the HTML file that way. If you want to make the Publications directory for this book different than the default, you can make that change on the Import page. When you are ready, Click the Import button and click Save at the top of the Creator window.

  Go to the Publication directory and open the folder for your book. Inside you will see a copy of the HTML file you imported, as well as an OPF file. The Open Packaging Format (OPF) is a standard XML format for ePub and Mobipocket eBooks that ties together the various pieces of the text. The data you input into Creator will be saved in this OPF file, but you can also easily edit or create the file in a text editor like Notepad++.

  Here is a sample OPF file:

  <?xml version="1.0" encoding="utf-8"?>

 

 

 

  The Four Million

  en-us

  2402C08241

  Henry, O.

  eBook Architects

  General Fiction

  25 delightful tales by O. Henry, the master of the surprise ending.

  03/19/2009

 


 

 

  cover.jpg

  0.99

  FourMillionSample.prc

 


 


 

 

 

 


 

 

 


 

 

 

 

 


 


  As you can see, the data in the file is pretty straightforward. It has metadata about the book, a manifest of the files associated with it, and a guide that helps with navigation. These pieces are almost all added within the Mobipocket interface, so there will be very little you need to do within this XML code.

  You will also need to copy any image files you have to this Publication directory.

  Cover Image

  Now that your file is imported, you can start adding the metadata and preparing to build your book. On the left side of the Creator window you will see a list of options. Select Cover Image from this list.

  The cover image you insert into Creator needs to be at least 1200 pixels on the long side. Larger is fine, but 1200px seems to work well and does not increase the eBook file size too much. You can leave the cover image in color and at its default DPI.

  This brings up another benefit to creating a Mobipocket file for your book: when the book is loaded onto the Kindle 2, the cover image will default to display full-screen, without any of the header or footer information, which makes it look very nice on the Kindle 2 screen.

  Make sure you press the Update button below the cover image when you are finished selecting the right one.

  Table of Contents

  The next item in the options menu is the Table of Contents. If you did not create a TOC earlier in your process, you can use the automated system here to generate a TOC file based on your book’s headings. I do not suggest using this feature because you have more control over the formatting when you create it yourself.

  However, there is another very important feature concerning the Table of Contents that should not be ignored. As I mentioned at the beginning of this chapter, there is a toc.ncx file that allows users of the Kindle 2 to easily navigate within a book, using the joystick to jump between chapters. This NCX file follows another XML format that is part of the ePub standard. Here is a sample NCX file:

  <?xml version="1.0" encoding="UTF-8"?>

 

 

 

  The Four Million

 


 

 

 

  Chapter 1

 


 

 

 

  Subheading 1

 


 

 


 

 

  Subheading 2

 


 

 


 


 

 

  Chapter 2

 


 

 


 


 


  As you can see, the NCX file has essentially the same information as your TOC. The TOC info is broken down into a nested structure, with each element enclosed in a navPoint tag. That tag is given a unique id and playOrder, both of which can be sequential numbers. You can choose to include only your top-level headings, or you can include more headings. The text of the heading is placed inside a navLabel tag, and the source of that heading is included in the content tag.

  Once the NCX file is created, you will need to make sure it is mentioned in the manifest and spine in your OPF file, as was shown in the sample OPF above:

 

 

 

 


 

 

 


  The item is given a specific media type of application/x-dtbncx+xml and the spine is linked to the item’s id.

  Book Settings

  The next item in the options list is the Book Settings. If your book includes any Unicode text (see page 93), you should set the Encoding to UTF-8. Also, go ahead and set the book type to eBook. Be sure to press Update when you are done making changes.

  Metadata

  The metadata section gathers basic information about your book and its contents. For publishing on the Kindle, this same information will need to be inserted into the DTP. For publishing on Mobipocket, the information will be inserted into the eBookBase.

  Be sure that the Author name(s) are inserted as “last, first” and separate multiples with semicolons. Select an appropriate subject, fill in the description, and give the file a suggested retail price. You will see the cover i
mage already included if you added one in the Cover Image section earlier. The other sections are optional and can be filled in if you like.

  Be sure to press the Update button when you are done.

  Guide

  The Guide allows the TOC and start anchors you placed in your HTML to be turned into selectable links in the book menu on the Kindle or in Mobipocket Reader. In addition, there are other default Guide items to choose from such as Preface, Foreword, Copyright, and Glossary. Those will not show up in the Kindle menu, but they will show up in Mobipocket. You can also specify your own guide items.

  The Filename link can either point to a distinct file name or to an anchor, like this: “FourMillion.html#start”.

  Be sure to press the Update button when you are done.

  If you leave out this step, be aware that the book menu in the Kindle will not contain active links to the Table of Contents and the Beginning of the book that you marked with the and tags. It is important to create the Guide every time you make a Mobipocket file.

  Building the Book

  When you have finished filling out the details of your book, be sure to push the Save button again. Then, you are ready to build the book.

  On the Build page, leave the compression set to Standard, and, at least at first, leave the Encryption Options set to No Encryption. Press the Build button. If there are errors, look at the Build Details and read the error messages. The most common messages are related to the cover image being missing or too small, or to links within your HTML not working. This is actually a great way to test the links in your book after you add a linked index (page 114), footnotes (page 113), or a Table of Contents (page 104). Make sure that any changes you make to the HTML file are done in both the master HTML in your book folder and in the HTML in your Publications folder. I usually just move the OPF file to my main book folder and open it from there so that there is no confusion.

  Conclusion

  Once your book has successfully been built, you are ready to move on to the previewing and publishing phase. The next chapter will cover those parts of the process.

 

‹ Prev