04-04-2011, 06:36 AM | #16 | |
Connoisseur
Posts: 60
Karma: 10
Join Date: Mar 2011
Location: UK
Device: Kindle 3, iPhone, iPad, PC
|
Quote:
I would normally speculate that I had done something wrong but as DMSmillie said earlier in the thread my original html file when opened in a browser works perfectly. What is strange is that considering the large amount of people creating Kindle books there seems to be so few experiencing this issue. Are others doing something different, is it the word processor we are using, is it to do with the conversion software Mobipocket, or is the fault only with the preview prc, and is it fixed after Kindle Conversion? I swear this process has aged me! |
|
04-04-2011, 11:27 AM | #17 |
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
|
Kratos (and others), do you put coding in the HTML at the beginning of each chapter to indicate a page break? I've been using
Code:
<mbp:pagebreak /> I just recently started using Mobipocket Creator. I was using KindleGen before, but the resulting .mobi files were about twice the size since it includes the source code in the file. I don't recall whether this chapter position problem existed with the KindleGen file, but I'll test that. This may be something with the Kindle device itself. As I mentioned, this does not happen in Kindle Previewer. There are several other peculiarities that may be related to the chapter headers changing. Use the five-way or TOC to go to Chapter 5, for example. Then use the page-forward button (on the side) to get to the end of Chapter 5. Note where that chapter ends on the page. Then use the 5-way to move forward to Chapter 6 (the next chapter). Then page-back. The last page of a chapter will always end at the bottom of the screen, not where it did before. Yet, this doesn't happen if you use the page-forward button to move forward to Chapter 6 (from the end of Chapter 5) and then page back! Also, try this. Go to a chapter using the 5-way or TOC. Page back. Then page forward. Then, if you press the 5-way to go forward, it stays on that chapter instead of moving to the next one. This tells me that it's not positioning properly right at the beginning of the chapter, but slightly before. The odd thing to me is that this does not happen on Chapter 1. Chapter 1 is not the first item in my NCX or Table of Contents, but it IS where I've set the book to open in the OPF. That's the only thing I can determine that makes it different from the other chapters. The HTML looks the same. I suppose we need to keep this in proper perspective. It's really a minor glitch. How many people are going to use the 5-way or TOC to go to a chapter heading and then page back and then move forward? I see this behavior in many (maybe all?) Kindle/.mobi books, not just my own. There is one particular book where most of the chapters work properly, though. Actually, very few books on my Kindle even have 5-way navigation enabled. Kratos, You can email your .prc or .mobi file to Amazon using the @kindle.com address (or the free one) and they will automatically send the file back to you as an .azw file so you can test that. I've done that a number of times. I'll let you know if my experiments provide any answers. And if anyone else figures it out, I'd love to know! |
Advert | |
|
04-04-2011, 12:40 PM | #18 |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
The basic problem is with the format itself. There are no real page boundaries in mobi/azw format. Pages are formulated as they appear. So if you move forward page by page you will be fine. The reader keeps a cache of a few pages so you can backup a page and then forward and it will work fine. But if you jump forward and then backup the unit has no idea what size the previous page should be so it just makes a guess and fills the page as best it can and then when you go back forward it can be off a bit. There is no real good solution that will always work.
Dale |
04-04-2011, 04:12 PM | #19 |
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
|
Okay, I think I found a solution! I'm not sure why it works, but it does for me.
I did numerous experiments, with various combinations of coding. First, I used KindleGen to create the .mobi from the original HTML. The same problem with the chapters was there, so it isn't something peculiar only to Mobipocket Creator. Now, I don't know if I can explain this clearly enough, but I'll try. I am not an expert in either HTML or CSS. I know enough to get by, but I'm sure that things are not "technically" correct. My chapters are not wrapped within any <div> tags. I don't know if that would change anything. I have an external CSS file, but you could include the CSS within the HTML. This is what worked for me at the beginning of each chapter: HTML code: Code:
<mbp:pagebreak /> <a name="Chapter1" /><h4 class="CHAPTERTITLE">Chapter 1</h4> Code:
h4.CHAPTERTITLE {page-break-before:always; page-break-after:avoid; margin-top:35pt; margin-bottom:0pt; margin-left:0pt; margin-right:0pt; text-align:center; text-indent:0pt; font-weight:bold;} Code:
<mbp:pagebreak /> Code:
page-break-before:always; Now, when I use the 5-way or TOC to move to a chapter and then page-back/page-forward using the button on the side of the Kindle, the chapter title stays in the correct location on the page. (Note that it may move when you first open the file and try that. That's because the book name and battery icon are taking up space at the top until you page forward/back. When that top indicator line disappears, then all the chapters are where they should be.) I hope that makes some sense! I'd be interested to know if this works for you too! Last edited by DreamWriter; 01-20-2014 at 10:43 PM. |
04-04-2011, 04:49 PM | #20 |
Connoisseur
Posts: 60
Karma: 10
Join Date: Mar 2011
Location: UK
Device: Kindle 3, iPhone, iPad, PC
|
Hi DreamWriter. I'm guessing you are an experienced coder. I don't know any html but i'd really, really like your method to work for me. Or being honest, any method! What I've learnt is that h1 is for heading 1 which I used for my chapter titles.
So what changes do I have to do? Do I first change the style setting of the chapter titles in my word doc to heading 4? Then add that first html code at the beginning of the chapter? Code:
<mbp:pagebreak /> Code:
{page-break-before:always; I downloaded your husband's sample file it works as you described. Also I love the star effect, it looks really pretty and I didn't know the Kindle could do this. Wouldn't it be a good idea if Amazon supplied a default template that works? |
Advert | |
|
04-04-2011, 05:23 PM | #21 |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
|
04-04-2011, 06:26 PM | #22 |
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
|
Kratos, thanks for testing my .mobi sample file and letting me know that it works okay for you! I was working on the chapter heading problem for hours this morning, and I'm a bit burned out (as you can imagine), so it helps to have several pairs of eyes looking at it.
And, no, I'm not a very experienced coder. Everything I know, I have learned online and from books. I know for a fact that my HTML isn't 100% technically correct. It was hobbled together as I was learning, and if I had it to do over again, I'd do a better job on the website and other projects, but it seems to work okay. (I did all the coding by hand, not using any website creation program.) The H1, H2, H3, H4 tags really just set the size of the headings relative to the text size. I chose H4 only because I liked that size with the star/line graphic and the subtitle (which I have set as H3). You can leave your titles as H1. Before you make any changes, be sure to back up your original HTML (and Word file) in case things get messed up! First, be sure to choose HTML filtered when you save as HTML from Word, as it's a bit cleaner. Once you have the HTML code that was generated from the MS Word file, you would insert this just before each chapter: Code:
<mbp:pagebreak /> Code:
<a name="Chapter1" /><H4 class="CHAPTERTITLE">Chapter 1</H4> Code:
<H1>Chapter 1</H1> It's been quite a while since I worked with HTML that was freshly created from MS Word, but I remember that even the "filtered" HTML is quite a mess! But somewhere in there, I believe there is reference to a style for H1. It's probably near the top of the HTML code, somewhere between <HEAD> AND </HEAD>. It may look something like this: Code:
<STYLE> H1 {text-align:center; font:normal;.......} </STYLE> Code:
page-break-before:always; That's really all you need to do. I hope it works for you! The only other thing I should mention again is that I do not have any <div> and </div> tags in the HTML around the chapters. MS Word may insert those into the HTML automatically. If so, you can keep the <div> tags and see if it works. But if it doesn't work, that could be why. I hope that helps! Last edited by DreamWriter; 04-04-2011 at 06:32 PM. |
04-04-2011, 06:52 PM | #23 | |
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
|
Quote:
Code:
<mbp:pagebreak /> Code:
page-break-before:always; As I mentioned earlier, in the latest "Amazon Kindle Publishing Guidelines", on page 7 it states: Text guideline #2: page breaks Use the page break standard CSS page-break-before and page-break-after attributes. There is no mention of Code:
<mbp:pagebreak /> If anyone does comes up with a better (more logical) solution, I'm all ears. |
|
04-05-2011, 08:47 AM | #24 |
Connoisseur
Posts: 60
Karma: 10
Join Date: Mar 2011
Location: UK
Device: Kindle 3, iPhone, iPad, PC
|
ALMOST!
DreamWriter, it is so nearly perfect. Each chapter title preserves it formatting however I navigate there so at least it doesn't look so broken. There is one negative which is when I am on the chapter page and press the back button I have a blank page with an underscore in the top left corner. Or when I finish a chapter the next page is a blank page with an underscore in the top left corner. What I have done is opened by file. Near the start under the style tag I entered the line of code you said and it looks like this Code:
#h1 {page-break-before:always; margin:0pt; margin-bottom:.0001pt; line-height:115%; page-break-after:avoid; font-size:18.0pt; font-family:"Times New Roman"; color:black; font-weight:bold; text-decoration:underline;} Then I entered this line of code <mbp: pagebreak /> at the start of every chapter. So it actually comes before the p class information for normal text. So after my table of contents, this is all the text for Chapter 1 Code:
<mbp:pagebreak /> <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 One Name</h1> <br> </h1> And this is what it looks like at the start of my second chapter. There also an extra line that says 'text-decoration'. I don't know if this is relevant. Code:
<mbp:pagebreak /> <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> So there is a bit of code adding that extra page. Any ideas? Last edited by Kratos; 04-05-2011 at 09:44 AM. |
04-05-2011, 10:49 AM | #25 |
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
|
Completed changed (edited)!
Ugh, MS Word makes such a mess of things when converting to HTML! First, make sure you have backed up the HTML in case this doesn't work as expected. Also, you might want to change just a few chapters and test before changing your entire document. For Chapter 1, I would probably delete everything in red: Code:
<mbp:pagebreak /> <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 One Name</h1> <br> </h1> Code:
<mbp:pagebreak /> <h1 class="heading1style" id="_Toc289087672">My Chapter One Name</h1> Code:
margin-top:5pt; Code:
style='page-break-before:always' For your second (and subseqent?) chapters, I would delete all the coding in red: Code:
<mbp:pagebreak />
<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>
Code:
<mbp:pagebreak /> <h1 class="heading1style" id="_Toc289087673">My chapter 2 name</h1> Last edited by DreamWriter; 04-05-2011 at 11:35 AM. |
04-05-2011, 04:20 PM | #26 |
Connoisseur
Posts: 60
Karma: 10
Join Date: Mar 2011
Location: UK
Device: Kindle 3, iPhone, iPad, PC
|
Dreamwriter. IT WORKS! Thank you so, so much.
Unbelievable. The amount of time and effort I've spent trying to convert this blasted thing, and just when I thought I was at the finish line this strange, obscure problem that nearly made me go mental. But you have taken the time to look at my code, examine it and discover a solution. I am so grateful to you. Thank you. I'm a bit of a perfectionist (sorry.) On testing I saw I had two more problems which I believe I fixed. Some of my chapters required a page break underneath the title. I originally removed these lines of code. Code:
<br> </h1> I also saw I had the same issue with the table of contents! i.e. it works well when I 'Go to toc' on scroll right and back. But when I scroll left and then back right on to the toc, then the 'Contents' is one line down. This is the code for my toc Code:
<b><span style='font-size:13.0pt;line-height:115%;font-family:"Times New Roman"'><br clear=all style='page-break-before:always'> </span></b> <p class=MsoNormal align=center style='text-align:center'><b><span style='font-size:13.0pt;line-height:115%;font-family:"Times New Roman"'> </span></b></p> <p class=MsoNormal><a name=toc></a><b><u><span style='font-size:18.0pt; line-height:115%;font-family:"Times New Roman"'><br> Contents</span></u></b></p> Code:
<mbp:pagebreak /> <p class=MsoNormal><a name=toc></a><b><u><span style='font-size:18.0pt; line-height:115%;font-family:"Times New Roman"'><br> Contents</span></u></b></p> Apart from that I can't say this enough... THANK YOU! I'm so truly utterly grateful. |
04-05-2011, 05:21 PM | #27 | |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Quote:
The /h1 is the closing tag for the title. It begins with <h1> and ends with </h1>. This is the proper way to define an h1 tag in xhtml. It is not proper to leave out the closing part of the tag although some reading tools may let you get away with it. It won't pass any of the checks. Glad it is all working. Dale |
|
04-05-2011, 05:58 PM | #28 | ||
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
|
YAY! I'm so glad that it worked for you!
I am a perfectionist also , so I understand. As you will recall, your code originally looked like this: Code:
<mbp:pagebreak />
<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 One Name</h1>
<br>
</h1>
Every <h1> tag should have a corresponding < /h1> in order to "end" it. (That's what the forward-slash means there.) As you can see, your chapter title is wrapped in a pair of <h1> and </h1>, but I see no <h1> in the code you supplied that goes with that very last </h1> (right after <br>). It's possible that there's an <h1> somewhere above the code snippet you supplied in that earlier post. I don't know why it would've been done that way, though. The wonders of MS Word to HTML conversion. Quote:
If I would have done the coding, I would have included spacing under the chapter headings by using the h1 style to add that extra space, rather than using <br>. Remember this style code? Code:
#h1
{page-break-before:always;
margin:0pt;
margin-bottom:.0001pt;
line-height:115%;
page-break-after:avoid;
font-size:18.0pt;
font-family:"Times New Roman";
color:black;
font-weight:bold;
text-decoration:underline;}
Quote:
I hope you're happy with the results! |
||
|
Similar Threads | ||||
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 |