Today, 01:05 PM | #1 |
Junior Member
Posts: 1
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,972
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> |
Today, 02:04 PM | #3 |
Resident Curmudgeon
Posts: 75,128
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.
|
|
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 |