Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 05-10-2017, 05:50 PM   #1
fluoresce
Enthusiast
fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.
 
Posts: 38
Karma: 342440
Join Date: Apr 2017
Device: Sigil
TOC links point to wrong page!

The adventure continues! Whenever I think I have finished my first EPUB, I find another problem!

This time I have noticed that some of the links in my table of contents, generated by Sigil, point to the page before the destination page. This means that I have to click the link and then flip one page forward to arrive at my intended destination.

Having taken a close look, it only seems to occur whenever the destination is a h3 heading and the heading starts at the top of the page. My h3 heading elements have the largest top margins of all the elements in the EPUB, so I am assuming that some of the top margin is being left on the previous page.

Is this possible? Has anyone ever experienced this problem?
fluoresce is offline   Reply With Quote
Old 05-10-2017, 05:55 PM   #2
fluoresce
Enthusiast
fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.
 
Posts: 38
Karma: 342440
Join Date: Apr 2017
Device: Sigil
Note that when I check the TOCs in Sigil, every link works perfectly. The problem occurs in ADE and Kindle for Android.
fluoresce is offline   Reply With Quote
Old 05-10-2017, 06:42 PM   #3
fluoresce
Enthusiast
fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.
 
Posts: 38
Karma: 342440
Join Date: Apr 2017
Device: Sigil
Ohhh! I see what's going on . . .

My TOC is three levels deep (h1, h2, and h3). As chapter headings and subheadings, my h1s and h2s all start at the beginning of a HTML document. My h3s are the only headings that are placed throughout the body of the content. In order to push the h3 headings down, I have assigned them large top margins. Whenever a h3 heading happens to start at the top of a page, the top margin is being split between the top of the page and the previous page. If I adjust the font size and thus move the h3 headings away from the top of a page, the problem goes away.

I think I can fix this problem by giving the h3 headings the same sized top margin as the previous element's bottom margin. Lemme see . . .

Last edited by fluoresce; 05-10-2017 at 06:45 PM.
fluoresce is offline   Reply With Quote
Old 05-11-2017, 11:41 PM   #4
GrannyGrump
Obsessively Dedicated...
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 3,200
Karma: 34977896
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
Try using padding-top instead of margin-top. That will place the whitespace within the h3 "block" instead of above it. I use padding for all chapter headings, and seems to work always.
GrannyGrump is offline   Reply With Quote
Old 05-14-2017, 07:17 PM   #5
fluoresce
Enthusiast
fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.
 
Posts: 38
Karma: 342440
Join Date: Apr 2017
Device: Sigil
Quote:
Originally Posted by GrannyGrump View Post
Try using padding-top instead of margin-top. That will place the whitespace within the h3 "block" instead of above it. I use padding for all chapter headings, and seems to work always.
Thanks, Granny. I tried it, but it didn't work. The margin still seems to be split between the previous and actual page.

Check your books. I bet the same thing happens.
fluoresce is offline   Reply With Quote
Old 05-14-2017, 07:18 PM   #6
fluoresce
Enthusiast
fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.
 
Posts: 38
Karma: 342440
Join Date: Apr 2017
Device: Sigil
I need a space above my h3 headings. How do I do it without experiencing this problem?

Any suggestions will be appreciated.
fluoresce is offline   Reply With Quote
Old 05-15-2017, 01:55 AM   #7
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
You will always have issues when the header doesn't quite fit on the page. If you want a margin above a H3 and have the H3 always at the top of a page, the most consistent manner would be to give the H3 a separate page/XHTML file.
Toxaris is offline   Reply With Quote
Old 05-15-2017, 08:54 AM   #8
fluoresce
Enthusiast
fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.
 
Posts: 38
Karma: 342440
Join Date: Apr 2017
Device: Sigil
Quote:
Originally Posted by Toxaris View Post
You will always have issues when the header doesn't quite fit on the page. If you want a margin above a H3 and have the H3 always at the top of a page, the most consistent manner would be to give the H3 a separate page/XHTML file.
Thanks, Toxaris.

The h3s are distributed throughout the body of the content. Whenever one of them happens to be at the top of a page, the TOC link that points to that h3 header instead points to the previous page, as if a piece of the h3 header's margin is being left on the previous page.

I suppose the only two ways of fixing this issue are to either do as you say and place each h3 at the top of a new document or push each h3 down with the previous element's bottom margin.
fluoresce is offline   Reply With Quote
Old 05-15-2017, 10:13 AM   #9
BobC
Guru
BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.
 
Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
Quote:
Originally Posted by fluoresce View Post
Thanks, Toxaris.

The h3s are distributed throughout the body of the content. Whenever one of them happens to be at the top of a page, the TOC link that points to that h3 header instead points to the previous page, as if a piece of the h3 header's margin is being left on the previous page.

I suppose the only two ways of fixing this issue are to either do as you say and place each h3 at the top of a new document or push each h3 down with the previous element's bottom margin.
Or style the h3 element as
Code:
page-break-before: always
to force a new page with each h3.

BobC
BobC is offline   Reply With Quote
Old 05-19-2017, 10:15 AM   #10
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Quote:
Originally Posted by fluoresce View Post
I suppose the only two ways of fixing this issue are to either do as you say and place each h3 at the top of a new document or push each h3 down with the previous element's bottom margin.
To make it easier, instead of tracking down and fixing every preceding element, you could just insert and extra div before each h3 to give you your margins: i.e. replace every occurrence of "<h3" with "<div class='h3-margin'/><h3" and define h3-margin as "margin-top:5em" or whatever.
Phssthpok is offline   Reply With Quote
Old 05-21-2017, 05:20 AM   #11
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
If you want to have a page break at every <h3>, then the best solution is to start a new file at every <h3>.
JSWolf is offline   Reply With Quote
Old 05-24-2017, 07:20 AM   #12
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Quote:
Originally Posted by JSWolf View Post
If you want to have a page break at every <h3>, then the best solution is to start a new file at every <h3>.
I think the idea is not to have a page break at every <h3>, but to link to the text rather than the top margin of the <h3> when the top margin appears at the bottom of one page and the text appears at the top of the next page.
Phssthpok is offline   Reply With Quote
Old 05-24-2017, 08:07 AM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Phssthpok View Post
I think the idea is not to have a page break at every <h3>, but to link to the text rather than the top margin of the <h3> when the top margin appears at the bottom of one page and the text appears at the top of the next page.
In that case, for the <h3>, don't use a top margin. It doesn't work when the margin falls at the bottom of the screen. Use padding-top instead. That does work.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can a toc.ncx point to an empty content tag? twedigteam ePub 7 02-08-2013 11:57 AM
pdf links go to wrong page uglyoldbob Onyx Boox 3 07-20-2012 10:20 AM
Kindler previewer not recognizing toc.ncx file, my html toc, or the start point... petercrowell Kindle Formats 2 05-01-2012 08:14 AM
Creator Should my ToC have links? roromx Kindle Formats 8 01-13-2012 02:33 PM
Generated TOC links back to TOC page in the book Caleb666 Sigil 7 08-17-2011 11:58 AM


All times are GMT -4. The time now is 07:49 AM.


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