![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Jun 2012
Device: Sony
|
how to generate nested toc.ncx with more than 6 levels?
According to HTML (h1-h6) Sigil generats the toc.ncx up to 6 levels. But I need 9 levels (h1-h6, p.h7-p.h9). Is there any workaround to display this hierarchy in the ncx-file?
|
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
I cannot find a limit in the specification for the allowed number of nestings. So, 9 levels are possible (be aware that some reading systems will only show 2 or 3).
As you know, it is not possible by using the HTML headers. Usually it makes a lot of sense to use those headers, but for headers level 7 to 9 you need something else. You already mentioned that. However, you have to do that manually. Sigil will only create a ToC with headers for several very good reasons. Levels 7 to 9 you have to add manually. You might want to consider creating a separate XHTML as ToC with links and identify that in the metadata as being a ToC. It would probably be possible to script with sed to automate this on Linux (outside Sigil), but I am no sed expert. So, within Sigil you have to do it manually. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
You might use h6.h7-h6.h9 instead of p.h7-p.h9, that way at least Sigil would include them in the TOC, and then you only need to alter the nesting level (which I guess must be done manually).
|
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Jun 2012
Device: Sony
|
Thanks for the hints! h6.h7-h6.hx works fine. Although altering lots of nesting levels can be hard.
|
![]() |
![]() |
![]() |
#5 | |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80
Karma: 2178856
Join Date: Oct 2013
Device: Kobo Clara HD
|
Quote:
Ja, ich habe auch manchmal Bücher mit mehr als 6 Stufen. Wäre toll, wenn man das wenigstens manuell machen könnte. Ein plugin wäre auch ne Idee. Aber davon kann man wohl träumen. Also english versteh ich natürlich schon. Wenn jemand english antwortet, das ist ok. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,964
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#7 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
Join Date: Nov 2009
Device: many
|
From Google Translate:
Quote:
Yes, I also sometimes have books with more than 6 levels. Would be great, if one could make at least manually. A plugin would also ne idea. But one can dream of it. So I understand, of course, already. If someone answers english, that is ok. Last edited by KevinH; 06-11-2017 at 11:51 AM. |
|
![]() |
![]() |
![]() |
#8 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
Join Date: Nov 2009
Device: many
|
I think the basic idea is for anything you want to be equivalent to an h7, you make its tag an "h6" and add the attribute class="h7". For an equivalent to an "h8", you make the tag an "h6" and add class="h8", etc
You can then add css classes h7 and h8 to make the text appear smaller. When you build the toc, it will have every heading but you will have to manually edit it to properly nest those with the classes h7, h8, etc. And in German from Google translate: Quote:
Last edited by KevinH; 06-11-2017 at 12:06 PM. |
|
![]() |
![]() |
![]() |
#9 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,886
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Sigil provides the make TOC tool that uses Headers as the key.
Calibre (the main GUI) and the Calibre editor, have a TOC tool that can use additional methods (or mixed criteria, just not in a single pass). FWIW the Calibre editor is available from the commandline, so there is no need to put the book in the Library. I use both Sigil and Calibre Editor. They do different things (and some of the same, just differently ![]() ![]() ![]() |
![]() |
![]() |
![]() |
#10 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Code:
<h6 class="h7">heading 7</h7> <h6 class="h8">heading 8</h8> <h6 class="h9">heading 9</h6> Code:
h6.h7 { font-size: .67em; } h6.h8 { font-size: .67em; } h6.h9 { font-size: .67em; } Quote:
Since it's much easier to edit the TOC section of an epub3 nav document, you might want convert your epub2 book to an epub3 book with Sigil. Here's an example epub3 nav doc TOC section with more than 6 headings: Spoiler:
Of course you could also edit the toc.ncx file of an epub2 book. ![]() For more information, see the attached epub2 and epub3 sample files. In the future, please post German questions in the German MR forum or at least include a Google translated version of your post. Last edited by Doitsu; 06-12-2017 at 02:04 PM. |
||
![]() |
![]() |
![]() |
#11 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80
Karma: 2178856
Join Date: Oct 2013
Device: Kobo Clara HD
|
Thank you. That a first step. I experimented with the heading_test_epub2.epub. And I succeeded: I could add Heading 9, 10, 11 etc. and it looks well in the toc-table
But as KevinH mentioned: <You can then add css classes h7 and h8 to make the text appear smaller. When you build the toc, it will have every heading but you will have to manually edit it to properly nest those with the classes h7, h8, etc.> It seems to be tricky for me to do that with alternating levels like: h1, h2, h3, h4, h5, h6, h7 ... h1, h2, h3, h3, ... h7, h7, h7, h8, h7, h7 etc. Could you please make an example with more levels and more alternating ones? I have a book with many levels and I tried to change the toc manually, but without succes with nested headings. Must one do the whole toc manually or only change the levels over level 6? |
![]() |
![]() |
![]() |
#12 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,295
Karma: 20171067
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
If you use the approach recommended here the auto-toc ("Generate Table Of Contents Ctrl+T") function of Sigil will create a toc.ncx out of the following html example but all of your h6.hx tags will only be nested to the 6th level. You would need to manually adjust the nesting (as simple as highlighting and dragging into the previous navpoint). To nest varying levels would only require one to drag the lower-level navpoint inside the previous higher level navpoint.
example html: Spoiler:
The auto toc will detect all the hx tags up to level h6 as shown in the 1st attached image:
auto created .ncx: Spoiler:
The auto created .ncx will appear as shown in the 2nd attached image.
manually corrected .ncx: Spoiler:
The manually corrected .ncx will appear as shown in the 3rd attached image. (note: this is how it appears in Sigil - no guarantee how other devices/apps will display it)
Once the .ncx is manually corrected then you could use the "Create HTML Table Of Contents" tool from Sigil and it will create a correctly organized/tagged html file. auto generated HTML-TOC: Spoiler:
You would then need to manually change the additional levels to indent/format them further by adjusting the css file created for the html toc.("sgc-toc.css") example sgc-toc.css: Spoiler:
Of course, you would also have to style/format these classes in your regular css sheet so that they display properly within your document. sample css: Spoiler:
Cheers, Last edited by Turtle91; 06-15-2017 at 11:56 AM. |
![]() |
![]() |
![]() |
#13 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Just wondering what kind of book requires this many headings. Typically anything nested beyond 5 or 6 levels would be better organized in a different way.
|
![]() |
![]() |
![]() |
#14 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,886
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
![]() |
![]() |
![]() |
#15 | |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80
Karma: 2178856
Join Date: Oct 2013
Device: Kobo Clara HD
|
Quote:
But in the first run, we have to accept, what the author did, because, he normally understands better than his reader. But again, how, do you think, could it be possible, to organize better a long text with 10 levels down to 6 levels? Any idea about that? And a last question to sigil: Whats the reason, to the 6 levels limitation? Is it so complicated to double the nummer auf levels? What is the problem? Sorry about my question, but I have no idea about that. |
|
![]() |
![]() |
![]() |
Tags |
ncx toc levels |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kindler previewer not recognizing toc.ncx file, my html toc, or the start point... | petercrowell | Kindle Formats | 2 | 05-01-2012 08:14 AM |
Does Apple iBooks support nested TOC.ncx? | st_albert | ePub | 5 | 08-24-2011 02:21 PM |
Syntax for toc.ncx Levels 1 and 2? | NewDay | ePub | 7 | 04-04-2011 04:09 PM |
Use Regex to Code an Inline TOC, from an External TOC's .ncx File | mostlynovels | ePub | 2 | 03-16-2011 12:15 PM |
NCX creation -- nested or not, css classes | illustrata | ePub | 3 | 08-25-2010 08:56 AM |