![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 274
Karma: 391602
Join Date: Oct 2009
Location: Chicago, IL USA
Device: Sony PRS-350; Kobo Clara HD; Kobo Clara 2E; Kobo Clara BW
|
LRF>EPUB fouls up TOC links
I've been converting many Book Designer LRFs to EPUBs, now that I figured out how to tweak the resulting EPUB to make some minor font and line height adjustments.
Imagine my consternation when I tried to read a couple of these EPUBs on my Sony PRS-350 and found that all of my TOC links are suddenly off by one chapter. If I click in the TOC on chapter 1, it goes to chapter 2. Clicking on a chapter link takes me back to chapter 1 instead of the TOC. Strangely, the links work properly when viewed in Calibre. But NOT on the reader. And NOT in the Sony Library software either. EPUBs from other sources are all fine. Ideas, anyone?!? |
![]() |
![]() |
![]() |
#2 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,001
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Your TOC anchor is probably the Last item on the previous chapters page . Because the pages have been stitched together, they appear (almost,) correct. I have seen this a few times. I don't know how to get Calibre to do it otherwise. I just, tediously ![]() |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,612
Karma: 145864263
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Forget the internal ToC. Is the external (toc.ncx) correct?
|
![]() |
![]() |
![]() |
#4 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 274
Karma: 391602
Join Date: Oct 2009
Location: Chicago, IL USA
Device: Sony PRS-350; Kobo Clara HD; Kobo Clara 2E; Kobo Clara BW
|
First, I don't know much about html or CSS. How do I find the TOC anchor?
As for the TOC.ncx, I opened the EPUB in Sigil and got this: Code:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1" xml:lang="eng"> <head> <meta content="bfb5f440-ca3c-43f5-8b72-937849983ed6" name="dtb:uid"/> <meta content="2" name="dtb:depth"/> <meta content="calibre (0.8.33)" name="dtb:generator"/> <meta content="0" name="dtb:totalPageCount"/> <meta content="0" name="dtb:maxPageNumber"/> </head> <docTitle> <text>The Beasts of Tarzan</text> </docTitle> <navMap> <navPoint id="44fb58d9-ed97-4767-9299-6ed485aaae3d" playOrder="1"> <navLabel> <text>Start</text> </navLabel> <content src="Text/titlepage.xhtml"/> </navPoint> </navMap> </ncx> The problem is 100% repeatable. Links work fine in Calibre view, but never in Sony Library software or on either of 2 PRS-350's. How can the links be read differently by different software/devices? I thought the code was the code. |
![]() |
![]() |
![]() |
#5 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,001
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
You have (basically) No useful TOC, Only a Start point. (use the GoTo Menu (TOC) on your sony and see) AFAIK, Calibre will not attempt to create/maintain an inline TOC in EPUB. the NCX file is all to EPUB |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 274
Karma: 391602
Join Date: Oct 2009
Location: Chicago, IL USA
Device: Sony PRS-350; Kobo Clara HD; Kobo Clara 2E; Kobo Clara BW
|
I did not know there were two kinds of TOC. I've been creating my books in Book Designer with a TOC, then either:
1) Exporting as LRF to use as is, or 2) Exporting as HTM, to open in Sigil where I adjust font, line height, and split at each chapter. The Sigil EPUB gets converted again in Calibre, which further adjusts font sizes. (I found the "easiest" way by a lot of trial and error.) The inline (?) TOC holds up when doing it like this. It seems you are saying that, if I want to use Calibre to convert an LRF to EPUB, the TOC (originally created in BD) should be eliminated. How does the proper EPUB TOC you are talking about get created? In Sigil? In Calibre? I tried Calibre long ago with no success. Keep in mind, my HTM source is BD, which seems to put out somewhat unconventional code (from what I gather in these forums). |
![]() |
![]() |
![]() |
#7 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,001
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Me ![]() I use Sigil. Set Heading levels, Open the TOC Editor (if not open, I use that to Quick Jump to the Item), Click Generate TOC button, adjust Tics to Hide items (remove the tic at the bottom will show hidden one as well, (Make note if the level is wrong), Save Wash (edit ), Spin (repeat TOC), Hang out to dry (ship it) ![]() |
|
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
There is no 'One True Way' to do these things, everyone finds their own favourite method in the end.
If you're starting with a clean HTML file, my preferred method is to open it in a text editor and make sure that each chapter is marked up with suitable HTML heading tags. For instance, for a book with a single level TOC Code:
<h2>Chapter 1</h2> ... <h2>Chapter 2</h2> ... ... //h:h2 The resulting EPUB will have a TOC entry wherever you put the <h2>...</h2> tags. If your book needs a 2-level nested TOC, e.g. with Parts and Chapters, then you can try marking them Code:
<h2>Part 1</h2> <h3>Chapter 1</h3> ... <h3>Chapter 2</h3> ... ... <h2>Part 2</h2> <h3>Chapter 3</h3> ... <h3>Chapter 4</h3> ... ... //*[name()='h2' or name()='h3'] and on the TOC page set 'Level 1 TOC' box to //h:h2 'Level 2 TOC' box to //h:h3 The converted EPUB will have TOC entries for each item where you used either <h2>...</h2> or<h3>...</h3> tags. Each <h3> item will be nested inside the previous <h2> item, like the attached pic. |
![]() |
![]() |
![]() |
#9 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 274
Karma: 391602
Join Date: Oct 2009
Location: Chicago, IL USA
Device: Sony PRS-350; Kobo Clara HD; Kobo Clara 2E; Kobo Clara BW
|
Here's what the chapter code looks like from Book Designer when opened in Sigil:
Code:
<p><span id="title"><a id="BdToc_1"></a></span></p> <div class="sgc-3"> <span class="sgc-6" id="title">1 Technician</span> </div> Code:
<h2 class="title"><a id="BdToc_1"></a></h2> <div class="sgc-3"> <h2 class="title sgc-6">1 Technician</h2> </div> |
![]() |
![]() |
![]() |
#10 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,001
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Save your EPUB the new TOC should show in Calibre's book viewer (use TOC button) |
|
![]() |
![]() |
![]() |
#11 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 274
Karma: 391602
Join Date: Oct 2009
Location: Chicago, IL USA
Device: Sony PRS-350; Kobo Clara HD; Kobo Clara 2E; Kobo Clara BW
|
It works!
It looks like Calibre is the way to go, since the original HTM comes from BD. Simply dragging that into Calibre generates h2 tags where there was something else in BD. I used this to create the TOC and page breaks: Code:
//h:h2[re:test(@class, "title", "i")] I'm sure Sigil will be handy for any later tweaks I might need. This does not directly solve the LRF conversion problem, but I have the original BD files which can quickly put out HTM for Calibre conversion. Not to mention I discovered a type of TOC I didn't know existed. ![]() Many thanks to all! |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
TOC links inside tables in epub don't translate in mobi | wannabee | Calibre | 1 | 01-20-2011 01:13 AM |
epub: links in toc should not be underlined ... | NASCARaddicted | Calibre | 2 | 06-15-2010 06:26 PM |
ePub eBooks (Fully Edited w/ TOC) Fanfiction, Forumfiction [Links removed by OP] | Guns4Hire | Reading Recommendations | 12 | 02-25-2010 03:53 AM |
505 TOC from PDF to EPUB/LRF | wayamauro | Sony Reader | 18 | 09-27-2009 04:21 AM |
TOC created with EPUB but not LRF? | Achilles | Calibre | 7 | 08-07-2009 07:24 PM |