Krazycheck.com
Previous entry Next entry

Formatting books for the Kindle

Wednesday, April 27, 2011
To format a book for Kindle is not the easiest thing to figure out from scratch, so I'm hoping this will be a help. If nothing else, it'll help me remember what I did.

I'm going to talk about using InDesign files, instead of HTML or Word, or PDF. There are several "automatic" conversions from these file formats, but is very had to get something that looks like what you want.

Some guidelines:
  1. Export using Paragraph and Character Styles. Text that does not have a style applied will not be formatted (ie: italic font -vs- italic character style). While you can choose "apply local formatting", it will increase the size of your file incredulously.
  2. Objects. Images should be formatted separately and re-inserted into the text. Allowing the Kindle plugin format the objects is not recommended because you aren't sure what you're going to get.
  3. Individual files. So far, the only way to get page breaks is to create a INDD Book, with a chapter for each section, chapter, etc. Because of this, it's much easier to work the whole book as one file, then break it up later, then create hyperlinks.
  4. Small Caps. Kindle doesn't do Small Caps. But other epub readers do. When formatting, keep Small Caps as a Character style, and Kindle will just italicize them, but the formatting will be there for other types of readers.
Order of events:
  1. Apply italics to the file. You need to go through the file (unless you know it's ok) and make sure all italics are, in fact, a Character Style and not just local formatting. The problem with this is I've not found a good way to look for italics and not also get Italic Small Caps, or Paragraph styles with italic font (ie: verses.) Because of this, it's a find / replace command, but need to go through it manually. One trick of this is that find/replace will go through the story, then come back and get the 'black boxes', or other text in text frames. It's easy to not be sure you get everything (especially because once you 'break' the find/replace by working text manually (ie: miss one and have to go back to fix it) then find/replace will "start" there and want to finish up here. I know it sounds weird but you'll understand later.) Explained more below.
  2. Apply bold. Do the same process as above with Bold text. Again, there will be Para Styles w/ Bold, and those don't need this applied. Just text within regular styles
  3. Apply bold italic. Same thing. You'll find these in verses mainly, but it's the least used attribute.
  4. Run GREP commands. (I'll get into this later, below.) Basically it will clean up the text automatically.
  5. Create images. I've taken a press PDF, then just cut images out (specific size screenshots on the Mac) and tried to make the larger images 600 pixel / point wide. The small Kindle screen is only 600 pt wide. Just go through the PDF and copy anything that looks like you can't format (tables will format, but images w/ text -- Certificate of Debt, etc. will need to be captured.)
  6. Rename images. No spaces allowed. I've used the format of chapter-section-image_atp-eng-epub.jpg (04-5-01_atp-eng-epub.jpg) This helps in placing images, as you generally know what chapter / section you are working.
  7. Re-work images. Sometimes when cutting images, you have to grab some text. In Photoshop, just brush (white) out the unwanted text. Some images can be combined (crosses are vertical, position those horizontal.) Small images make the canvas 600pt wide, so it will display small in Kindle (otherwise it'll stretch to fit what it can.) Once done, save for web to make as small as possible.
  8. Work the text. New page size, no margins, place the images, move tables, black boxes, etc in place. (Further explained below.)
  9. Subdivide the INDD file. To get page breaks using the Kindle Indd Plugin (v 0.92) you need to create a book, and import chapters. This includes one for the first image, Front Matter, Dedication, Preface, TOC, Chapter 1-15, Appendix.
  10. Create text anchors. Once the anchors are made, then you can highlight text and point to the anchors you made. One anchor for each Section (no need for Chapters, as Section 1 will work for that, but include the items in TOC -- Preface, Footnotes, Glossary, etc.), one for each endnote chapter. Again, no spaces allowed in names.
  11. Create hyperlinks. Highlight text (ie: TOC items, footnotes) and then create hyperlinks.
  12. Proof. Create a .mobi file and have a look.
  13. Publish. Upload to kdp.amazon.com and fill out all the info.
Apply italics to the file. Here I hope to explain this process a bit more.
  1. Define the character styles Small Caps and Italic with a keyboard shortcut. I use CTRL+4 for regular italics, CTRL+7 for small caps. With Find / Replace, search for anything italic, as per this image:
  2. This will find anything italic, even if it has a character style applied already. Click Find to jump to the next italic type, which will come up highlighted. Use your keyboard shortcuts to apply the correct character style to selected text. When verses are selected, don't do anything, just click FIND again.
  3. Sometimes a verse will be preceded or followed by italic text. This case you'll need to select just the text outside of the verses and apply the correct style.
GREP expressions used. Here are some expressions I've been using for cleaning up text. (These may or may not display correctly!!)
  • Find: ([\d \l\u]+ \d+:\d+.+?\r) Change to: \r$1 Formatting: Character Style [None] This will find the verse references and replace it with a paragraph return, formatted to Scripture References, and remove the Character style.
  • Find:  *?\t *? Change to: (space) This finds a tab and replaces it with a space.
  • Find: ([\d \l\u]+ \d+:\d+.+?)\r Formatting: epub-Scripture Reference --Applies the correct style to the Scripture References.
  • Find: ^\s+ Change to: (nothing) --finds any white space before paragraphs and deletes it.
  • Find: ~<?~e\s?(?=\d?\r) Change to: ~e --removes half-space before ellipsis at the end of a paragraph. 
  • Find: ^~e~<? Change to: ~e --removes the half-space after the ellipsis at the beginning of a paragraph. 
  • Find: (?<=.)~<?~e[~<+ +]?(?![\d\r) Change to: ~e(space) --removes half-spaces before / after ellipsis, and adds a space after.
Working Text Further explained.
  1. Things need to be done inline. Stories are exported as a whole, then it will come back to grab images, other text, and that will be placed after the story. What this means is images, tables, *notes, need to be placed withinside the text flow, so they will be places in the right place. With the text cursor in the right place, PLACE an image, table, etc. I use the epub-Box Header paragraph style, because it has no spacing, but is centered. 
  2. Neat Paragraph / Character Styles. Think these through and keep consistent. I have a set created, and just import that set in the new Indd file. Each style is preceded with "epub-" so I know the difference from the existing styles.
  3. Replace existing Styles. Delete the old styles, one by one, and apply the new "epub-" styles. Some you may not be able to do, because you aren't sure where they are used. No problem, just do the ones that make sense. You'll go through the document and find those in the next step.
  4. Check each paragraph. For me, I start at the end of the document. With the Mac laptop keyboard (desktop keyboard is spaced differently, a little more difficult) I use Command with my left pinky finger, ring finger over Option the middle finger resting above the left arrow key (like a place-holder) and pointer finger controls the up / down arrows. Command up keys will go up one paragraph at a time. When you find a paragraph that is non-standard (has the + sign by it), Option click on the correct paragraph style w/ right hand which is holding the mouse. NOTE: If the italics are not character styles, you will loose that formatting
  5. Look for unused Paragraph styles. This will let you know if you have all the old paragraph styles re-assigned or not. You can search for individual paragraph styles (similar to above search image) to speed things up.
This is a "brain drain", so it's not intended to be a final, finished, comprehensive instruction set. Rather, it's just to help me remember some of the steps used in making the .mobi files for the Kindle.

Back to the main page.

Copyright 2006 John Krajec