![]() |
#1 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 541
Karma: 1152752
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Samsung Galaxy Tab 4 Nook & Samsung Galaxy Tab S 10.5
|
Strange chapter header issue?
I've noticed something strange with my converted files on my K3. It only happens rarely and I've not been able to determine what is causing it. It has to do with chapter headers and it only appears when I use the 4-way control to skip from chapter to chapter.
Sometimes, when skipping from chapter to chapter, usually when going backwards through a book, but not always, certain chapters div> will display in the upper left corner of the screen. The code setting up the chapter header is identical for all 80+ chapters but I only experience this problem with certain chapters. The chapter header code is listed below. I'm at a loss as to what may be causing this. Has anyone ever experienced this before? Does anyone have any ideas? Thanks. - Byron Followell <body class="text" id="text"> <div class="chapter" id="ch84"> <div class="chapterHead"> <h2 class="chapterNumber" id="heading_id_2"><span class="bold">Chapter Nineteen</span></h2> </div> |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,251
Karma: 3720310
Join Date: Jan 2009
Location: USA
Device: Kindle, iPad (not used much for reading)
|
You may just not have shown it, but you have 2 start div tags, and only one close div tag.
|
![]() |
![]() |
![]() |
#3 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 541
Karma: 1152752
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Samsung Galaxy Tab 4 Nook & Samsung Galaxy Tab S 10.5
|
|
![]() |
![]() |
![]() |
#4 |
Enquiring Mind
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
|
This is a somewhat obscure bug that I've run into myself. It seems to revolve around how the Kindle OS handles applying formatting when jumping to a named location.
If the formatting (e.g. centered text) is linked to an element that comes before the element that contains the bookmark name that is being jumped to, the formatting doesn't get applied. If, after jumping to the start of the chapter, you move one page back then one page forward, you should see the correct formatting applied to the chapter heading. So, in the example code you provided, I'm going to guess that the text center formatting is linked to the "chapterhead" class, but the navpoint is the id in the H2 element? So when you use the 5-way controller to jump to the chapter start, the Kindle ignores what comes before the H2 element, and only applies the formatting that is coded from that point on. If you page back and then forward again, though, it picks up the formatting linked to the "chapterhead" class, and the chapter heading is displayed properly. If I'm right and that's what is happening here, the only way to avoid this is to ensure that the formatting you want for the chapter heading is applied to the heading element itself (i.e. to the element which contains the id used in the navpoint/TOC link), and not to a containing element (in this case, the "chapterhead" div). |
![]() |
![]() |
![]() |
#5 | |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 541
Karma: 1152752
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Samsung Galaxy Tab 4 Nook & Samsung Galaxy Tab S 10.5
|
Quote:
Thanks so much for your post. I believe you may be onto something. I had to read through it several times before it started making sense. No, all of my chapter header formatting is actually in the h2 element chapternumber. All of the previous elements seem to serve very little purpose actually, especially the chapterhead division directly around the h2 element, though the nav point is setup in the topmost chapter element. I am going to try removing the division around my chapternumber altogether and then move the navpoint ID down to the h2 element and see what this does. I have a feeling that this will take care of my issue. I'll post back if it's successful. This all stems from a wealth of Microsoft Reader files that I'm working to convert for use on my K3. I'm first converting to epub for editing & cleanup then converting to mobi. 99% of the time everything goes smoothly and I get a mobi file that is formatted better than most of the commercially available ones I've seen. The other 1% of the time I get something weird like this and I have to work on it for a while as I'm still teaching myself html/css. Thanks again for your help. - Byron |
|
![]() |
![]() |
![]() |
#6 |
Enquiring Mind
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
|
It looks like you might be experiencing a variation of the bug I've encountered myself, even if it's not identical. Certainly, the issue of the first element on a page not being formatted correctly when you jump to that page by clicking on a link or using navpoint navigation is one that has been reported by others (the Community forums on Amazon's DTP website are a wealth of information on this kind of thing). I'll look forward to hearing if you manage to eliminate the problem, Byron. Keep us posted!
![]() |
![]() |
![]() |
![]() |
#7 | |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 541
Karma: 1152752
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Samsung Galaxy Tab 4 Nook & Samsung Galaxy Tab S 10.5
|
Quote:
Now, does anyone have any idea why the Kindle won't do proper full justification? I'm assuming this is a known issue as well. 99% of my text will be fully justified but one or two lines per screen will wind up being left justified while the rest of the paragraph, the rest of the page is fine. It's really strange. - Byron |
|
![]() |
![]() |
![]() |
#8 |
Enquiring Mind
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
|
You're right that this is also a known issue with the Kindle, Byron. It does do full justification, but it seems to be that, when a line of text would have to be stretched beyond a certain point (i.e. when the gaps between words would have to be expanded beyond some limit coded into the Kindle's operating software), the Kindle simply dispenses with trying to justify that line, but continues to apply full justification to the rest of the paragraph. It's an issue that is more usually handled, in word processors and DTP applications, by enabling "on the fly" hyphenation, but, so far, automatic hyphenation isn't a feature available on the Kindle. So, for now, we end up with occasional lines of text that aren't fully justified - probably preferable to having occasional lines of text with huge gaps between the words.
![]() P.S. Glad to hear you managed to eliminate the formatting problem when jumping to named locations! ![]() Last edited by DMSmillie; 01-31-2011 at 07:32 AM. Reason: Added PS. |
![]() |
![]() |
![]() |
#9 |
Connoisseur
![]() Posts: 60
Karma: 10
Join Date: Mar 2011
Location: UK
Device: Kindle 3, iPhone, iPad, PC
|
Hi. Please can you give some advice as I seem to be experiencing the same problem.
Using Word I gave each chapter title the Heading 1 style which I customised so it is at the top left of the page, large font, bold and underlined. I created a table of contents in the document with Word's in built toc creator. I have converted my doc file with mobipocket into a prc. When I open the prc in either my Kindle 3 or Kindle for PC strange stuff happens to the chapter titles. If on the table of contents I click on Chapter 1 it takes me to chapter 1 and it looks fine, the chapter title is at the very top of the page (although not bold). If I press forward on the Kindle and back it looks okay, sometimes it changes, but if I press back and then forward it always looks different, it is lower in the page. I have tried experimenting and sometimes the chapter title is the same as regular text, sometimes bold, sometimes it isn't. With different versions of my prc sometimes the results are reversed; clicking from the toc takes me to a chapter with an 'odd' heading, whilst flicking through the chapter pages gives me the correct formatting. But always clicking left from the chapter title page and then back to it gives me a different result. (I hope you understand what Im trying to say). I thought It might be caused by how i put my .doc together so I took my original word file and removed all formatting and rebuilt it from the bottom up, just in case the doc 'remembered' the old formatting but it hasn't helped. Good to see that it is a bug and I'm not mental ![]() I've read and reread your explanation above but it i get a bit confused. I don't know html, but I will try anything. Is there a way to prevent this when creating a doc. How can I remedy this please? Last edited by Kratos; 04-01-2011 at 02:38 PM. |
![]() |
![]() |
![]() |
#10 |
Enquiring Mind
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
|
Hi Kratos
I'll be happy to help, but it does, I'm afraid, require being able to go in and edit some HTML. However what's needed isn't very complicated. As far as I can tell from my own experiments regarding this bug, what's happening is this: When converted to HTML, each of your chapter headings consists of something along these lines: Code:
<h1 class="heading1style"><a name="bookmarkname">Chapter One</a></h1> What should happen (and what does happen if you were to open the HTML file in a browser) is that when the application follows the link from the TOC entry to the bookmark, it should recognise that the A element is contained with the H1 element, and apply the formatting defined for the H1 element to the text it contains. However, as far as I can tell, what the Kindle appears to do when following an internal link within a book, such as the links in the TOC, is to go directly to the element containing the bookmark attribute - in this instance the A element - and it fails to pick up the formatting associated with the H1 element that contains it. However if you page forward and back, or page back and then forward, the Kindle picks up the element construction correctly, and applies the correct formatting. So... the only solution I've found to this Kindle formatting bug is to edit the HTML so that the bookmark attribute is in the heading tag, rather than being in an A tag contained within the heading tag. That way, when the Kindle follows the TOC link to the heading, it arrives at the heading element itself, and applies the correct formatting. Note that the "name" attribute is gradually being phased out in HTML, in favour of the "id" attribute. So, although the "name" attribute will still work perfectly well, it's probably best, if you're editing the HTML anyway, to switch to using the "id" attribute. The above HTML example code would be changed to the following: Code:
<h1 class="heading1style" id="bookmarkname">Chapter One</h1> In terms of how to do this, the simplest way, I think, would be to save your Word doc as "Web Page, Filtered", then open the resulting HTML file in a plain text/HTML editor, so you can edit the actual HTML code. The main thing is not to use anything that offers a WYSIWYG interface. Windows' Notepad is absolutely fine for this, or if you already have a favourite plain text editor, use that. Go through the file and change the code for each of the chapter headings, then save the amended HTML file. Then, in Mobipocket Creator, import that HTML file rather than the original Word doc, and create your ebook. Hopefully, this time round, the formatting should behave correctly when you follow the links from the TOC to each chapter. The main downside of this (apart from having to go in and edit the HTML directly, of course ![]() Any problems or questions, just shout. ![]() Last edited by DMSmillie; 04-03-2011 at 12:34 PM. Reason: typo - removed extra < from start of second code snippet |
![]() |
![]() |
![]() |
#11 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,388
Karma: 14190103
Join Date: Jun 2009
Location: Berlin
Device: Cybook, iRex, PB, Onyx
|
Quote:
|
|
![]() |
![]() |
![]() |
#12 |
Enquiring Mind
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
|
You're probably right, Billi.
I went for the option of moving the name/id attribute because that way the HTML code remains valid, whereas putting the A tag outside the H1 tag isn't. Not something that will matter if you're just creating a MOBI file, but invalid code could cause problems if you later decide to use the same source to create an EPUB file with the intention of publishing it. Heh... I'm a bit obsessive when it comes to writing valid (X)HTML code. ![]() If it's only for personal use, definitely go with whatever works and is easiest to do. ![]() |
![]() |
![]() |
![]() |
#13 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,388
Karma: 14190103
Join Date: Jun 2009
Location: Berlin
Device: Cybook, iRex, PB, Onyx
|
Quote:
No problem with that, Donna, I appreciate it very much. I only wanted to mention that mobi doesn't like it to have an anchor tag inside a header tag or some other kind of formatting. When jumping to such a header it will ignore the formatting with the effects Kratos described. ![]() |
|
![]() |
![]() |
![]() |
#14 |
Connoisseur
![]() Posts: 60
Karma: 10
Join Date: Mar 2011
Location: UK
Device: Kindle 3, iPhone, iPad, PC
|
Hi Donna,
Thank you so, so much for getting back to me and giving me a lifeline. ![]() I printed out your guidance and have meticulously followed it. The result I have is improved but still has some issues. Using my Kindle 3 when I jump to a chapter from my table of contents, the chapter titles all keep the correct formatting, are the right size, bold and underlined. When I'm on a chapter page and turn the page forward and then back it still looks fine. But when I'm on the chapter page and turn left/back it shows me the same chapter page but different; there is a small underscore mark on the top left corner and my chapter title starts a line lower. When I have viewed the prc file on Kindle for PC the effects are the same although the underscore is not visible. Strangely it does work perfectly for Chapter 1. My code for each header didn't look exactly the same as the example you gave in that the h1 code doesn't mention the style, but the header and normal style details seem to be listed at the start of the chapter page in the html code. This is what the code looks like for chapter 1 originally looked like Code:
<p class=MsoNormal style='line-height:150%'><b><span style='font-size:12.0pt; line-height:150%;font-family:"Times New Roman"'> </span></b></p> <b><u><span style='font-size:18.0pt;line-height:115%;font-family:"Times New Roman"; color:black'><br clear=all style='page-break-before:always'> </span></u></b> <h1><a name="_Toc289087672">My chapter 1 name</a><br> <br> </h1> and this is what chapter 1 looks like after editing Code:
<p class=MsoNormal style='line-height:150%'><b><span style='font-size:12.0pt; line-height:150%;font-family:"Times New Roman"'> </span></b></p> <b><u><span style='font-size:18.0pt;line-height:115%;font-family:"Times New Roman"; color:black'><br clear=all style='page-break-before:always'> </span></u></b> <h1 class="heading1style" id="_Toc289087672">My chapter 1 name</h1> <br> </h1> <p class=MsoNormal style='text-indent:36.0pt;line-height:150%'><span style='font-size:12.0pt;line-height:150%;font-family:"Times New Roman"'>my text blah blah... Code:
<b><u><span style='font-size:18.0pt;line-height:115%;font-family:"Times New Roman"; color:black'><br clear=all style='page-break-before:always'> </span></u></b> <h1><span style='text-decoration:none'> </span></h1> <h1><a name="_Toc289087673">My chapter 2 name</a></h1> Code:
<b><u><span style='font-size:18.0pt;line-height:115%;font-family:"Times New Roman"; color:black'><br clear=all style='page-break-before:always'> </span></u></b> <h1><span style='text-decoration:none'> </span></h1> <h1 class="heading1style" id="_Toc289087673">My chapter 2 name</h1> Thank you for taking the time to help. |
![]() |
![]() |
![]() |
#15 |
Books are brain food.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,950
Karma: 4836916
Join Date: Nov 2010
Location: U.S.
Device: Paperwhite · Fire HD6/HD8/HD10 · Galaxy Tab A7
|
For what it's worth, in the latest version of "Amazon Kindle Publishing Guidelines", on page 24 it states:
Formatting Tips 1. Anchors must be added before formatting tags
Those are the guidelines that I follow when I create my .mobi files, yet I have the same problem that Kratos reports. Chapter 1 is fine when I navigate there using the 5-way (or TOC) and go back and then forward, but on the other chapters the heading is one or two lines lower when I do that. When I navigate the same way to the chapter heading and go forward and then back, all chapter headings are fine. This does not happen in Kindle Previewer -- only on my K3. If I move to each chapter heading using the page-forward button (on the side of the Kindle) and then go back/forward at a chapter heading, all is fine. This makes me wonder if the problem may be in the NCX file rather than the HTML. Any thoughts? |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Strange issue - deleted books | paulfiera | Calibre | 16 | 01-11-2011 11:37 AM |
Strange rebooting issue with one of our Kindles | Smudge | Amazon Kindle | 13 | 01-07-2011 12:25 AM |
Strange MetaData Issue | Sirkit | Calibre | 6 | 01-02-2010 06:30 PM |
Strange new Font issue. | shighfield | Fictionwise eBookwise | 2 | 08-22-2009 11:25 AM |
Strange issue with media.xml | pepak | Sony Reader Dev Corner | 2 | 09-08-2008 09:42 AM |