Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 07-13-2015, 10:25 AM   #1
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
ePub -> AZW3 bug: inline ToC gets wrong styles

Converting an ePub to AZW3 with a calibre-generated inline ToC, I notice that the entries have bullets next to them in the converted output. The problem seems to be that the list elements are given a style called "calibre5" which is defined in "0002.css", but the file has a link to "stylesheet.css" (which existed in the original ePub, but was renamed during the conversion).

Here is what was in the ePub to start with:

Code:
  <title>Table of Contents</title>
  <style type="text/css">
  li {
    list-style-type: none;
    padding-left: 0;
    text-indent: -2em;
    margin-left: 3em;
  }
  a {
    text-decoration: none;
  }
  a:hover {
    color: red;
  }
  h2 {
    font-size: 1.2em;
    text-align: center;
    margin: 2em;
  }
  </style>
</head>

<body id="calibre_generated_inline_toc">

  <h2>Table of Contents</h2>

  <ul class="level1">

    <li><a href="OEBPS/Text/part01.htm">Blah blah blah</a></li>
This is what was in the converted AZW3:

Code:
  <link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
<link href="../../page_styles.css" rel="stylesheet" type="text/css"/>
</head>
  <body class="calibre4" id="calibre_generated_inline_toc">

  <h2 class="calibre3" id="UGI1-4fea6e757c1d4c01a3ff37dcdd3f221e">Table of Contents</h2>

  <ul class="level">

    <li class="calibre5"><a class="pcalibre calibre6" href="part0002.html#1T142-4fea6e757c1d4c01a3ff37dcdd3f221e">Blah blah blah</a></li>
The stylesheet files in the AZW3 output are in fact called 0001.css and 0002.css. The reference to page_styles.css should be 0001.css, and stylesheet.css should be 0002.css.
Phssthpok is offline   Reply With Quote
Old 07-13-2015, 11:30 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,342
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
IIRC the generated inline toc in azw3 output has none of that. What you are looking at looks to be a remnant from a conversion of an azw3 with an existing inline toc to epub and then back to azw3. I suggest deleting it from the epub in the editor and re-running the conversion.
kovidgoyal is offline   Reply With Quote
Advert
Old 07-14-2015, 04:29 AM   #3
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Quote:
Originally Posted by kovidgoyal View Post
IIRC the generated inline toc in azw3 output has none of that. What you are looking at looks to be a remnant from a conversion of an azw3 with an existing inline toc to epub and then back to azw3. I suggest deleting it from the epub in the editor and re-running the conversion.
No, this file has never been an AZW3 before. I created the inline TOC myself while editing the ePub prior to conversion. The conversion has generated a link to page_styles.css which does not exist in the original ePUB, which should be called 0001.css, and the inline styles have been moved into 0002.css, which is incorrectly referenced as stylesheet.css.

Any conversion which creates links to non-existent files is surely a bug.
Phssthpok is offline   Reply With Quote
Old 07-14-2015, 04:49 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,342
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
This is what I get for failing to follow my own SOP.

See https://www.mobileread.com/forums/sho...d.php?t=186697
kovidgoyal is offline   Reply With Quote
Old 07-14-2015, 04:56 AM   #5
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
I have done some experiments and discovered a fix, which may in turn suggest the cause of the bug.

The HTML files in the book are in a directory called OEBPS/Text. The inline ToC that Calibre generates is placed in the root directory, and the symptoms on conversion are then as I describe. However, renaming the ToC to be OEBPS/Text/toc.xhtml fixes the problem.

This suggests that the conversion is struggling with files in the root directory. Note that the links are to CSS files in "../..". This suggests to me that the initial conversion from EPUB to internal XHTML generated these links, and the output conversion to EPUB ignored them. The stylesheet files in the ePUB are in OEBPS/Styles, by the way, so the correct way of referring to them would be "../Styles/stylesheet.css".

The AZW3 has all the HTML in a directory called "text" and the CSS is in "styles".

It seems that either the inline ToC generatior should put the file in the same directory as the other HTML files, or the conversion from EPUB should handle HTML files in a mix of directories correctly, or (ideally) both.
Phssthpok is offline   Reply With Quote
Advert
Old 07-14-2015, 04:57 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,342
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Once again, I suggest you stop speculating and just follow the steps outlined in

https://www.mobileread.com/forums/sho...d.php?t=186697
kovidgoyal is offline   Reply With Quote
Old 07-14-2015, 05:02 AM   #7
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Quote:
Originally Posted by kovidgoyal View Post
This is what I get for failing to follow my own SOP.

See https://www.mobileread.com/forums/sho...d.php?t=186697
So, I could file a bug report; or is there enough information here to avoid doing so? Filing a bug report would involve me creating an artificial book which shows up the problem as an example... which I could do, but don't hold your breath...
Phssthpok is offline   Reply With Quote
Old 07-14-2015, 05:35 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,342
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You need to open a bug report. This problem is almost certainly a case of GIGO.
kovidgoyal is offline   Reply With Quote
Old 07-14-2015, 05:42 AM   #9
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Sigh. OK, reported as bug #1474287, with attached ePUB which converts incorrectly.
Phssthpok is offline   Reply With Quote
Old 07-14-2015, 05:43 AM   #10
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,443
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Gazumped. Post no longer useful...
chaley is offline   Reply With Quote
Old 07-14-2015, 06:34 AM   #11
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,342
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Ahh, now I get it. You are talking about the insert inline toc function in the editor, not the one in the conversion pipeline.
kovidgoyal is offline   Reply With Quote
Old 07-14-2015, 10:52 AM   #12
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Quote:
Originally Posted by kovidgoyal View Post
Ahh, now I get it. You are talking about the insert inline toc function in the editor, not the one in the conversion pipeline.
Yes. Sorry if I was unclear. However, I just went and added the generated AZW3 to the bug report, and discovered (after posting) that you'd already fixed it... thanks for the impressive speed!

Now all I have to do is check and reconvert a pile of stuff when the next release comes out... :-(
Phssthpok is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Epub to AZW3, TOC margins off, text OK Ma'am-I-Am Conversion 0 10-18-2014 07:40 PM
azw3 to epub - structure detection bug ? cybmole Conversion 6 02-02-2014 07:24 PM
Inline Styles and Overrides ukzembla Kindle Formats 2 01-18-2012 07:06 AM
Bug Report: Mobi Conversion puts TOC Nav in wrong spot therealjoeblow Conversion 4 12-02-2011 09:56 AM
Use Regex to Code an Inline TOC, from an External TOC's .ncx File mostlynovels ePub 2 03-16-2011 12:15 PM


All times are GMT -4. The time now is 09:13 PM.


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