Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 12-12-2021, 03:58 PM   #1
canine
Junior Member
canine began at the beginning.
 
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
canine is offline   Reply With Quote
Old 12-12-2021, 05:53 PM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,933
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.
KevinH is offline   Reply With Quote
Old 12-12-2021, 06:05 PM   #3
roland1
Connoisseur
roland1 ought to be getting tired of karma fortunes by now.roland1 ought to be getting tired of karma fortunes by now.roland1 ought to be getting tired of karma fortunes by now.roland1 ought to be getting tired of karma fortunes by now.roland1 ought to be getting tired of karma fortunes by now.roland1 ought to be getting tired of karma fortunes by now.roland1 ought to be getting tired of karma fortunes by now.roland1 ought to be getting tired of karma fortunes by now.roland1 ought to be getting tired of karma fortunes by now.roland1 ought to be getting tired of karma fortunes by now.roland1 ought to be getting tired of karma fortunes by now.
 
roland1's Avatar
 
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. I've been at it for 12 days. Getting used to it.

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.
roland1 is offline   Reply With Quote
Old 12-12-2021, 06:29 PM   #4
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by canine View Post
[...] 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.
Can you take a screenshot of this?

Quote:
Originally Posted by canine View Post
I have been clearing up the html mess produced by Scrivener in my ePub 3 file.
I'm assuming this Scrivener mess infected everything else in the book too.

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>
would create a TOC with:

- Part 1
-- Chapter 1. The Beginning
--- Section 1: Waking Up
- Part 2

Sigil doesn't add any extra numbers or letters nonsense.

Quote:
Originally Posted by KevinH View Post
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.
Yes, like KevinH says, you can manually override what gets written in Sigil's TOC by using title:

Code:
<h1 title="P1">Part 1</h1>
which would show up in the TOC as:

- 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.
Tex2002ans is offline   Reply With Quote
Old 12-12-2021, 09:17 PM   #5
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
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>
Then in the book there is no word Chapter, just the One. (For some reason it looks sort of bare not having the word Chapter in the TOC but in the book it seems redundant given that it's at the top of the page at the start of the chapter.) Then a blank line, then the chapter title. Moving the chapter title to its own line is done with some css on the span, specifically the display:block
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;
}
I have a bunch of search and replaces in sigil's Saved Searches that reformat the chapter titles from what I originally had, h2 contains the chapter number and h3 contains the chapter title.
hobnail is offline   Reply With Quote
Old 12-13-2021, 05:33 AM   #6
canine
Junior Member
canine began at the beginning.
 
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
canine is offline   Reply With Quote
Old 12-13-2021, 10:44 AM   #7
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: 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;
}
From your original comments, it sounds to me as if you may have inadvertently deleted either the link to the NAV's css, or deleted some inline styling that Scrivener output.

Last edited by DiapDealer; 12-13-2021 at 10:46 AM.
DiapDealer is offline   Reply With Quote
Old 09-07-2025, 08:12 AM   #8
luciaisacat
Enthusiast
luciaisacat began at the beginning.
 
luciaisacat's Avatar
 
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!
luciaisacat is offline   Reply With Quote
Old 09-07-2025, 12:29 PM   #9
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,933
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.
KevinH is offline   Reply With Quote
Old Yesterday, 04:26 AM   #10
luciaisacat
Enthusiast
luciaisacat began at the beginning.
 
luciaisacat's Avatar
 
Posts: 47
Karma: 10
Join Date: May 2012
Device: android
Quote:
Originally Posted by KevinH View Post
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.
Hi! Many thanks to KevinH for this useful contribution. My question, however, was about if it was possible to change the main default format of the TOC (i.e. the h1 format and wording of the page: "Table of Content (TOC)" and/or the ol list). I know that the page could be edited manualy, but I was exploring whether the default could be edited. Any idea?

luciaisacat is offline   Reply With Quote
Old Yesterday, 09:27 AM   #11
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,933
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; Yesterday at 09:31 AM.
KevinH is offline   Reply With Quote
Old Yesterday, 11:43 AM   #12
luciaisacat
Enthusiast
luciaisacat began at the beginning.
 
luciaisacat's Avatar
 
Posts: 47
Karma: 10
Join Date: May 2012
Device: android
Quote:
Originally Posted by KevinH View Post
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.
Thanks again! Yes, a specific CSS for the nav doc may change many things but not, for example, the wording in the heading ("Table of Content (TOC)"). Anyway, I understand that there is no editable template for that page in Sigil, and, therefore, I rest my case.

luciaisacat is offline   Reply With Quote
Old Yesterday, 11:56 AM   #13
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,933
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.
KevinH is offline   Reply With Quote
Old Yesterday, 12:16 PM   #14
luciaisacat
Enthusiast
luciaisacat began at the beginning.
 
luciaisacat's Avatar
 
Posts: 47
Karma: 10
Join Date: May 2012
Device: android
Quote:
Originally Posted by KevinH View Post
...
So you might want to remove the nav from the spine and create an html TOC and modify it to your hearts content.
Yes, thanks! this is the current option; I was just exploring if there was a differnt one available, in order to use directly the nav as the TOC page of the ebook. I believe I got my question answered when you told me there is no way to edit the default nav page. Thanks!

luciaisacat is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 10:24 AM.


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