Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 10-29-2016, 08:53 PM   #1
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
a custom toc for EPUB3?

Hi

Could there be an automatic solution for this?

Here are the usual tocs we can see:

toc1. Sigil, and other software, can produce a standard toc.xhtml and add it to the list of files. For EPUB3, this "item" is signalled in the opf manifest with a properties="nav" attribute. It includes lots of -ugly- blue hyperlinks and ids (one for each chapter and item) and has its own "standard" style which markedly differs from the rest of the book. Further, it's placed right at the beginning even if the original (paper) toc was set elsewhere - often close to the end.

toc2. Many times, we also add for compatibility reasons a toc.ncx, placed in its "miscellaneous" place, close to the opf file. Useful. Don't touch.

toc3. Many books may include a converted "classical" table of contents, with -useless- page numbers, sometimes with links, sometimes - the real classical - without. Sometimes the ocr software mangles many links and leaves its own mess and it entails a considerable loss of time if we intend to put them straight.

For aesthetic and common sense reasons, I usually replace in the EPUB3 the old fashioned toc3 above with a customized toc1 but this requires some manual work.

What I am doing is
- keep a blank file with a title named "Table of contents" (with a link to my stylesheet)
- blend this file with the content of the toc.xhtml file (several ways to do it)
- suppress the "old" toc.xhtml and give the properties="nav" to the new one.

I suppose I am not alone doing this. However this is not a user-friendly task, specially for beginners. I wish we could find an automatic way to do it for EPUB3.

Last edited by roger64; 10-29-2016 at 09:14 PM.
roger64 is offline   Reply With Quote
Old 10-29-2016, 09:14 PM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,623
Karma: 194727102
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'm not sure what you're asking. The NAV is a required part of EPUB3, but you're free to edit it and style it anyway you want. You can also move the nav anywhere you want in the manifest by dragging it up or down in the Book Browser. What, exactly, about the NAV creation/editing process are you trying to "automate"?

Also: as with the css for an autogenerated html toc, I believe you can create your own NAV style template to customize the styling.

Last edited by DiapDealer; 10-29-2016 at 09:37 PM.
DiapDealer is offline   Reply With Quote
Advert
Old 10-29-2016, 09:55 PM   #3
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by DiapDealer View Post
I'm not sure what you're asking. The NAV is a required part of EPUB3, but you're free to edit it and style it anyway you want. You can also move the nav anywhere you want in the manifest by dragging it up or down in the Book Browser. What, exactly, about the NAV creation/editing process are you trying to "automate"?

Also: as with the css for an autogenerated html toc, I believe you can create your own NAV style template to customize the styling.
I do not know where is this "css for an autogenerated html toc" and will gladly take it.
Thus, I will be able to add automatically a small "customized" toc part to the auxiliary css stylesheet I am already automatically adding to each EPUB.

What "automate"?

- Being able to deposit automatically the new toc.xhtml file where I wish, for example at the end of the book instead of the beginning would be a first welcome step.

- Also, inserting automatically a link to my own stylesheet would be a second one.

As such, for me, this standard toc.xhtml is an eyesore just dropped on the front door that need to be dealt with for every new EPUB3. Not everybody knows how to do this properly.

Last edited by roger64; 10-29-2016 at 10:52 PM.
roger64 is offline   Reply With Quote
Old 10-30-2016, 03:56 AM   #4
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Maybe a simpler solution (at least for ODTImport users) would be:

1. On your odt: create a dedicated chapter title for the toc and place it where you wish in the structure of your text files.

2. After conversion, using Sigil, you see it's, say, chapter73.xhtml. It contains only a h2 title (T.o.C) and a link to your stylesheet. You see also that the brand new toc.xhtml has been dropped at the beginning of your text files.

3. Copy and insert this h2 title (with its id) and the link to your stylesheet and the namespace in the toc.xhtml file.

4. Delete the original chapter73.xhtml and rename toc.xhtml (modified) as chapter73.xhtml.
Move it to its new place.

This way, you do not have to take care of the properties="nav" attribute.

Last edited by roger64; 10-30-2016 at 06:47 PM. Reason: namespace
roger64 is offline   Reply With Quote
Old 10-30-2016, 04:59 AM   #5
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,611
Karma: 23187563
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by roger64 View Post
I do not know where is this "css for an autogenerated html toc" and will gladly take it.
When generating epub2 and epub3 HTML TOC files, Sigil will look for the following files in the Sigil preferences folder:

sgc-toc.css (epub2 HTML TOC)
sgc-nav.css (epub3 NAV TOC)

You can use these files to override the default styles.

Last edited by Doitsu; 10-30-2016 at 05:05 AM.
Doitsu is offline   Reply With Quote
Advert
Old 10-30-2016, 05:48 AM   #6
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
@Doitsu

Thanks for the info. I shall experiment with it.
roger64 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Epub3 and TOC and calibre Editor jackie_w Development 10 06-23-2016 11:45 AM
Unable to generate custom toc hounddog Conversion 0 02-20-2016 12:36 PM
iBooks TOC error in EPUB3 brownetu ePub 13 08-15-2014 01:32 AM
New Errors Converting epub3 -> zip -> epub3 Lola25 ePub 2 11-12-2013 09:37 PM


All times are GMT -4. The time now is 12:59 PM.


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