Possibly the most mysterious part of creating an eBook is, how do you format the book so that it displays correctly on Amazon's Kindle and Barnes & Noble's Nook?
Formatting an eBook for use on a web site or for sending by email using the PDF file format is relatively easy. Most popular word processors and page design programs can export to the PDF file format and those exports usually accurately render the PDF to match the original created in Word, InDesign, or whatever.
Formatting for the Amazon Kindle or Barnes & Nook is a completely different proposition. Some programs like InDesign have plug ins that supposedly save to the eBook format, but these are notoriously inaccurate. So exactly how do you properly, and easily, format a file for Kindle or Nook? First, there are several HTML code examples in this article. In order for the article to display correctly on Article Sites I have replaced the standard tag symbols (less-than and more-than) with [ and ].
The Kindle format and also the Nook format are based on HTML, so the obvious answer to the previous question is to do your formatting in HTML. Most word processors and page layout programs can save to HTML, so that is the first step. Then open the file in your favorite HTML editor, I like using Dreamweaver but all of these techniques are done at the code view so any standard HTML editor will work. You can even use a plain text editor like Windows Notepad if you like. The Kindle Fire can take some HTML 5 coding with CSS3, but we will be sticking with more basic formatting in this discussion.
What we want is basic HTML, with all excessive formatting removed. If you are formatting for the Kindle and there is a cover image, remove it. Kindle works best if you upload the cover image separately from the eBook file. In the Nook you can leave it attached. For a professional look you want to start the actual eBook with a Title Page, followed by a Copyright Page. You only need basic information on the Title Page, first of course the title of the eBook as text, don't use a picture for the title, keep it text. You can follow this by a smaller picture similar to the cover of the book if you like, but don't put a small image of the cover here. That just looks unprofessional. What I frequently do is to use the same art as the cover if it is interesting enough but without the text.
The copyright page can contain a lot of information but the most important part is a properly formatted copyright. This is in the form of "copyright date name", here is an example: copyright 2012 George Peirson. You can replace copyright with the copyright symbol if you like. One more thing the copyright holder has to be either an individual or corporation (which are individuals as far as the US Government is concerned). Aside from corporations, companies cannot own copyrights. So either a persons name, or a corporation name, no business names, no doing business as, no partnerships, etc.
Next you will have your table of contents, followed by the rest of the book. We will now look at more specific HTML level formatting techniques.
Start by cleaning out all of the extraneous coding, span tags, any font tags or CSS styling, etc. Leave in paragraph tags or div tags as needed, but pretty much take everything else out. We basically want to start from scratch and keep the formatting to a minimum for the widest compatibility. If you use a program like Dreamweaver you can use the Find and Replace function to speed up this task. Lets say that you have paragraph tags with some formatting in them like this [p class="bodytext"], instead of looking through all of your code and removing each instance of class="bodytext", instead do a search for [p class="bodytext"] and replace with [p]. Also remove any [span] tags and don't forget to remove the closing tags as well, [/span]
We will next put in page breaks as needed, normally you would want each new chapter to start at the top of its own page, and of course the Title Page should be on one page and the Copyright Page should have its own page as well. To start a page at the top of the page on Kindle put in a page break in the code. Make sure you use a page break after the Title Page, after the Copyright page, after the Table of Contents, to give the eBook a professional look. The page break tag goes at the top of the new page in the code view, for instance at the beginning of each chapter before you start any text on that page. Here is the tag to use, this is a special tag that you will not find in normal HTML: [mbp:pagebreak /]. Just put it on its own line in the code at the beginning of each new chapter.
Now for some basic paragraph formatting. Of course you will be putting your paragraphs in paragraph tags,
paragraph text goes here [/p]. You can put in basic paragraph attributes into the opening paragraph tag, the most commonly used one is the align attribute. Simple to use, it goes like this:[p align="left"] for left alignment, you can actually ignore this, paragraphs will align left by default.[p align="center"] for center alignment[p align="right"] for right alignmentAnother attribute is align="justify" to force full justification, but eBooks fully justify be default so you can ignore this one as well.
The paragraph tag will leave a blank line between paragraphs, if you want your paragraphs to be continuous without blank lines then use a break tag instead, [br /]. Put one of these at the end of each paragraph break in your text and then begin the next line (no opening paragraph tag). To put a space between paragraphs use multiple break tags, like this [br /][br /] or [br /][br /][br /]
When you bump paragraphs together like this you will need a larger indent on the first line to easily spot the beginning of each paragraph, you can create the indent by using non-breaking spaces, you can put as many as you need, each one is a single space. I have found that 5-9 of these at the beginning of a paragraph gives a nice looking indent. You can use spacing attributes in the opening paragraph tag for indenting the first line, but it is not as reliable as the non-breaking space, so I stick with that in most cases.
You can indent the text on the left and right by using Block Quotes, basically adding margins to the page. Be aware though that on the earlier Black & White Kindles the right margin may be ignored. Here is how you put in Block Quotes:
[blockquote][p]your text[/p][/blockquote]
You can put several paragraphs between one set of block quotes, and you can double up or triple up on the blockquotes to add larger margins, useful for poems and such.
Put in Bold and Italics as needed using standard tags, like this [b]this is bold[/b] and [i]this is italic[/i]
You can also use the different H tags for sizing your text, although I have found that only the larger H tag numbers work reliably. [h1]title text[/h1], [h2]not as large[/h2], etc. The H tags go from 1 to 6 but I have found that only h1 through h3 work reliably on all devices. So these are good for titles, page headings, and such.
Use H tags to size title and other large text like this: [h1]title of eBook[/h1][h2]subtitle of eBook[/h2][h2]chapter titles[/h2]You can put in alignment attributes into H tags, like this: [h1 align="center"]title of eBook centered[/h1]
Next position and format your images. I recommend sticking with left, right, or center alignment and keep your images on the smaller size. If the image is too large it will be re-sized by the eBook reader to fit the page and you will have one big image with no text. This is one spot where you may want to do some testing to get just the right size depending on your needs.
Once the basic formatting is in place you can set up the Table of Contents. Use anchor tags to create links for a Table of Contents. If you do this right after the title page and name it Table of Contents Kindle will know what it is and use this list for the Kindle TOC at the end of the book.
An Anchor tag looks like this: [a name="11" id="11"][/a]
Place this at the top of each chapter, after the page break tag we included previously. You can name the anchor tags anything you want, but I find it easy to just number them. The example above is for chapter 11.
Now go up to your Table of Contents page and use standard links on that text to link back to your anchor tags. Here is how the link for chapter 11 looks in the TOC.[a href="#11"]Chapter 11[/a][br /]
You can name your chapter anchor tags anything you like, maybe you have a collection of short stories and your Table of Contents lists the story titles instead of chapters, this is fine. But if you use the word Chapter in the Table of Contents Kindle will ignore any other links on that page when making the Kindle Table of Contents (in the Kindle controls and at the end of the eBook). So if you have this:
ForwardChapter 1Chapter 2Epilogue
The Kindle will only use:
Chapter 1Chapter 2
In its Table of Contents, of course your TOC with all of your anchor tags will work correctly, but if someone uses the TOC control in Kindle they will not see the Forward or Epilogue links. This does not happen if you don't use the word Chapter. I am not sure why this is so and I discovered this by accident, but after a lot of testing it seems to be consistent. So either use all Chapters (chapter 1 - Forward, chapter 2, chapter 3, chapter 4 - Epilogue) or don't use the word Chapter in the TOC.
You can use standard links in the text and at the end of the book for links to web pages, etc. These will work fine, but to be safe keep any external links off of the Table of Contents page. If you want a list of links at the front of the book put them on their own page after the TOC.
One more tip on designing your book, make sure you have a good Forward or First Chapter. Amazon previews the first 10% of the book in their Look Inside tool in their Kindle Store, so you want the first 10% to grab the attention of the reader so that they will buy your book. Don't fill the front of the book with advertising, save that for the end, and don't put a bunch of pictures at the front of the book as well. Make sure you have some quality text in the first 10% to maximize your exposure and sales.
This will take care of almost all of your formatting needs and make your book easily convertible to both the Kindle and Nook platforms. You can get a lot fancier if you need to, but this really is most of the formatting that most books use.
You should do a lot of testing to make sure that your formatting works, I recommend using a program named Calibre to convert your HTML to the MOBI format for the Kindle and the ePUB format for use on the Nook. You should use either the computer version of the Kindle Reader and the Nook Reader to check the formatting after conversion, or better still use an actual Kindle or Nook. Don't rely on the Reader in Calibre as it is not accurate. One more tip, I have found that if I need to change or fix the formatting I need to remove the eBook from the Kindle Reader and also remove the eBook from Calibre, then re-import the fixed HTML back into Calibre, re-convert to MOBI or ePUB, and re-install in the Reader, otherwise I have found that the changes don't always take.
iAutoblog the premier autoblogger software