Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 09-18-2012, 07:51 AM   #1
Tugger
Connoisseur
Tugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongue
 
Posts: 91
Karma: 22222
Join Date: Jul 2012
Device: Kindle
Go to beginning/start - *not* solved after all

I believe I have completely solved the problem of making Kindle devices go to the correct start position when opening a book. This start location is also jumped to using the go to beginning menu option.

My search for a solution found the following:
  • Many people have encountered this problem.
  • Amazon themselves don't know the answer. Their own sample books, including the "Kindle Format 8 Sample" jump to the wrong places.
  • Some solutions work for mobi7 but not for KF8. Now that the Kindle 3 Keyboard is being updated to make it KF8, the problem will become widespread.
  • Some solutions work when using the Previewer but not for the actual Kindle device.
  • Some solutions require the TOC to be in a separate file.
  • Some solutions almost work, jumping to the end of the page before or part way down the start page.

My aim was to come up with a solution which has none of the above problems, and now I will document it. It may look slightly odd, but do what I say and you will find it works. If it doesn't, please tell me. It would be good to have it confirmed that it works on a Kindle that does not yet have KF8, if you have an actual Kindle like that, please try it. (e.g. Kindle Keyboard still on version 3.3.)

I have attached a very small sample .mobi file, which you can try. It deliberately has the start position set to the top of chapter 2, so you can clearly see it is working. It includes a TOC. If you unpack the file, you have the whole source there in a zip file.

The solution
1. Edit the .xhtml file in the html folder.
Add "<a id="start" name="start"></a>" immediately before the first character of the heading of the start page. Example:
<p class="heading-2" id="toc-anchor-1"><a id="start" name="start"></a>Chapter 1</p>
Note that I really mean immediately, no other characters between the end of the string and the start of the heading text.

2. Edit the .opf file, adding a line to the <guide> section. Example of a typical guide section:
<guide>
<reference type="toc" title="Table of Contents" href="html/Test document.xhtml#toc"/>
<reference type="text" title="Beginning" href="html/Test document.xhtml#start"/>
</guide>

Hope that helps.

Quote:
Edited to say that while it worked for the text file attached, it is unreliable and often doesn't work. It also contains bad advice about putting the anchor inside the paragraph.
Attached Files
File Type: mobi Test KF8 start and fonts fixed.mobi (71.9 KB, 412 views)

Last edited by Tugger; 09-23-2012 at 06:32 PM.
Tugger is offline   Reply With Quote
Old 09-18-2012, 02:47 PM   #2
Tugger
Connoisseur
Tugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongue
 
Posts: 91
Karma: 22222
Join Date: Jul 2012
Device: Kindle
I am sorry to say that it does not appear to be the complete solution. I thought it worked as I had several books where it did indeed work. But now I have one where it jumps a few lines above, and another where it jumps a few lines below.

So it is close, but not perfect.
Tugger is offline   Reply With Quote
Advert
Old 09-18-2012, 03:54 PM   #3
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,467
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Code:
<p class="heading-2" id="toc-anchor-1"><a id="start" name="start"></a>Chapter 1</p>
That type of code results in rendering/navigation issues (visible html tags/attributes, etc...) in the older MOBI format. I have no idea if it's quite as critical/drastic in KF8, but it's still pointed out in the Amazon Kindle Publishing Guidelines as a no-no. As per section 3.9.2: "Anchors Must Be Added Before Formatting Tags."

The example given in the guide is with an <h2>, but I know for a fact, a styled <p> tag triggers the same sort of issues in the older MOBI format. I started thinking of it as "Anchors Must Be Added Before Formatted Tags" and I never had any more problems with it.

The bottom line is ... if your guide elements, or html ToC links, or footnote links (or links of any kind) are going to include url fragments (href="html/Test document.xhtml#start"), then that anchor your href is shooting for needs to come before any formatted (inline or CSS) tags.

So your code (ignoring the toc-anchor-1 ID for now):
Code:
<p class="heading-2" id="toc-anchor-1"><a id="start" name="start"></a>Chapter 1</p>
Should be (according to the guidelines -- and my experiences):
Code:
<a id="start"></a><p class="heading-2" id="toc-anchor-1">Chapter 1</p>
And if you're planning on linking from your ToC to the "p" tag's id, you should technically change the id to an anchor and move it before the formatted p tag as well.
Code:
<a id="toc-anchor-1"></a><p class="heading-2">Chapter 1</p>
But I'd probably just double-up and have the Chapter 1 ToC link point to the <a id="start"></a> anchor as well and be done with it.

Don't misunderstand me ... I have no idea if any of this will affect or fix the Start Point issue you and others are experiencing, but I do know it has always tripped people up on the traditional MOBI side of things. Repeatedly and often. So it probably wouldn't hurt to comply and see what happens.

This sort of thing is exactly why—with the exception of footnote links—I just don't use url fragments and anchor (or id) targets in my ebooks. Period. Every link in my ToC points to an individual xhtml file. Same for every navPoint in my NCX file, and every source/href in my OPF file. Footnotes are a different story, of course, but as long as I follow the "Anchors Must Be Added Before Formatted Tags" rule ... all's golden.

EDIT: how ironic would it be if Amazon's own Indesign plugin was producing mobi source code that didn't abide by its own publishing guidelines?

Last edited by DiapDealer; 09-18-2012 at 04:02 PM.
DiapDealer is offline   Reply With Quote
Old 09-18-2012, 05:13 PM   #4
Tugger
Connoisseur
Tugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongue
 
Posts: 91
Karma: 22222
Join Date: Jul 2012
Device: Kindle
Thank you, that is very helpful. I will continue to work on it, I'm determined to get to the bottom of it.
Tugger is offline   Reply With Quote
Old 09-23-2012, 12:06 PM   #5
Tugger
Connoisseur
Tugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongue
 
Posts: 91
Karma: 22222
Join Date: Jul 2012
Device: Kindle
After spending many hours on this I have had to give up.

I tried moving the anchor to various places. What would work with one file would not work with another. Sometimes the point jumped to was too early, sometimes too late.

I tried dividing up the files so that one xhtml file had its start point where I wanted the start position to be. This did not help at all. It would still jump to a position in the previous file!

So where is the bug? It might be in Kindlegen. If not it must be in the Kindle devices. I hope that Amazon will sort this out soon.

Until Amazon fixes this I don't believe it is possible to find a reliable solution which works with all devices.
Tugger is offline   Reply With Quote
Advert
Old 09-23-2012, 01:06 PM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,467
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Until Amazon fixes this I don't believe it is possible to find a reliable solution which works with all devices.
You mean using anchors, right?

As long as the href for the "text (or start)/toc" reference items in the OPF's guide section points directly to an (x)html file (with no url fragments involved), all my ebooks' Start Points behave exactly the same in the Kindle Previewer as they do on a KF8-capable Kindle Keyboard device.

I can, however, reproduce your exact issue (on the Kindle Keyboard) by introducing anchors and url fragments into the mix. So it seems to me that the "fix" is a bit obvious. But perhaps I'm not fully understanding.
DiapDealer is offline   Reply With Quote
Old 09-23-2012, 01:28 PM   #7
Tugger
Connoisseur
Tugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongue
 
Posts: 91
Karma: 22222
Join Date: Jul 2012
Device: Kindle
No, I tried exactly what you said. I created two xhtml files, the first with the start of the document and the toc. The second with the main document. I made the "text" entry in the guide section point to the main document with no #start at the end of the href. It still jumped to near the end of the file before. That is why I have given up. I'm never using anchors within paragraphs any more. And I had no anchors added.

If you really have it working all the time, please tell me more exactly how you have managed to do what seems to me to require a miracle! It seems to me that you may just have been lucky, since with some books it works anyway without having two files. When I initially tried three books, one worked, and one jumped too early, one jumped too late.
Tugger is offline   Reply With Quote
Old 09-23-2012, 01:41 PM   #8
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,467
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Tugger View Post
If you really have it working all the time, please tell me more exactly how you have managed to do what seems to me to require a miracle! It seems to me that you may just have been lucky, since with some books it works anyway without having two files. When I initially tried three books, one worked, and one jumped too early, one jumped too late.
By not having one single url fragment in my OPF files. Anywhere. I've tried a bunch of books.

Quote:
I created two xhtml files, the first with the start of the document and the toc. The second with the main document.
I think you're making a mistake by having your html ToC in the same xhtml file as your Start point. Those reference entries for those two items in your OPF need to point to two separate files. And the file that contains the ToC should contain nothing but the ToC, IMO.
DiapDealer is offline   Reply With Quote
Old 09-23-2012, 01:55 PM   #9
Tugger
Connoisseur
Tugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongue
 
Posts: 91
Karma: 22222
Join Date: Jul 2012
Device: Kindle
"By not having one single url fragment in my OPF files. Anywhere. I've tried a bunch of books. " Please can you explain exactly what you mean by a URL fragment?

"I think you're making a mistake by having your html ToC in the same xhtml file as your Start point. Those reference entries for those two items in your OPF need to point to two separate files. And the file that contains the ToC should contain nothing but the ToC, IMO. "

The title and toc are in one file and referred to for the toc entry, in one guide entry.

The start of the main book is where the start should be, that is in the second file, and it is referred to in the other guide entry. That entry does not have a #start at the end, I just pointed it at the start of the whole file, which I think is what you meant.

So the only thing I'm doing that you feel is unwise is having the title in the same file as the toc. It doesn't sound likely that that is the key thing to change, but who knows.
Tugger is offline   Reply With Quote
Old 09-23-2012, 02:37 PM   #10
Tugger
Connoisseur
Tugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongue
 
Posts: 91
Karma: 22222
Join Date: Jul 2012
Device: Kindle
I just split the file into three, as you advise. Title, toc, main. In the Previewer it all works perfectly, it starts at the start of Chapter 1. But on the Kindle it starts at the beginning of the TOC.

This is my tiny test file, it only has a one line title, a toc, then two chapters each of just a few lines (for testing font sizes). I could easily upload it here.

I welcome any more suggestions.
Tugger is offline   Reply With Quote
Old 09-23-2012, 03:03 PM   #11
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,467
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Tugger View Post
I just split the file into three, as you advise. Title, toc, main. In the Previewer it all works perfectly, it starts at the start of Chapter 1. But on the Kindle it starts at the beginning of the TOC.
I just got the same result.
My Start Point so rarely comes after my ToC, that I may not have noticed the issue before now. I'll have to do some spelunking.
DiapDealer is offline   Reply With Quote
Old 09-23-2012, 06:31 PM   #12
Tugger
Connoisseur
Tugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongue
 
Posts: 91
Karma: 22222
Join Date: Jul 2012
Device: Kindle
I very much look forward to learning what you find.
Tugger is offline   Reply With Quote
Old 09-27-2012, 04:52 AM   #13
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,447
Karma: 157030631
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Hi:

Wasn't there a post, somewhere around here, that KG was inserting two "text" Guide items, and that popping the OPF open and removing the second reference solved the issue? And not using "Start" other than as the title? I know that KG has, on a number of occasions, produced two "start" (text) locations for us via Previewer. This seems to resolve when the book is uploaded to KDP.

However, if you actually removed all anchors, etc., and simply set the start point to a specific file, i.e., html/content, then that start location should absolutely start there, and nowhere else.

Did you check (no offense) to ensure that the KG portion of your INDD plug-in did NOT set a different "start" location with the "text" TYPE in the Guide? Which would override any "start" locations you have set, to the best of my knowledge?

Hitch
Hitch is offline   Reply With Quote
Old 09-27-2012, 05:40 AM   #14
Tugger
Connoisseur
Tugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongueTugger can tie a knot in a cherry stem with his or her tongue
 
Posts: 91
Karma: 22222
Join Date: Jul 2012
Device: Kindle
The KG OPF had only one line in the Guide section, that is for the toc.

I even tried splitting it up into three files so it points to the start of the third file. No anchors in that case.

I can make it work in the Previewer but not on my Kindle. (Kindle Keyboard with v3.4 KF8 update).

I've tried everything I can think of. My conclusion is that there is a bug either in KG or in the KF8 Kindle firmware.

I've attached the KG zip file for my test document. You will see that the document is only a few lines long. This is one I have not touched, it is straight out of the plugin (after unpacking). Should you have time to spare your challenge is to make it start at the beginning of chapter 1.
Attached Files
File Type: zip kindlegensrc.zip (41.7 KB, 315 views)
Tugger is offline   Reply With Quote
Old 09-27-2012, 05:45 AM   #15
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,447
Karma: 157030631
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Tugger:

OK--I'm heading off to the sack now, but I'll take a peek at it later and see if I can spot the glitch--IF there is one. I mean, as you say, it may well be a bug.

Hitch
Hitch is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to define the "Start" or "Beginning" page in Calibre paul_01 Conversion 5 08-12-2016 06:58 AM
Kindle : go to beginning and default start location issues. aschofield Devices 10 07-01-2012 02:10 PM
Calibre wont start (first time start up) Mike Railton Devices 15 05-25-2012 02:14 AM
From the beginning ........ Aspic8 Writers' Corner 15 10-10-2011 11:05 AM
How do I go to the beginning of a book heritage Amazon Kindle 8 12-24-2010 03:13 PM


All times are GMT -4. The time now is 11:16 AM.


MobileRead.com is a privately owned, operated and funded community.