![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
![]() 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. |
|
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 |
![]() |
![]() |
![]() |
#5 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,611
Karma: 23187563
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
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. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
@Doitsu
Thanks for the info. I shall experiment with it. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |