![]() |
#1 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Jun 2012
Device: Kindle
|
Strange Bug in Kindle Formatting - pls help
My epub file that was created in Sigil validated and I successfully uploaded it to Amazon for the Kindle.
However, after purchasing the Kindle book to view it, I noticed that there was some formatting problem: On the page the eBook opens up to when you click on the book title, there's this code at the top: justify">Part I: Overview I have no idea what that -- justify>" is doing there. It shows up in 2 different Kindle readers I have and when I checked it on my iPad, the "justify>" isn't there, but the Part I: Overview is in normal size font when it has a header tag. It also is in normal font in the Kindle, despite there being a header tag there. The strange thing is when you click on "Part I: Overview" from the TOC, it shows up normally - normal header font size and no -- justify"> Also, if you go to the preceding page or the page after Part I: Overview, then go back to the Part I: Overview page, it appears normal. It only shows the bug when you open the book and when you click 'go to beginning'. This bug didn't show up on the original upload to Kindle. It only did when I re-uploaded it after the changes were made. Any idea what may be causing this and what I can do about? Unfortunately, the problem doesn't show up in the Kindle Previewer that you can download to your computer. And oddly, even though the book is supposed to open to the TOC page (as it does in the Kindle Previewer), in the actual Kindle book that has the bug, it opens to that Part I: Overview page. Any help would greatly be appreciated. I have my header tags from the stye.css file in the epub file below. Thanks! h1, h2 , h3, h4, h5 { text-align:justify; text-indent:0; margin-top:0; font-style: normal; } |
![]() |
![]() |
![]() |
#3 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Jun 2012
Device: Kindle
|
Thanks, but it's not the same problem as the other poster. Similar, but different.
Here's the tag for the part that is showing the -- justify">Part I: Overview <h2 id="pI">Part I: Overview</h2> But, the same html tags are not causing a problem anywhere else in the book. It's just on this page that the book opens to. And if you click on the Part I: Overview from the TOC, the header tag displays normally (bold and large font size). It's only when you open the book and when you click "go to beginning." Any other ideas anyone? |
![]() |
![]() |
![]() |
#4 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Also... I would highly recommend doing the conversion to MOBI yourself and uploading that to Amazon... rather than hoping their conversion of your ePub will result in an error-free MOBI. Last edited by DiapDealer; 06-19-2012 at 12:33 PM. |
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Jun 2012
Device: Kindle
|
Here's what's in the content.opf file:
<guide> <reference href="Text/cover.xhtml" title="Cover" type="cover" /> <reference href="Text/toc.xhtml" title="Table Of Contents" type="toc" /> <reference href="Text/toc.xhtml" title="Start" type="text" /> <reference href="Text/author.xhtml" title="Text" type="text" /> </guide> Ironically, in the Kindle Previewer that you download to your computer, my eBook opens to the TOC page (which is what it's coded to do). And in the Kindle Previewer, this error doesn't show up. However, on a real Kindle when the book is purchased and downloaded, the book opens up to the Part I: Overview page. Not sure why. Here's the html code on the Part I: Overview page: <body> <h2 id="pI">Part I: Overview</h2> the header tags are used the same throughout the eBook without any other problems (Part II, Part III, etc.). It's just that Part I: Overview page that has the bit of html code: justify">Part I: Overview And, if I access that Part I: Overview page from the TOC, it displays without any errors. And if I page forward or page back to that Part I: Overview page, it also doesn't display any errors. When viewing it on the iPad (Kindle app), the html code doesn't show. However, the Part I: Overview is in regular font size and isn't bolded, when it should be in <h2> size. However, as when viewing it on a regular Kindle reader, when you access the Part I: Overview page from the TOC on an iPad, it displays normally. Same as when you page forward or page back to the Part I: Overview page. |
![]() |
![]() |
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
My guess is there's some confusion over the guide items that Kindlegen is having trouble resolving satisfactorily. I've never tried building a MOBI where the "toc" reference item and the "start" reference item pointed to the same html page (probably not an issue though). In addition, Kindlegen uses the "start" OR the "text" item to create the point that a book opens to when first being read. There's never any need to have both a "start" AND a "text" item in a MOBI source ePub. There can be only one start point, after all.
I would be tempted to get rid of the "<reference href="Text/author.xhtml" title="Text" type="text" />" line and see if that solves the problem. Either that, or I would create a one page frontmatter/title page that the "start/text" item (just one not both) pointed to that's then followed immediately by the TOC page that the "toc" reference item points to (in addition to removing the extraneous "text" entry). Also note that Kindlegen doesn't recognize/use the "Cover" reference item (it will usually strip a cover xhtml page, in fact). So I'd shoot for a guide section that looks something like: Code:
<guide> <reference href="Text/fmatter.xhtml" title="Start" type="start" /> <reference href="Text/toc.xhtml" title="Table Of Contents" type="toc" /> </guide> Last edited by DiapDealer; 06-19-2012 at 02:11 PM. |
![]() |
![]() |
![]() |
#7 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Jun 2012
Device: Kindle
|
Forgot to mention that the html code that shows (justify">) is not even anywhere in my epub file. That html code doesn't exist, which adds to the mystery.
The other strange thing is why the Kindle book opens to the Part I: Overview page to begin with given the TOC page is the start page. In the Kindle Previewer, it correctly opens to the TOC page. |
![]() |
![]() |
![]() |
#8 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Jun 2012
Device: Kindle
|
Here's the sequence of the start of the book:
Cover Copyright Page TOC Message from the Author page Part I: Overview Here's what's in the content.opf file: <guide> <reference href="Text/cover.xhtml" title="Cover" type="cover" /> <reference href="Text/toc.xhtml" title="Table Of Contents" type="toc" /> <reference href="Text/toc.xhtml" title="Start" type="text" /> <reference href="Text/author.xhtml" title="Text" type="text" /> </guide> I wonder why it would skip to starting at the Part I: Overview page - perhaps this is all tied together - maybe it has a problem with the TOC listed as the start page and the author page listed underneath it as the 'Text' page...? And then for some reason it skips to the Part I: Overview page as the start page...but what the (justify">) is doing there is hard to figure. And if it has a problem with the start page, you would think it would show the same issue in the Kindle Previewer... |
![]() |
![]() |
![]() |
#9 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
(If you want to see the source code of the compiled .mobi file, install DiapDealer's mobiunpack Calibre plugin and unpack your compiled .mobi file with Calibre.) Quote:
For more information on recommended guide items see this article. |
||
![]() |
![]() |
![]() |
#10 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
![]() Code:
h1, h2 , h3, h4, h5 { text-align:justify; text-indent:0; margin-top:0; font-style: normal; } So after your ePub's html gets run through Kindlegen, your '<h2 id="pI">Part I: Overview</h2>' (styled with the above CSS) becomes something like: Code:
<p height="0pt" width="0pt" align="justify"><font size="6"><b>Part I: Overview</b></font></p> Quote:
Like I said; if you don't like surprises... don't upload ePubs to Amazon and rely on their conversion to be flawless. Upload MOBIs that you've built and verified yourself before-hand. Last edited by DiapDealer; 06-19-2012 at 06:19 PM. |
||
![]() |
![]() |
![]() |
#11 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Jun 2012
Device: Kindle
|
OK, thanks guys.
Tomorrow, I will try it with these changes to the guide section and see if this fixes it: <guide> <reference href="Text/cover.xhtml" title="Cover" type="cover" /> <reference href="Text/toc.xhtml" title="Table Of Contents" type="toc" /> <reference href="Text/author.xhtml" title="Text" type="text" /> </guide> So the book should open to the 'author' page, correct? Can I have both title="Text" and type="text" in the author reference line? Last edited by traveler212; 06-19-2012 at 06:44 PM. Reason: typo |
![]() |
![]() |
![]() |
#12 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
It should, yes.
You don't really need the "Cover" reference item either (Kindlegen will ignore it anyway—and likely strip the xhtml file it refers to). That's not what the Kindle (or the apps) uses for its "Go to Cover" functionality. It uses the meta-tag entry and the image itself for that. But it shouldn't hurt anything if you leave it in. |
![]() |
![]() |
![]() |
#13 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Jun 2012
Device: Kindle
|
Those changes to the <guide> section fixed the problem.
Huge thanks, guys! That was bugging me for a week. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Strange bug in Recipe Highlights | Dereks | Recipes | 2 | 03-23-2011 10:33 AM |
Strange formatting in the viewer | paulfiera | Calibre | 2 | 12-21-2010 02:22 AM |
Firmware Update Found a strange bug in 2.5.3 | Pokesomi | Amazon Kindle | 4 | 06-21-2010 05:39 PM |
Strange formatting on ebook | Salinger | Sony Reader | 2 | 12-22-2009 05:46 AM |
Strange problem with formatting | daesdaemar | Workshop | 9 | 01-29-2009 05:11 PM |