The Kindle Format
I've been working on some Kindle programming book projects, and I hit some walls. The device has format limitations that get in a tech writer's way. Much of what you need to know to fit technical content onto a Kindle is either undocumented or just hard to find.
I had to learn how to publish software code, screen shots, equations, tables, lists, flow charts, and so on, all the things you typically find in a programming book that are not narrative text.
Writing a novel? You can find lots of online help in formatting narrative text in the forums at Amazon's Digital Text Platform Community Support forum website.
Your technical book will have narrative prose, too, so you should get all such help. This article deals specifically with managing technical content in a book.
I'll describe the process that works best for me. There are other ways to do it. This is the procedure I've chosen.
Write the Book
First, you write the book. I use Microsoft Word for that task, building a Word document file for each chapter. You can put all the chapters in one file, but that makes for a cumbersome document, difficult to manage.
Use Word's hierarchy of Header styles to organize each chapter's outline. That facilitates automatic generation of a table of contents later. Don't worry about fonts at this time. Just use whatever makes it easiest for you to read and review as you write.
Use Word's Normal style for the narrative.
I built my own styles for figure captions and program listing titles. Those elements are centered and italicized using Kindle's default text font.
Build illustrations and figures with whatever image editor program you prefer. Embed them in the chapters by using Word's Insert/Picture/From File command. You can flow text around pictures if you want, but it's better to have each figure stand alone.
The Kindle is a monochrome device, and screen shots can be a bit hazy in that format. You might want to play with the contrast settings in some figures. Make sure you critically preview all your illustrations before you publish the book.
If you use the GIF image format, ensure that the transparency mode for those files is disabled. Kindle doesn't like it.
Kindle's pages are not fixed-length. Page breaks depend on which Kindle is used and how the user configures the display. Don't depend on page integrity to enhance your visual presentation. It won't work. Where you absolutely need a page break, use Word's Page Break command (Ctrl+Shift) to force one.
Use an image editor to make your cover image. Make the image 1200 pixels high by 900 pixels wide. You will include the cover image at the front of the book. You will also upload it when you publish the book so the book's listing at Amazon has a cover to display.