Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 12-19-2018, 12:46 PM   #1
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
Links in TOC don't take to the right ID

What can cause links in the TOC not to send to the right location?

My epub3 is built with Calibre, I've run Calibre check book and epub validator and the books tested ok.

If I open the book in Calibre/iBooks and click on a TOC item I am redirected to the corresponding file but the HTML tag (<h1) didn't appear on top of my screen, basically, the TOC link just takes me to the right file.

The TOC link looks like this:
Code:
<ol>
    <li>
      <a href="intro.xhtml">Intro</a>
      <ul>
        <li><a href="intro_1.xhtml#toc_1">TakeMeThere</a></li>
      </ul>
    </li>
</ol>
The heading tag looks like this:
Code:
<h1 id="toc_1">Welcome</h1>
What could cause this not to work?
odedta is offline   Reply With Quote
Old 12-20-2018, 12:34 AM   #2
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,356
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
How did you generate that TOC entry? I've haven't seen an epub3 navigation document that used nested ordered and unordered lists though I suppose one could be manually generated. What does your epub3 declare as the navigation document in the content.opf The declaration should look something like:
Code:
<item href="Text/nav.xhtml" id="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/>
I've attached a quick and dirty test file created using Sigil and when I click on a link in the toc.xhtml, the cursor is placed on the <h1> tag line. After generating a nav.xhtml document, the links there also work correctly in Sigil placing the cursor on the <h1> tag line. Using calibre's ebook viewer, the <h1> line shows on the screen but not at the top of the page. After doing some checking, I couldn't find anything in the epub 3.01 spec that requires that link to be placed at the top of the page. A page break before might work--if you can find a system that supports it. About the only reliable answer I've found is to split the text files so the header at the top of it's own file.
Attached Files
File Type: epub Lorem Ipsum test e3.epub (7.3 KB, 147 views)

Last edited by DNSB; 12-20-2018 at 01:28 AM. Reason: Fat Fingered Typos©
DNSB is offline   Reply With Quote
Advert
Old 12-20-2018, 01:36 AM   #3
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
Hello David and thank you very much for taking the time to try and help!

I use Calibre to generate TOC since it's so handy :-)
My TOC file looks like this:

Code:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:ibooks="http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0" epub:prefix="ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0">

<head>
  <title>Book title</title>
  <link href="../css/styles.css" rel="stylesheet" type="text/css"/>
</head>

<body xml:lang="he" dir="rtl">

  <nav id="toc" epub:type="toc">
    <ol>
      <li>
        <a href="intro.xhtml">Intro</a>
        <ul>
          <li><a href="intro_1.xhtml#toc_1">TakeMeThere</a></li>
        </ul>
      </li>
    </ol>
   </nav>
</body>
</html>
Declaration in content.opf:
Code:
<item href="text/toc.xhtml" id="nav" media-type="application/xhtml+xml" properties="nav"/>
So from what I understand there seems to be no way to get the reader to jump to the right location?

P.S:
Did you use
Code:
<!doctype html>
on purpose? I don't see the point since this file extension is xhtml and not html(5).

Thanks again!
odedta is offline   Reply With Quote
Old 12-20-2018, 12:13 PM   #4
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,356
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by odedta View Post
So from what I understand there seems to be no way to get the reader to jump to the right location?
I tried the page break before in my test file and it works in a couple of readers including ADE. However, as expected, iBooks disregards it.

Quote:
Originally Posted by odedta View Post
P.S:
Did you use
Code:
<!doctype html>
on purpose? I don't see the point since this file extension is xhtml and not html(5).
It's part of the boilerplate when I create a epub in Sigil. While it makes no real difference, it can trigger the correct validation in some error checkers so I just leave it alone. You can't reference XHTML in the doctype declaration since it would appear as an external entity which are not supported and will trigger a validation error.

From years back, I seem to remember a reference to workarounds for page breaks and iBooks from Elizabeth Castro's pigsgourdsandwikis.com site but not something that I paid much attention to at the time.
DNSB is offline   Reply With Quote
Old 12-21-2018, 10:49 AM   #5
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
Quote:
Originally Posted by odedta View Post
My epub3 is built with Calibre
I think you would be happier, and get better results, if you used Sigil instead.
Notjohn is offline   Reply With Quote
Advert
Old 12-21-2018, 11:36 AM   #6
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,356
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Notjohn View Post
Quote:
Originally Posted by odedta View Post
My epub3 is built with Calibre
I think you would be happier, and get better results, if you used Sigil instead.
Six of one, 2 threes of the other. I use Sigil but will switch to calibre's editor at times where I find it makes some tasks easier. Possibly a bit of a baby duckling syndrome.
DNSB is offline   Reply With Quote
Old 12-21-2018, 05:19 PM   #7
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,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by odedta View Post
What can cause links in the TOC not to send to the right location?

My epub3 is built with Calibre, I've run Calibre check book and epub validator and the books tested ok.

If I open the book in Calibre/iBooks and click on a TOC item I am redirected to the corresponding file but the HTML tag (<h1) didn't appear on top of my screen, basically, the TOC link just takes me to the right file.

The TOC link looks like this:
<snippage>

What could cause this not to work?

Wait--I thought, when you asked me about this, you meant that it was going to the WRONG place. Is this all about simply that the linked section doesn't scroll to the top of the screen?

It doesn't do that, in ePUB. It does in MOBI.

Hitch
Hitch is offline   Reply With Quote
Old 12-22-2018, 04:53 AM   #8
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
Quote:
Originally Posted by Notjohn View Post
I think you would be happier, and get better results, if you used Sigil instead.
Calibre has so many nice functions like Check Book, Remove unused CSS, toc editor etc, it's very handy, plus, I don't like to use software that its development was abandoned.
Actually, I was just checking and I see someone picked up the development so I'm curious to how is it. Why do you find Sigil better than Calibre?

Quote:
Originally Posted by Hitch;
Wait--I thought, when you asked me about this, you meant that it was going to the WRONG place. Is this all about simply that the linked section doesn't scroll to the top of the screen?

It doesn't do that, in ePUB. It does in MOBI.
Oh hehe yes, sorry I wasn't clear enough. I didn't know that ePub doesn't do that, bummer!
odedta is offline   Reply With Quote
Old 12-22-2018, 10:50 AM   #9
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,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by odedta View Post
Calibre has so many nice functions like Check Book, Remove unused CSS, toc editor etc, it's very handy, plus, I don't like to use software that its development was abandoned.
Actually, I was just checking and I see someone picked up the development so I'm curious to how is it. Why do you find Sigil better than Calibre?
Uh, Odedta, you're not keeping up. Sigil is well-maintained now by Kevin and Diap, and has been for several years. Moreover, it has ALL those functions as well. (Some originated with Sigil, in fact, if not all.)


Quote:
Oh hehe yes, sorry I wasn't clear enough. I didn't know that ePub doesn't do that, bummer!
Well, at least, now you know. I thought that there wasn't anything wrong with that coding (not counting using the list formatting stuff, that doesn't work) when I looked at it, although it's hard for me to know, as I can't read Hebrew and right-to-left throws me a bit; so, you can relax now. :-)

Hitch
Hitch is offline   Reply With Quote
Old 12-22-2018, 11:12 AM   #10
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,795
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by DNSB View Post
Six of one, 2 threes of the other. I use Sigil but will switch to calibre's editor at times where I find it makes some tasks easier. Possibly a bit of a baby duckling syndrome.
I'm in your camp. I use both.
I tend to like Sigil's saved searches and clips.Mostly that was what I learned on., But I prefer Calibres debug, CSS cleaner and TOC editor

Do I want the other to duplicate the others L&F?
H*ll No! I have a choice of tools that fit MY work style.
theducks is offline   Reply With Quote
Old 12-22-2018, 11:30 AM   #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,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Hell, I'm in the "uses both" camp! Never really thought of it as a competition.
DiapDealer is online now   Reply With Quote
Old 12-22-2018, 04:26 PM   #12
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
Quote:
Originally Posted by odedta View Post
Actually, I was just checking and I see someone picked up the development so I'm curious to how is it. Why do you find Sigil better than Calibre?
Yes, it has long had two active developers and an active Sigil forum on this website. It is now far advanced than when I first picked it up in 2012.

I'm writing books for publication. Sigil is designed precisely to do that, whereas Calibre is a library-management tool. (Kovid evidently developed Calibre Editor to fill the gap when Sigil was briefly orphaned, but I've never tried the Editor.) Besides, Amazon is notorious for rejecting books created by Calibre. It may not be a large percentage, but it is a long-standing problem.

Give Sigil a try. It is a powerful and sophisticated program, and Preview Panel for all practical purposes makes it WYSIWYG. It creates the "logical" or virtual TOC on the fly, so neatly that it scarcely needs any attention.

I still use epub2, validated by the Flight Crew plug-in. I upload the epub (without an included cover) to Amazon's KDP platform, and with a cover to Draft2Digital and Google Play.

Of course, if you aren't actively publishing books, Calibre may be just what you require. I regularly use it to convert epubs to mobi format, to read on my Fire tablet. Less often, I use it to reverse-engineer an ebook and get it into Word format for revision.
Notjohn is offline   Reply With Quote
Old 12-22-2018, 06:30 PM   #13
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,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Notjohn View Post
I'm writing books for publication. Sigil is designed precisely to do that, whereas Calibre is a library-management tool. (Kovid evidently developed Calibre Editor to fill the gap when Sigil was briefly orphaned, but I've never tried the Editor.)
You should try it. It's a full featured epub editor. Calibre's library management system has no bearing on the abilities of the editor (other than being able to utilize relevant portions of the codebase). It is actively maintained and updated.

Quote:
Originally Posted by Notjohn View Post
Besides, Amazon is notorious for rejecting books created by Calibre. It may not be a large percentage, but it is a long-standing problem.
You're conflating issues. Amazon was known for rejecting some calibre-converted mobis and azw3s. That has zero bearing on epubs edited with calibre's editor. The editor has nothing to do with calibre's conversion pipeline.

I appreciate your dedication to Sigil, but your reluctance to use or recommend calibre's editor to edit epubs is based on unfounded fears/biases.
DiapDealer is online now   Reply With Quote
Old 12-22-2018, 07:26 PM   #14
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,956
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
@odeta, doyou actiall need an ID in the ToC? Are you jumping someplace in the middle of an XML file? It slows down the ePub if you use unnecessary ID links. If you are just linking to the XML file and do not need the ID, dump the ID.
JSWolf is online now   Reply With Quote
Old 12-23-2018, 12:54 AM   #15
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
Quote:
Originally Posted by JSWolf View Post
@odeta, doyou actiall need an ID in the ToC? Are you jumping someplace in the middle of an XML file? It slows down the ePub if you use unnecessary ID links. If you are just linking to the XML file and do not need the ID, dump the ID.
Yes I need to point to a specific location of some files since the book has chapters and headings in each chapter, I don't see the reason to bring the reader to the beginning of the chapter when you want to get them to the heading at the end of the chapter.

@Notjohn, Thanks! I will try Sigil out, I can't believe it's been years now since I last tried it and actually made an ebook
odedta is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre ToC links don't work in OverDrive zoomiest Conversion 3 12-29-2017 10:15 AM
Generated TOC links back to TOC page in the book Caleb666 Sigil 7 08-17-2011 11:58 AM
TOC links inside tables in epub don't translate in mobi wannabee Calibre 1 01-20-2011 01:13 AM
Links to URLs work, internal links don't? NewDay ePub 36 10-27-2010 04:09 AM
Links don't work ragdoll iRex 3 02-21-2008 01:47 PM


All times are GMT -4. The time now is 03:18 PM.


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