Friday, May 22, 2015

Math On Kindle - Part 2

The table in the previous episode is a major reason why Kindle books containing math equations look bad. Say you design a math book for a Kindle Fire 1st or 2nd Generation. Those tablets have a screen width of 600 pixels. Say also that you convert your equation to a bitmap which takes up an average of about 30% of the screen width. They all look good so you release your Kindle book for sale on Amazon.

Along comes a buyer who has just bought a new Kindle Fire HDX 8.9 4th Generation tablet. He likes your book description and decides to buy your book. His new tablet has a screen width of 1600 pixels and he doesn't like what he sees with your book. All your equations look too small and he blames you for creating a book that looks bad on his brand new tablet. So he writes a horrible review of your book. What went wrong?

The average pixel width of your equations was 180 px (30% of 600) wide. Those 180 px wide equations now take up only 11 % (180/1600) of the width of the buyer's new tablet and they look very small. In frustration your buyer tries to increase the size of your equation by increasing the size of the font on his tablet. But that doesn't work because the size of bitmaps are fixed. Your buyer also unhappily notes that all your figures look too small  and they too won't resize with changes in font. No wonder the buyer wrote you a bad review.

"But wait", you say, "I followed all the advice of Amazon. I used Microsoft Word and inserted MathType equations just like Amazon and Design Science suggested. So what did I do wrong?"

Unfortunately, Microsoft Office is NOT a what-you-see-is-what-you-get editor for ebooks. Microsoft's Word and Design Science's MathType instructions are designed for laying out pages in a document or print book. A PDF version looks just like it does laid out in MS Word, but PDF and other documents used to layout a print book do not work for a reflowable text ebook. And when you use Word to create HTML, that HTML was designed for a website, not for an ebook. MS Word's HTML converter takes all your equations and converts them to bitmaps. Then it sets up HTML and CSS suitable for displaying on a website. When you employ this method in writing a reflowable text ebook, you are turning the formatting of your book over to MS Word, a program not designed to layout Kindle books.

The layout of a Kindle math book is further complicated by Amazon, who seems to be engaged in tablet wars. Amazon does not notify authors when they create bigger and bigger tablets and they do not send out warnings that your bitmap images that you created for a smaller size  tablet screen will look bad on their larger screen tablets.

So what are authors of reflowable text math books to do if they want to keep publishing books with Amazon?

There are two approaches you can take. In Math on Kindle I call the first approach the Holder Image Method. This method takes advantage of the way a bitmap image, that fills the width of the screen on a large screen tablet, is downsized so it can be viewed on a smaller screen tablets.The tablet automatically does the downsizing. So if you design a bitmap equation for the largest sized tablet and make sure that image takes up all the width on that large screen device, you can rest assured that the  equation will gracefully resize to fit the small screen tablet and look just as good as it did on the large screen tablet. I provide all the details for using this method in Math on Kindle.

The other approach makes use of SVG (Scalable Vector Graphics) images. If you use MathType or are familiar with LaTex, you can easily create SVG equations. There are a couple of very important advantages that SVG equations  have over bitmap equations. First, and most importantly, the size of  an SVG equation can be made to vary with font size. So when a reader changes the font size, the SVG equations change proportionately. That's something you cannot do with a bitmap equation. SVG images are written in XML, a text based language, so their kilobyte size is small. Amazon charges a per megabyte download fee which can eat away at your book royalties, so having a math book full of SVG equations rather than bitmap ones has a financial advantage. Bitmap figures and tables can sometimes be converted to SVG which allows them to scale with the width of the screen as well as reducing the kilobyte size of your book.

Unfortunately, there is also a down side to using SVG images. Only Amazon Kindle Format 8 (KF8) supports SVG. Their MOBI format does not. Popular readers like the iPad are treated by Kindle as if they are MOBI devices. In order to cover both KF8 and MOBI devices, you must resort to Media Queries and fallback bitmap images to cover all buyers of Kindle books. This can negate the kilobyte size advantage. I explain how to create and use SVG equations and figures in Math on Kindle.

I'm an advocate of interactive math books. When I first wrote Feedback Control Systems Demystified, I wrote it for iBooks using iBooks Author. I was able to create a lot of interactivity which I believe makes it easier for anyone trying to learn a subject that involves lots of math. All the interactive elements are embedded within the iBooks version of this book. When I ported the book to Kindle format I had to come up with ways to handle the interactive elements. I explain the methods I use to incorporate interactivity into a Kindle book in Math on Kindle.

No comments:

Post a Comment