![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Dec 2021
Device: none
|
TOC formatting
Hi all,
I have been clearing up the html mess produced by Scrivener in my ePub 3 file. A staggering amount of spurious code - too much to cover here. All has been going well with Sigil. I have encountered an issue with my TOC. I had generated it in Sigil - results were OK. I further edited my document and regenerated the TOC - it now looks horrible. The TOC now shows each entry with either a number, or next level with letters or multiple letters e.g aa, ab, ac - looks awful. The first time I generated the TOC - it just showed the headings - now I have this mess of ugly formatted lists. How do I get rid of all the numbering and letters in the TOC? I just want the headings showing (this had been the case - no idea why Sigil has created such an ugly mess. Cheers, Mike |
![]() |
![]() |
![]() |
#2 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,932
Karma: 6361444
Join Date: Nov 2009
Device: many
|
Sigil only ever builds its toc from the contents of the heading tags h1, h2, h3, etc.
So whatever you have done has changed the contents of those tags in some way. If you want to override a heading tag you can set a different string in that tag's title attribute. This can be made easier using the TOC Editor. Without specific examples of changes to those tags and to the resulting toc, there is no way to help. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80
Karma: 2137678
Join Date: Dec 2021
Location: Canada
Device: none
|
I'm just learning SIGIL so I encountered that issue as well.
You have to go to the tools/table of contents/generate table of contents interface. And there you have to uncheck the "show TOC ....only" box and it will give you an overview of what's been checked and what hasn't. This should give you an idea of what you need to uncheck to clean up your mess. It takes a while to figure out what's going on with SIGIL. Like most programs, it has a mind of its own. ![]() Also, I only use H1 headings for my TOC. If you were to add subheadings, I would go with H2. In that way, you can also use the select menu to focus only on those two types of tags. Again, you have to get used to looking at SIGIL and what it's trying to do. This is based on my experience. Hence, it's not SIGIL law. |
![]() |
![]() |
![]() |
#4 | |||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Quote:
Sigil's Tools > Table of Contents > Table of Contents generates based on your <h1> -> <h6> tags. Code:
<h1>Part 1</h1> <h2>Chapter 1. The Beginning</h2> <h3>Section 1: Waking Up</h3> [...] <h1>Part 2</h1> - Part 1 -- Chapter 1. The Beginning --- Section 1: Waking Up - Part 2 Sigil doesn't add any extra numbers or letters nonsense. Quote:
Code:
<h1 title="P1">Part 1</h1>
- P1 ... but it sounds like you have some serious underlying Scrivener issues that have to be dealt with first. Last edited by Tex2002ans; 12-12-2021 at 06:35 PM. |
|||
![]() |
![]() |
![]() |
#5 |
Running with scissors
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,591
Karma: 14328510
Join Date: Nov 2019
Device: none
|
Expanding on what tex2002ans said, as another example, in the TOC I like to have the word Chapter in front of the chapter's number then a big dash then the chapter's title. So when it's all done my h2 tags look like the following
Code:
<h2 title="Chapter One — The place of Bruntisfield">One <span>The place of Bruntisfield</span></h2> Code:
h2 span, h1 span { display: block; font-size: larger; font-style: italic; /* overrides small-caps in 2nd .css file */ font-variant: normal; font-weight: bold; margin-top: 1.25em; } |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Dec 2021
Device: none
|
Thank you all.
I dealt with it by stripping out any <ol> and </ol> tags. Net result - a very nice TOC. Thanks for everyone's ideas. Cheers, Mike |
![]() |
![]() |
![]() |
#7 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,734
Karma: 206739468
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Note that the NAV document in an Epub 3 has certain specifications it needs to follow. Stripping out the ordered list tags may not be the best answer in this case.
Sigil hides the numbering in its automatically generated nav.xhtml using css. namely: Code:
ol { list-style-type: none; } Last edited by DiapDealer; 12-13-2021 at 10:46 AM. |
![]() |
![]() |
![]() |
#8 |
Enthusiast
![]() Posts: 47
Karma: 10
Join Date: May 2012
Device: android
|
I have a different question on this same subject; does anyone know if there is a way to alter the default format of the TOC in a specific EPUB file? e.g. is there a way to modify an EPUB file so that Sigil automatically generate a TOC with a different header OR with a different style in the list ?
Thanks you! |
![]() |
![]() |
![]() |
#9 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,932
Karma: 6361444
Join Date: Nov 2009
Device: many
|
Yes, it was noted earlier in this. Just add a title="your title here" attribute to the h1 tag (or any h* tag) and when Sigil builds the TOC, it will use that title attributes value in place of the contents of the h* tag.
|
![]() |
![]() |
![]() |
#10 | |
Enthusiast
![]() Posts: 47
Karma: 10
Join Date: May 2012
Device: android
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#11 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,932
Karma: 6361444
Join Date: Nov 2009
Device: many
|
If it is the nav epub3 document, the leave it alone since it must remain fully machine parseable. For the html TOC, you can create it any way you want. If sigil creates it, then you have to edit it to fit what you want. There is no template for an html TOC. You do know you can easily add your own CSS stylesheet changing how things appear.
Last edited by KevinH; Today at 09:31 AM. |
![]() |
![]() |
![]() |
#12 | |
Enthusiast
![]() Posts: 47
Karma: 10
Join Date: May 2012
Device: android
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#13 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,932
Karma: 6361444
Join Date: Nov 2009
Device: many
|
You do understand that the nav document and the html TOC are two different things, right? The nav myst be kept fully machine parseable at all times as it fills the role the epub2 ncx fills. But you can remove the nav from the spine and use a separate html TOC that you fully control to present to the e-reading user. In that you can use and formats or tags you want. That said, using proper heading tags is important for accessibility and screen readers.
If all you want us to change the heading in the h1 tag from "Table of Contents" to something else in the nav, that is safe to do but use of the nav tag, epub:type and proper nesting using ol and li tags can not be removed in the nav. So you might want to remove the nav from the spine and create an html TOC and modify it to your hearts content. |
![]() |
![]() |
![]() |
#14 | |
Enthusiast
![]() Posts: 47
Karma: 10
Join Date: May 2012
Device: android
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
ToC Formatting Help? | RMOP | ePub | 16 | 07-10-2021 09:11 AM |
Aura ONE device-TOC formatting | Sam Sahara | Kobo Reader | 1 | 08-24-2018 07:36 AM |
Formatting the TOC | RickAltman | Conversion | 1 | 11-13-2014 12:43 AM |
Inline TOC formatting | phossler | Editor | 9 | 03-29-2014 06:05 AM |
Formatting TOC | jackibar | Sigil | 18 | 03-01-2012 09:02 AM |