MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   sigil and toc (https://www.mobileread.com/forums/showthread.php?t=59539)

bobcdy 10-16-2009 05:17 PM

sigil and toc
 
Today I tried importing into sigil a calibre-produced epub file made from a mobi prc file. The calilbre epub's toc worked perfectly with the catalog key in my Bebook. Once imported into sigil, however, and then saved as epub, everything seemed to work except the TOC. It would not work with the Bebook catalog key.

The reason I tried the import into sigil was that I wanted to add two images - the add was simple and worked fine, but the toc problem seems pretty serious.

This is the first time I tried sigil so perhaps I'm doing something wrong. Has anyone else had similar problems with sigil epubs?
Bob

AnemicOak 10-16-2009 05:34 PM

Yeah, same thing has happened to me sometimes. The only way I've fixed it, so far, is to go to each TOC item and enclose it in <h1> tags in Sigil and resave.

Valloric 10-16-2009 08:46 PM

Sigil uses heading tags to make TOC entries. If your file doesn't have heading tags, Sigil can't make TOC entries. But calibre usually makes TOC entries from heading tags too, so I don't see why your file is being problematic.

As AnemicOak noted, you will have to wrap them in heading tags to make it work.

It is necessary for Sigil to regenerate the TOC since the XHTML files are concatenated, manipulated and cleaned during import, so the original NCX doesn't have much sense anymore.

bobcdy 10-16-2009 11:11 PM

Anemic Oak, Valloric,

I unzipped the original calibre epub and also the sigil epub, and found there were many differences. For example, there is a file toc.ncx for the calibre epub but no such file for the equivalent from sigil. In the calibre tox.ncx there is no h1 tag associated with the chapter titles (Chapter One, Chapter Two...) that are the basis for the toc headings. In the original html file that was used to make the prc file, the chapters do not have an h1 tag.

I'm a beginner in such code writing, but followed your suggestions - used code view in sigil, cut the entire file and pasted into Notepad++ where I added the <h1> & </h1> tags for each new chapter using Notepad++ search, then cut and pasted back into sigil, saved the modified file, and tried it in my PC Adobe DR - the toc was ok; also tried it in my Bebook and the catalogue key worked fine to give the toc.

Thanks for the help!

Bob

Valloric 10-17-2009 08:07 AM

Quote:

Originally Posted by bobcdy (Post 628192)
In the original html file that was used to make the prc file, the chapters do not have an h1 tag.

And that's the problem right there. The original file doesn't have them. I guess Calibre heuristically tries to find what elements are representing the headings, but Sigil doesn't do that.

Quote:

Originally Posted by bobcdy (Post 628192)
I'm a beginner in such code writing, but followed your suggestions - used code view in sigil, cut the entire file and pasted into Notepad++ where I added the <h1> & </h1> tags for each new chapter using Notepad++ search, then cut and pasted back into sigil, saved the modified file, and tried it in my PC Adobe DR - the toc was ok; also tried it in my Bebook and the catalogue key worked fine to give the toc.

With Sigil v0.1.5, you won't have to use other applications for S&R... :)

bobcdy 10-17-2009 05:29 PM

Just wanted to praise Sigil - I've had trouble with HarryT's Omnibus volumes' toc working on my Bebook. I've found that fixing the tocs with Sigil is pretty simple with the help obtained by Valloric and AnemicOak. Lack of a search and replace makes it just a bit more complicated but it's easy to cut and paste from Sigil to Notepad++, add the format tags to what needs to be in the toc, and paste back to Sigil.

The result is a toc, designed just as I want, for the omnibus volume that works perfectly with Bebook! Sigil is really a great advance for epubs!
Bob


All times are GMT -4. The time now is 06:32 PM.

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