Today, 01:05 PM | #1 |
Junior Member
Posts: 6
Karma: 10
Join Date: Jul 2024
Device: iPad
|
Generated TOC links go to wrong place
I'm told that this is user error (https://bugs.launchpad.net/calibre/+bug/2074284), so I'm checking here.
I'm trying to generate a TOC using Calibre 7.10, for an ePub that has very well-formed chapters and chapter/section headings. In the tutorial at https://manual.calibre-ebook.com/con...le-of-contents, I found these instructions: Then, we set the options as: Level 1 TOC : //h:h1 This will result in an automatically generated two level Table of Contents that looks like:Level 2 TOC : //h:h2 Chapter 1 Section 1.1 Chapter 2Section 1.2 Section 2.1 <navPoint id="uIXA2jfX6ChloBsjmNnSAg9" playOrder="2" class="chapter"> <navLabel> <text>1月</text> </navLabel> <content src="OPS/chapter-2_split_000.xhtml"/> <navPoint id="uqfPktaL93cTQmqLLO4idQ3" playOrder="2" class="chapter"> <navLabel> <text>1月1日</text> </navLabel> <content src="OPS/chapter-2_split_000.xhtml"/> </navPoint> <navPoint id="utq9DOX7bB9u69KAIm5i7y2" playOrder="2" class="chapter"> <navLabel> <text>1月2日</text> </navLabel> <content src="OPS/chapter-2_split_000.xhtml"/> </navPoint> Note that the src link for each of the contained navLabels points to ...split_000.xhtml. But, the actual header elements for the contained navLabels are not in ...split_000; they're in ...split_001, ...split_002, etc. So. What do I need to do to convince Calibre that I actually want the section links to point to the sections themselves, and not to the chapter? |
Today, 02:00 PM | #2 |
Bibliophagist
Posts: 37,998
Karma: 150500000
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
You will need to either split the files at the sections or use IDs to locate the section headers. All your current links are pointing to the same file which suggests that your sections are in the same file as the chapter header with no way to differentiate them.
Code:
<h1>Chapter 1</h1> <h2 id="section0001">Section 1</h2> <h2 id="section0002">Section 2</h2> <h2 id="section0003">Section 3</h2> <h2 id="section0004">Section 4</h2> <h2 id="section0005">Section 5</h2> <h2 id="section0006">Section 6</h2> Code:
<navMap> <navPoint id="navPoint1"> <navLabel> <text>Chapter 1</text> </navLabel> <content src="Text/Section0001.xhtml" /> <navPoint id="navPoint2"> <navLabel> <text>Section 1</text> </navLabel> <content src="Text/Section0001.xhtml#section0001" /> </navPoint> <navPoint id="navPoint3"> <navLabel> <text>Section 2</text> </navLabel> <content src="Text/Section0001.xhtml#section0002" /> </navPoint> <navPoint id="navPoint4"> <navLabel> <text>Section 3</text> </navLabel> <content src="Text/Section0001.xhtml#section0003" /> </navPoint> <navPoint id="navPoint5"> <navLabel> <text>Section 4</text> </navLabel> <content src="Text/Section0001.xhtml#section0004" /> </navPoint> <navPoint id="navPoint6"> <navLabel> <text>Section 5</text> </navLabel> <content src="Text/Section0001.xhtml#section0005" /> </navPoint> <navPoint id="navPoint7"> <navLabel> <text>Section 6</text> </navLabel> <content src="Text/Section0001.xhtml#section0006" /> </navPoint> </navPoint> </navMap> |
Advert | |
|
Today, 02:04 PM | #3 |
Resident Curmudgeon
Posts: 75,144
Karma: 132820308
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Before posting an error report, make sure you are using the latest calibre in case the error has been fixed.
|
Today, 07:05 PM | #4 |
Junior Member
Posts: 6
Karma: 10
Join Date: Jul 2024
Device: iPad
|
The whole point of my post is that they're not in the same file; all of them are in different files. See what I said about ...split_000, split_001, etc.
|
Today, 07:11 PM | #5 |
Junior Member
Posts: 6
Karma: 10
Join Date: Jul 2024
Device: iPad
|
I just confirmed that the same issue is present in 7.15.
Last edited by brendontowle; Today at 07:13 PM. |
Advert | |
|
Today, 07:19 PM | #6 |
Junior Member
Posts: 6
Karma: 10
Join Date: Jul 2024
Device: iPad
|
I've attached the .epub I'm trying to convert if that's helpful to anyone.
|
Today, 07:45 PM | #7 |
Bibliophagist
Posts: 37,998
Karma: 150500000
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
For what it may be worth, your ePub did not contain any section files with names such as whatever_split_0001, see the attached image. I took a couple of seconds to open the file in Sigil and use it's ToC tool to regenerate the ePub3 nav document and the ncx ePub2 nav document for the h1/h2 header items. It seems to move to the section headers now in Sigil and calibre's viewer.
Last edited by DNSB; Today at 07:51 PM. |
Today, 09:26 PM | #8 |
creator of calibre
Posts: 44,157
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Your EPUB already has a table of contents, did you check the option to "Force use of auto-generated table of contents" without that the existing table of contents will be used.
|
Today, 09:37 PM | #9 |
Junior Member
Posts: 6
Karma: 10
Join Date: Jul 2024
Device: iPad
|
|
Today, 09:39 PM | #10 | |
Junior Member
Posts: 6
Karma: 10
Join Date: Jul 2024
Device: iPad
|
Quote:
|
|
Today, 09:40 PM | #11 |
creator of calibre
Posts: 44,157
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
It's because your EPUB file is using chinese characters in id attributes. These break with some EPUB renderers like adobe digital editions. If you look at the conversion log it will be full of messgaes like
Removing fragment identifier '4月10日' from TOC as Adobe Digital Editions cannot handle it |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need help figuring out what's wrong with an ePub I generated | Angius | ePub | 5 | 07-25-2024 08:35 AM |
PW3 5.12.3 Serial Jailbreak - generated root password is wrong | texaspete | Kindle Developer's Corner | 2 | 07-27-2020 11:00 AM |
TOC in wrong place? | Cyberseeker | Kobo Reader | 2 | 07-07-2017 01:15 AM |
TOC links point to wrong page! | fluoresce | ePub | 12 | 05-24-2017 08:07 AM |
Generated TOC links back to TOC page in the book | Caleb666 | Sigil | 7 | 08-17-2011 11:58 AM |