MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   Opening ePub in Sigil breaks TOC and loses italics (https://www.mobileread.com/forums/showthread.php?t=95841)

PatNY 08-24-2010 10:03 PM

Opening ePub in Sigil breaks TOC and loses italics
 
I'm having a problem whereby simply opening up a certain ePub file, the TOC becomes un-nested and the italics in the book are lost. The only editing I did was to add an extra line of space between one of the headers and the body text in one of the sections before the book starts. And I know it's not the edit that "broke" things because before I do any edits and check the TOC in the TOC editor I can see how the TOC has already been changed. So something is being done upon import.

The epub file is one converted by Calibre from an original epub.

Does anyone have any idea what can be going on?

shall1028 08-24-2010 10:13 PM

Two (X)HTML excerpts from the original epub file (not imported into Sigil) would be useful.

1) two heading lines that should be nested in the TOC

e.g.

<some-tag>This heading should be the parent</some-tag>
<some-other-tag>This one should be the child</some-other-tag>

2) an excerpt of some words that should be italicized with some unitalicized ones each side.

e.g.

this is in Roman and <some-font-changing>this is Italics</some-font-changing>; of course we're back to Roman.

PatNY 08-25-2010 12:10 AM

Quote:

Originally Posted by shall1028 (Post 1073727)
Two (X)HTML excerpts from the original epub file (not imported into Sigil) would be useful.

1) two heading lines that should be nested in the TOC

e.g.

<some-tag>This heading should be the parent</some-tag>
<some-other-tag>This one should be the child</some-other-tag>;

Sorry, forgot to mention it is the metadata TOC that is being broken. To be honest I rarely use an in-line TOC and often ignore or delete it. Will it help if I send someone the file to diagnose?

Quote:

2) an excerpt of some words that should be italicized with some unitalicized ones each side.

e.g.

this is in Roman and <some-font-changing>this is Italics</some-font-changing>; of course we're back to Roman.
Here's an excerpt from the file where the italics are lost upon import:

Code:

Don’t tell me it’s<span class="italic">my</span>fault.

theducks 08-25-2010 12:24 AM

Quote:

Originally Posted by
[CODE
Don’t tell me it’s<span class="italic">my</span>fault.[/CODE]

is there a class ".italics" in the style sheet?
Italics is not a "pre-defined" Style"

Code:

.italics{
  font-style: italic
}


shall1028 08-25-2010 03:23 AM

Me like specifying italics with the italics tag <i> (who'd a thunk it?) or at the very least the emphasis <em> tag.

Don’t tell me it’s <i>my</i> fault.

Phooey on SPAN! Double PHOOEY on SPAN plus a class!

shall1028 08-25-2010 03:28 AM

epub TOC concern
 
Quote:

To be honest I rarely use an in-line TOC and often ignore or delete it.
By in-line I suspect you mean as part of an HTML file and I agree that with an epub file having a table of contents ability an in HTML TOC is pointless.

Quote:

Sorry, forgot to mention it is the metadata TOC that is being broken.
I did expect this to be what you meant. I was looking for the headings examples as Sigil will compose the epub TOC from them auto-magically.

PatNY 08-25-2010 08:17 AM

theducks, I looked at the css and there is no class ".italics" defined there. But Calibre has no problems reading or converting the epub while maintaining italics so why should Sigil?

I also need to correct something I said earlier. The italics are still there when I open the epub in Sigil. It's when saving an epub in Sigil that they are lost. The metadata TOC, however, is changed immediately upon opening in Sigil.


Quote:

Originally Posted by shall1028 (Post 1073960)
I was looking for the headings examples as Sigil will compose the epub TOC from them auto-magically.

Ok, here is what the coding looks like for the headings that are in the TOC:

heading top level:

Code:

<div class="partHead" id="ph01">
                                <h2 class="partNumber" style="text-indent: 0%;">
                                        <span class="bold">
                                                Part 1
                                        </span>
                                </h2>
                                <h2 class="partTitle" style="text-indent: 0%;">
                                        <span class="bold">
                                                Memories Are Like Raindrops
                                        </span>
                                </h2>
                        </div>


heading next level:

Code:

<div class="chapterHead">
                                <h2 class="chapterNumber" style="text-indent: 0%;">
                                        <span class="bold">
                                                1
                                        </span>
                                </h2>
                                <h2 class="chapterTitle" style="text-indent: 0%;">
                                        <span class="bold">
                                                Ebb &amp; Flow
                                        </span>
                                </h2>
                        </div>

The TOC should look like this (and does in Calibre & on my Touch):

Part 1: Memories Are Like Raindrops
1. Ebb & Flow


But in Sigil, immediately upon opening up the file, it looks like:

Part 1
Memories Are Like Raindrops
1
Ebb & Flow


All I wanted to do was to put some extra space between the chapter headings and the body text in this epub file. I discovered pdfhtml inspector last night and it will let me do it without messing up the TOC and italics, but it's not as user-friendly as Sigil. I much prefer Sigil for its wysiwyg interface.

So is there an easy fix that will let me use Sigil?

Valloric 08-25-2010 08:38 AM

Quote:

Originally Posted by PatNY (Post 1074233)
theducks, I looked at the css and there is no class ".italics" defined there. But Calibre has no problems reading or converting the epub while maintaining italics so why should Sigil?

I also need to correct something I said earlier. The italics are still there when I open the epub in Sigil. It's when saving an epub in Sigil that they are lost.

Create a new issue on the tracker and attach the epub so that I can take a look at what's going on.

Quote:

Originally Posted by PatNY (Post 1074233)
The metadata TOC, however, is changed immediately upon opening in Sigil.

As the manual says, Sigil creates the TOC from the headings in the text (like MS Word and OO Writer). Support for direct NCX preservation is forthcoming.

To get this in Sigil:

Part 1: Memories Are Like Raindrops
1. Ebb & Flow

you would use something like this:

Code:

<h2>Part 1: Memories Are Like Raindrops</h2>
<h3>1. Ebb &amp; Flow</h3>

You can put spans around parts of the text if you want to style them differently, and if you want to indent the <h3>, use an element/class style.

charleski 08-25-2010 08:45 AM

Sigil refactors the ToC based on the semantics of the html.

This means that your heading elements must use h tags to indicate the level. Since all the headings in your example are h2 tags, they will all end up on the same ToC level as you found. Furthermore, each individual h tag will generate a new ToC entry.

Your code needs to look like this:
Code:

<div class="partHead" id="ph01">
                                <h1 class="partNumber" style="text-indent: 0%;">
                                        <span class="bold">
                                                Part 1<br />
                                                Memories Are Like Raindrops
                                        </span>
                                </h1>
                        </div>
<div class="chapterHead">
                                <h2 class="chapterNumber" style="text-indent: 0%;">
                                        <span class="bold">
                                                1<br />
                                                Ebb &amp; Flow
                                        </span>
                                </h2>
                        </div>

If your headings all use the same format then it's easy to change this globally with a couple of regular expressions.

If you're using span class="italic" in the code then you definitely need a corresponding selector in your css.

PatNY 08-25-2010 10:27 AM

Quote:

Originally Posted by Valloric (Post 1074259)
Create a new issue on the tracker and attach the epub so that I can take a look at what's going on.

The epub is under copyright. Do I need to add a "private" label as mentioned in the wiki? If so, where? I don't see a "label box" on the issue form that was mentioned in the wiki.

Valloric 08-25-2010 11:13 AM

Quote:

Originally Posted by PatNY (Post 1074420)
The epub is under copyright. Do I need to add a "private" label as mentioned in the wiki? If so, where? I don't see a "label box" on the issue form that was mentioned in the wiki.

At the bottom of the form where it says "Labels:".

PatNY 08-25-2010 11:35 AM

At the bottom of the form window it just says:

Please provide any additional information below. If your source file
(SGF/EPUB/HTML/etc) is required to fully understand the problem, please
attach it to this issue. Read the ReportingIssues wiki page before
submitting!

Am I at the wrong place?

This is where I am trying to submit the report:

http://code.google.com/p/sigil/issues/entry

Or is it a Firefox issue?

I see no label box.

Valloric 08-25-2010 01:10 PM

Quote:

Originally Posted by PatNY (Post 1074539)
I see no label box.

Me being the project owner, this screenshot probably has several fields you don't have when you open the form, but you should certainly be able to see the label boxes (in red). Other users have used them successfully.

http://imgur.com/lT9qM.png

ghostyjack 08-25-2010 03:41 PM

1 Attachment(s)
Actually Valoric for us it appears at the top (see attached image). Click on the highlighted drop-down and you will find the privacy option.

Valloric 08-25-2010 04:52 PM

Quote:

Originally Posted by ghostyjack (Post 1074929)
Actually Valoric for us it appears at the top (see attached image). Click on the highlighted drop-down and you will find the privacy option.

Oh frigging hell, now I remember I changed things a couple of months ago. Thanks for the heads up, and apologies to PatNY. The wiki needs updating.


All times are GMT -4. The time now is 05:55 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.