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.




Sunday, May 3, 2015

Math On Kindle

This is about a book I had not planned to write. It all started when I got a 3-star review on my latest technical book Feedback Control Systems Demystified. This book was originally written using iBooks Author because that program allowed me to write a highly interactive book filled with easy to format equations that I hoped would engage students and help them learn a difficult subject faster.

When I started the book, iBooks were only available for the iPad. I didn't own an iPad so I bought an iPad Mini for my writing project. My wife, who loves to read, fell in love with the Mini once she found out that it was better than her Kindle Touch which I had bought her a year before. So you guessed it, I bought her an iPad Mini also. Gee, it's hard to make money in this game of authoring technical books.

By the time I finished my controls book, Apple released a reader for the Mac with their new operating system. Yippee, I thought, Apple will soon release an iBooks reader for the PC market just like they did with QuickTime and iTunes. I waited and waited. With no PC-based iBooks reader in sight I began to think that iBooks might never compete with Amazon Kindle books in terms of market reach, so I decided to port the controls book to Kindle.

Amazon and MathType made it sound easy. All I had to do was port the text to MS Word and insert the MathType equations I had already created for iBooks Author and I was set to go. Oops, I couldn't port all my widgets developed with HTML5 Canvas and JavaScript, because Kindle doesn't support these. No problem, I just put the interactive elements on my website and placed links to them in the book. Now I was really set to go. I checked the final draft using the Kindle Previewer, uploaded my book and cover, checked all with the Kindle App for my iPad and and my wife's Kindle Touch. All looked good so I released the book for sale.

Sales were slow at first and then picked up. I even got a 5-star review so all was looking good. After about 8 months I got this 3-star review:
The material is meticulously presented but the process of turning a print volume into an e-book is badly broken. Every table, every figure, every formula is virtually unreadable, even on my Kindle with the largest display they come with. Text can be scaled, figures cannot. It really seems as if the e-publishing game is much more about quantity than quality.
Of course this book was never a print book, figures are bitmaps and can't be scaled, and I am the sole publisher/writer. So I ignored those comments. But I couldn't ignore the statement: Every table, every figure, every formula is virtually unreadable, even on my Kindle with the largest display they come with. Something was wrong and I had to fix it.

It took me at least three months to solve and correct the problems. I've put it all down in this book in hopes that it will help other authors using equations to avoid the pitfalls of Kindle Format 8 and MOBI formats. Here's a link to the book Math on Kindle if you want to read it now. I'll give a summary of the solutions I found found and put it in the book in the next episode of my blog. Here's a sneak preview of a major part of the problem:


Sunday, November 30, 2014

Engineering/Scientific eBooks - A Comparison of Amazon Kindle and Apple iBooks

Feedback Control Systems Demystified is available as a Kindle ebook and an Apple iBook. Which is best and why did you choose to create this interactive engineering ebook in both formats?

Glad you asked!

Let me begin by explaining why I wanted to write an interactive ebook and not a print book on Feedback Control Systems. I know from personal experience that control system theory is a difficult subject to learn. It is often taught at the college level in the senior year or later in graduate school. Most textbooks on this subject are difficult to understand unless the reader has a firm grip on higher mathematics subjects, including, at a minimum, differential equations and complex variable theory. I might also mention that these textbooks typically cost well over a hundred dollars. Difficult math and high cost of textbooks are barriers to learning a subject that I believe can be taught to technicians, all types of engineering students, and any practicing engineer who never had a course in feedback controls.

Textbooks filled with graphs and equations are not, in my opinion, the way to teach or learn control system theory. I wanted to explore new methods for teaching this subject, as it is my passion to make it easier for anyone wishing to learn difficult engineering subjects like feedback control systems.

About Apple iBooks Author

It wasn't until Apple came out with their iBooks Author program that I got excited about producing interactive ebooks. I saw in this authoring program an alternative way to teach control system theory. I previously converted my first book, Modeling Engineering Systems, into an ebook using the Kindle Format 8 and the Apple ePub 2 format, so I knew the limitations of these formats. The biggest limitation of these formats is they can for the most part only render equations as bitmaps. This means that equations will not resize as the reader resizes fonts. Another major drawback is these formats have only the simplest kind of interactivity (embed a video and link to another page in the book, to name two). They cannot handle embedded interactive simulations written in JavaScript. Mainly for these two reasons, I turned to Apple iBooks Author to develop my new feedback control systems ebook because iBooks Author could accept MathML, (and in my case) MathType, and I could develop interactive widgets (dynamic simulators, root locus plotter, etc.) using JavaScript and HTML. Both scalable equations and interactive simulators could be directly embedded into my ebook. With iBooks Author I could now engage students with many interactive elements. This, I hope, will allow students to make discoveries on their own, and allowed me to eliminate countless static graphs from the ebook.

Feedback Control Systems Demystified iBook turned out to be exactly what I wanted. Text, equations, videos, enhanced root locus plotters, open loop and closed loop simulators, workbooks, quizzes and more are all embedded into the ebook and are available at the touch or swipe of a finger. I wanted to get the book out to everyone who wanted to learn about feedback control systems, but there was a problem. iBooks originally could only be viewed on an Apple iPad. Shortly after I released the book, Apple made an iBooks reader available for Apple desktops and laptops that use the latest Apple operating system. I have hopes that Apple will soon make the iBooks reader available for Windows-based systems, much like they do now with QuickTime and iTunes.  Unfortunately, Apple has not at this writing made the iBooks reader available for Windows computers or Google-based tablets. Amazon, on the other hand, has made the Kindle ebook reader available for just about every computer operating system. As a result, Amazon Kindle ebooks far outsell Apple iBooks. From an author's point of view this is unacceptable.

About Kindle Format 8

How then could I produce a Kindle version of Feedback Control Systems Demystified and still retain all the interactivity I considered so important to teaching this subject? I clearly could not embed all the interactive elements because the Kindle format does not allow resizable equations or embedded JavaScript coding. Kindle Format 8 claims to support SVG (scalable vector graphics), but I found it very difficult and time consuming to use SVG with equations. In the end, I used extra large bitmaps for my equations. Kindle Format 8 does allow a user connected to the web to link to a page on a website. Kindle readers creates an overlay that shows the website page and a "Done" button which the reader can select to remove the web page and reveal the underlying page of the ebook. This gave me the idea that I could move most of my interactive elements to my book website. After some experimentation, I was able to place most of my interactive elements on the web. About the only interactive elements included in the iBooks version that are not included in the Kindle ebook are the interactive quizzes. To handle the equation sizing problem, I decided to make each equation as large as possible so they were clearly readable. I did this because I have found so many engineering textbooks converted (mostly by major publishers) for the Kindle that are loaded with equations you cannot read. The same comment applies to many tables and graphs in these converted ebooks. So I made sure that all my tables and graphs could be enlarged and clearly readable.

Unlike the Apple iBooks version of Feedback Control Systems Demystified, the Kindle Format 8 version requires the reader to be connected to the internet to enjoy the full interactivity. So although you can't access all the interactive elements unless you have an online connection, you can read it on any computer/notebook/tablet that has the Kindle Reader installed. Here are links for a few examples taken from the Kindle version of Feedback Control Systems Demystified.

Sample Workbook
Sample Dynamic Circuit Simulator
Sample Enhanced Root Locus Plotter (click and drag the slider)

Thursday, August 8, 2013

Just Getting Started



Welcome to my blog. My goal with this blog is to discuss the books I write with my readers and related topics that will help them better understand the subject matter of the books. The first technical book I wrote was titled Modeling Engineering Systems (MES). The subject of that book was the creation of math models of dynamic systems and the manipulation of those models to meet steady-state and dynamic performance criteria. I particularly wanted my readers to understand that all engineering systems, whether they be electrical, mechanical, fluid, or thermal, look alike mathematically. So, for example, if one understands a math model of an electrical circuit, they will also understand that same math model can be used to study the behavor of a mechanical or fluid systems. I believe that every engineer and technician can understand math modeling if a teacher makes the effort to explain in plain language the steps in the design process and uses real life design examples. Apparently there are a lot of others engineers and technicians who agree with this teaching because my book has received many 5-star reviews on Amazon.com.

Recently, I created a Kindle eBook version MES and will soon have an iBook version in ePub format on the iTunes bookstore. I like eBooks because they can keep the price of technical books down and the author can make corrections and have a closer relationship with their readers through website such as mine at jackwlewis.surberstation.com. I read awhile ago that eBooks now have 25% share of all books sold in the US.

Now that Apple has come out with iBooks, I've discovered a way to make my future books interactive with Apple's "widgets" so I can have lab projects and simulators built into my book. I'm working now on a series of iBooks that will explore the fascinating world of feedback control systems. The first volume in this series entitled "Feedback Control Systems Demystified - Volume 1" should be out in a few months. In the meantime, I have posted on my website a sample widget you can experiments with. Let me know what you thinks and/or what you would like to see.