Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 09-30-2011, 02:36 PM   #1
therealjoeblow
Zealot
therealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfolded
 
Posts: 101
Karma: 52102
Join Date: Jun 2010
Device: Kobo Touch; Blackberry w/MobiPocket Reader
Occasional TOC navigation issues (epub goes to wrong loc'n)

I usually convert my source files, whether they are original .epub or .mobi to .htmlz so I can edit them for my preferences in styling, font sizes, etc., and then convert .htmlz back to .epub for use on my kobo.

In 99% of cases everything works perfectly.

However in a small number of cases, TOC navigation gets screwed up in a very minor way in the final epub - ie, selecting a TOC entry navigates to the last line of the text page *before* the actual chapter, instead of to the top of the page where the chapter number is as would be expected. When using the TOC on the original epub, it doesn't do that, and when using the in-line TOC in the HTML file it navigates exactly to the chapter number text, but not in the .epub.

Anyone know why and if there is a simple fix?

Cheers
The REAL Joe
therealjoeblow is offline   Reply With Quote
Old 09-30-2011, 02:42 PM   #2
theducks
Grand Sorcerer
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: 14,903
Karma: 5880479
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by therealjoeblow View Post
I usually convert my source files, whether they are original .epub or .mobi to .htmlz so I can edit them for my preferences in styling, font sizes, etc., and then convert .htmlz back to .epub for use on my kobo.

In 99% of cases everything works perfectly.

However in a small number of cases, TOC navigation gets screwed up in a very minor way in the final epub - ie, selecting a TOC entry navigates to the last line of the text page *before* the actual chapter, instead of to the top of the page where the chapter number is as would be expected. When using the TOC on the original epub, it doesn't do that, and when using the in-line TOC in the HTML file it navigates exactly to the chapter number text, but not in the .epub.

Anyone know why and if there is a simple fix?

Cheers
The REAL Joe
I think this has to do with where the Anchor was placed in the original file Before a split happens in Calibre.

I am not sure that Calibre can detect an Anchor that happens Before an Chapter heading.
theducks is offline   Reply With Quote
Old 09-30-2011, 07:20 PM   #3
therealjoeblow
Zealot
therealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfolded
 
Posts: 101
Karma: 52102
Join Date: Jun 2010
Device: Kobo Touch; Blackberry w/MobiPocket Reader
Quote:
Originally Posted by theducks View Post
I think this has to do with where the Anchor was placed in the original file Before a split happens in Calibre.

I am not sure that Calibre can detect an Anchor that happens Before an Chapter heading.
Yep, I had an anchor, then the <div class="pagebreak"> then another anchor, then my chapter heading (h2). I moved the pagebreak to before the first anchor (so now I have div, a, a, h2) and it works fine, only this is a manual pain in the butt. I was hoping there was some way to tell Calibre to put these in the right order, regardless of how the original source put them, but I guess that's asking a bit much...

Cheers
The REAL Joe
therealjoeblow is offline   Reply With Quote
Old 09-30-2011, 07:47 PM   #4
theducks
Grand Sorcerer
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: 14,903
Karma: 5880479
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by therealjoeblow View Post
Yep, I had an anchor, then the <div class="pagebreak"> then another anchor, then my chapter heading (h2). I moved the pagebreak to before the first anchor (so now I have div, a, a, h2) and it works fine, only this is a manual pain in the butt. I was hoping there was some way to tell Calibre to put these in the right order, regardless of how the original source put them, but I guess that's asking a bit much...

Cheers
The REAL Joe
If you have a Chapter per file, there really is no need for a chapter anchor.
(the #...) part in the NCX. the chapter_filename is enough. The file opens at the beginning in lieu of any directive.

You do need mid file anchors., but those are not the problem you are having.
theducks is offline   Reply With Quote
Old 09-30-2011, 08:07 PM   #5
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 2,857
Karma: 4200035
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"/AuraH2O
Quote:
Originally Posted by therealjoeblow View Post
Yep, I had an anchor, then the <div class="pagebreak"> then another anchor, then my chapter heading (h2). I moved the pagebreak to before the first anchor (so now I have div, a, a, h2) and it works fine, only this is a manual pain in the butt....
You don't need anything other than the chapter heading tags (<h2> in your case) in your html file. Calibre will insert the chapter pagebreaks when you convert the html to epub, depending on your settings on the Convert - StructureDetection page.
jackie_w is offline   Reply With Quote
Old 09-30-2011, 10:20 PM   #6
therealjoeblow
Zealot
therealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfoldedtherealjoeblow reads XML... blindfolded
 
Posts: 101
Karma: 52102
Join Date: Jun 2010
Device: Kobo Touch; Blackberry w/MobiPocket Reader
Quote:
Originally Posted by jackie_w View Post
You don't need anything other than the chapter heading tags (<h2> in your case) in your html file. Calibre will insert the chapter pagebreaks when you convert the html to epub, depending on your settings on the Convert - StructureDetection page.
True, but without the anchors, then the in-line TOC (ie with the HTML hyperlinks) doesn't work...
therealjoeblow is offline   Reply With Quote
Old 09-30-2011, 11:10 PM   #7
theducks
Grand Sorcerer
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: 14,903
Karma: 5880479
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by therealjoeblow View Post
True, but without the anchors, then the in-line TOC (ie with the HTML hyperlinks) doesn't work...
You don't need anchors in the Chapter files.

Sample TOC:
Spoiler:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>/title>
<link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css" />
<style type="text/css">
/*<![CDATA[*/

@page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; }

span.sgc-1 {text-decoration:underline}
/*]]>*/
</style>
</head>

<body class="calibre">
<p class="calibre2" id="filepos272124"><span class="calibre3 bold">Table of Contents</span></p>

<p class="calibre12"><a class="calibre8" href="../Text/c01.html"><span class="calibre9 calibre10 sgc-1">Chapter One</span></a></p>

<p class="calibre12"><a class="calibre8" href="../Text/c02.html"><span class="calibre9 calibre10 sgc-1">Chapter Two</span></a></p>

<p class="calibre12"><a class="calibre8" href="../Text/c03.html"><span class="calibre9 calibre10 sgc-1">Chapter Three</span></a></p>

<p class="calibre12"><a class="calibre8" href="../Text/c04.html"><span class="calibre9 calibre10 sgc-1">Chapter Four</span></a></p>

<p class="calibre12"><a class="calibre8" href="../Text/c05.html"><span class="calibre9 calibre10 sgc-1">Chapter Five</span></a></p>

<p class="calibre12"><a class="calibre8" href="../Text/c06.html"><span class="calibre9 calibre10 sgc-1">Chapter Six</span></a></p>

<p class="calibre12"><a class="calibre8" href="../Text/c07.html"><span class="calibre9 calibre10 sgc-1">Chapter Seven</span></a></p>

<p class="calibre12"><a class="calibre8" href="../Text/c08.html"><span class="calibre9 calibre10 sgc-1">Chapter Eight</span></a></p>
<p class="calibre12"><a class="calibre8" href="../Text/epi.html"><span class="calibre9 calibre10 sgc-1">Epilogue</span></a></p>


</body>
</html>


BTW I had to fix the file nameD, they were off by one. Chapter 1 was calling the Prologue file (someone else's Calibre conversion)

Last edited by theducks; 09-30-2011 at 11:11 PM. Reason: Spoiler added
theducks is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fix TOC that points to wrong chapter? lunixer Sigil 20 07-31-2011 07:27 PM
Unicode characters OK in text but wrong in TOC paulpeer ePub 8 01-15-2010 06:17 PM
Making a TOC for LRFs? Issues with Calibre + LRF TOC editor not working Magitek LRF 0 05-06-2009 01:25 PM
Missing interface for threaded TOC navigation? salty-horse Sony Reader 0 11-28-2008 08:26 AM


All times are GMT -4. The time now is 02:22 AM.


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