To help you understand why answering your question is difficult, I need to give a little background. I apologize if you know this already, but others reading this may not. To the best of my knowledge, what I am about to tell is correct as of today (17-Aug-2013), but could change at any time. The situation was somewhat different a month ago.
When you run an epub file through Kindlegen it creates a file that contains your book in both the old mobi format and the new KF8 format. What you see in the Previewer and on your device for sideloaded files is the old mobi format. However, sometime in the last couple of weeks, Amazon has started sending the KF8 format for books that are downloaded directly from Amazon's site. If you are producing a book to be sold on Amazon, what you see (in the Previewer) is NOT what you get (when you download from Amazon).
Kindlegen produces the old mobi format by converting the xhtml + css2 from the epub into the rough equivalent of html 3.2 (more or less). It is really important to remember that there is nothing close to a one-to-one mapping for everything in css2 to equivalent formatting in html 3.2. Kindlegen is giving its best effort to translate your intent.
The resulting html will then be displayed by some bastardized version of webkit (which is the display engine for most mobile browsers). The Previewer also uses webkit as its display engine.
The problem you are running into could be coming from a number of different places and I don't think you have given us enough information to diagnose the problem. That's not your fault. This stuff is just really more complicated than it should be and changing all the time.
Something about your css formatting could be confusing Kindlegen. Kindlegen might just have a bug in it that no one else has noticed (that happens more often than you think). There could be a bug in webkit in rendering the html that Kindlegen is producing. It could be some combination of all of those things or something else entirely.
Skipping around to random locations in the middle of paragraphs is not a very common use case, except for certain types of books (the most common examples are probably religious texts). How important is this to you? It could take a lot of time to figure out exactly what the problem is, there's no guarantee that you can do anything about it except reformat your book, and the problem might go away entirely if you wait long enough.
If you really want to fix it, I can give you some generic debugging advice. Start by redoing your css file to simplify it enough to make the problem go away. That is, leave all your classes in, but swap the statements to make them all the same (and the same as the default). That should be fairly straightforward in Sigil.
Then, progressively add in the formatting to one class at a time. The idea is to figure which part of this complex system is failing. You also might want to investigate Kindlestrip so that you can see what the mobi formatted html looks like. If installing seems a bit much, you could always post your book here and ask for someone to run it for you (but only after you tried figure out the problem yourself).
Hope that helps.
|