When using the exporter’s auto-generated table of contents, the string “Contents” is appended twice before the actual table of contents. Please see the attached screenshot. I want it to appear only once, in the bolded text. Is this something I need to customize in my export formatting? Do I have to manually generate the TOC as specified in the reference manual section 22.1 simply to be rid of this?
[quote=“Gekko”]
When using the exporter’s auto-generated table of contents, the string “Contents” is appended twice before the actual table of contents. Please see the attached screenshot. I want it to appear only once, in the bolded text. Is this something I need to customize in my export formatting? Do I have to manually generate the TOC as specified in the reference manual section 22.1 simply to be rid of this?
This is on Scrivener for Windows version 3.0.0.0
In what app did you see and snapshot the result? In my experience, the ToC is a dropdown. I’ve never seen two pages of it in an eBook unless you’re talking about an eReader … and in that case you’d have a hard time getting two pages or taking a screenshot. Depending on where you got that view, your reader app could be the problem.
We’ll still need to know if the Compile was to mobi, ePub, or ePub 3 at least. If it isn’t a known bug, someone has to help you in a Zoom session (Literature & Latte doesn’t do that) or you need to send the project.
I spent a couple of hours investigating this. The project I’m working with was ported from Scrivener 1 to Scrivener 3, and apparently this conversion process is buggy or does not port all settings: I created a new “Novel with parts” project in Scrivener 3, verified it exports correctly in epub3, and then compared it to what the converted project looked like. Here’s some stuff that’s missing from my converted project:
Section layout labels are completely different
Section layout is missing table of contents layout definition
No styles are defined, although the Scrivener 1 project made extensive use of them
HTML elements page has no selections for any styles, probably because there are no styles
I also went through the reference manual, and it doesn’t describe what the settings on the HTML elements tab of the compile settings page do for automatically generated pages (like the table of contents). I’d like to get more details about that in the manual.
I’ve decided not to bother with this and instead re-create the entire novel in Scrivener 3.
Section layout labels are completely different
Section types and layouts didn’t have names, so do you mean the folder+, file+, and container+ icons? In v3, section types and layouts DO have names. I think it’s much less confusing that way.
Section layout is missing table of contents layout definition
You can make a section type and layout for the automatic ToC, but the automatic one is less flexible. You can change it, I suspect, by editing CSS.
No styles are defined, although the Scrivener 1 project made extensive use of them
Scrivener 1 didn’t have ANY styles. You mean format presets, which are much more limiting. Find a paragraph of each type and define a style based on it. Then you’ll have your presets back, but they’ll work a bit like Word styles (only better).
HTML elements page has no selections for any styles, probably because there are no styles
There are a couple of built-in styles, but you can add others to taste.
The Compile functions are completely different between Scrivener 1 and Scrivener 3, and settings do not automatically translate between the two. An upgrade guide for Scrivener 1 users can be found here: literatureandlatte.com/scri … -guide-win
I guess I’ll do that with mine as well. Any tips on how to manually recreate the project? Split windows maybe? I’ve never used that function. Don’t know if I can click and drag text blocks from the binder, or if I need to drill down to Select All text in the editor and copy/paste section by section.
Specifically referring to the “double” contents, that looks to me like a “page header”, being added by the book reader itself. Does that text not change from one page to the next as you go through major sections?
It’s often a good idea to verify that kind of stuff by looking at the actual source itself, to make sure what you’re looking at isn’t something the reader is adding or changing. Compiling to ePub and opening in Sigil is usually the best way of doing this, but if you want to see exactly what is going into the Mobi output, then go into the general options tab of the compile overview screen, and tick the checkbox to “Save source files…”. You can look at these files directly in an HTML editor and verify whether “Contents” is in fact really printed into the output twice.
I’ve added this section back into the manual. It was fixed for ebook output it looks like, and should all be good to go at this point. The only setting relevant to the contents page is the Page title style. If you’re using the built-in Ebook format you shouldn’t have to do anything here. But if you were creating your own from scratch, you would want to create a style in the Styles pane, that establishes the look for the heading, and then wire it up in this pane. This setting also impacts the “Notes” section, if you make use of endnotes in your ebook.
As to the general efficacy of the compile settings upgrade process: basically if Scrivener 1 supported the feature it should map over if you use the legacy format it creates for you. The upgrade guide that Katherine referred to above goes over how to audit that to your specifications.
It’s not going to create stuff that didn’t exist in v1. As noted there were no styles (and the styles used in the compiler are separate from the project anyway), and you couldn’t create a custom table of contents page either, so there certainly are things you would need to add to an older project, if you want to take advantage of new features.
I’ve always advocated working the other way around: bring the settings you want into the project, rather than trying to take an empty template and getting all of your content over into that (that said, if you really do want to do that, there are far better methods than manually going through with copy and paste!). The user manual has a little guide for doing things either way, in §5.4.2, Converting a Project to a Different Template, pg 56. For what you need, points (2) and (4) will be the main things you want to look into.
That said, the challenge listed above, for example of not having a “Table of Contents” section type, is relatively easy to fix if you just want to add these feature to your existing project.
I’ve noticed all my epubs with auto generated TOC have the double ‘Contents’ header too, but in Google Play Books. I had thought it was reader specific as it seems to have no end of trouble with lots of other things. But your post promoted me to download Sigil and have a look.
It’s definitely produced by the compile itself, from a paragraph tag that I’m guessing shouldn’t be there. Snippet of the start of the contents xhtml file of one of my test compiles (epub produced using standard epub 3 compile settings) copied from Sigil below.
Great, thanks for checking the source. Thus far I am unable to find the combination of settings it takes to produce the results you have. There are two oddities in fact:
The bare <p> of course, which shouldn’t be there.
In your screenshots there is another entry for the part level break that isn’t linked—technically that shouldn’t be there as well.
This book wouldn’t validate for either of those reasons. So somehow you have a setup that is causing entries to be added to the ToC unlinked, and maybe that is causing the secondary problem as well.
Either way, I’m wondering if you can take a look at this test project and see what’s different about it, from what you’re doing, and maybe post a modified version of it that reproduces the issue.
Not the OP btw Just someone who noticed the same problem.
From what I can tell comparing your project compile settings and mine, something in the section layouts of my custom compile settings is adding that extraneous paragraph tag so guessing the OP has a similar problem? Just not sure what. Still trying to get my head around the new compile settings.
Oops! Thanks for pointing that out. Well it should help the OP out if they still need it—though I do remain curious how the auto-ToC generator is inserting a plain-text “part” like that.
As for this problem, it does appear to be a bug to me. If the compile Format is not set up for ebooks, like Default, then it will lack a style definition for headings, as we discussed earlier in the HTML Elements pane. If that is left without a setting, then for some odd reason we get this plain paragraph inserted into the output. I can think of no reason for why it would do that.
So to fix it, you’d either want to set up a heading style, or start from the built-in Ebook compile format, which is generally going to be the best option anyway. To fix it:
Double-click the format you are using to edit it, and confirm duplication if necessary.
Go into the Styles pane, and click the + button in the top right area. Add anything here, probably just a “Heading 1”.
In the HTML Elements pane, set the Page title style to this new style.
EDIT: The “Flat Table of Contents” option doesn’t generate a ToC, and the “HTML ToC” options compiles double page headings.
(The table of contents is also a numbered list, which I assume/hope is an option I can disable somewhere. Not sure why it’s not on the Table of Contents options page though.)
Yes, as you confirm, the bug itself has not yet been corrected for. However to repeat what was said above: it’s not a bug that should be a problem for any properly configured compile Format. If you are not starting from the stock “Ebook” compile format because you want a clean slate, then please make sure to follow the checklist given above, to set it up properly with a dedicated heading style. While not setting up a proper internal page heading shouldn’t trigger a bug, you would still want to set one of those up anyway, in other words.
The “Flat Table of Contents” option doesn’t generate a ToC
I’m not seeing that problem specifically. It may be better to start a new bug report thread on that, with full instructions on how to reproduce. For me, ticking that box just creates a flat ToC, as expected—in both the visual HTML page and the internal ToC structure of the ebook.
(The table of contents is also a numbered list, which I assume/hope is an option I can disable somewhere. Not sure why it’s not on the Table of Contents options page though.)
Before you go down a path of trying to change that by hand, do note that doing so would produce an invalid ePub file. Of note:
“The ol child of the nav element represents the primary level of content navigation.”
Oh, thanks. I had actually changed it to a <ul>, but I guess should switch that back. I guess I could use CSS such as {display: none;} instead. But I shouldn’t have to.
I’d really like to know where the “settings” are for this. I’ve been making ebooks in Scrivener for years and have never had a numbered Table of Contents before. And I didn’t choose to have one, so no idea why I have one now.
It changed when we updated the specifications to ePub3. I don’t recall if ePub2 had a formal navigation element like we do now that doubled as a visible ToC page, it was just a regular old HTML page that you could format however you wanted. Now, since it is also used to drive the internal navigation of the book itself, it has more rules that need to be followed. In general you shouldn’t have to worry too much about them though since we take care of all of the details for you.
For example, as for needing to style it, you shouldn’t have to as the software will add that CSS for you (you can check in the CSS pane, in the “Default Stylesheet” column). It uses this CSS, for maximum compatibility:
So you would only need to worry about it if you set the mode in that pane to “Use Custom CSS Stylesheet”. At that point you would have full control, and probably would want to copy and paste some of the prefab stuff we generate into the left column.
I’m not sure why it gave me a numbered TOC. However, after changing it to <ul>, then seeing your reply and changing it back to <ol>… the numbers are gone! Hopefully they stay that way.
I’m on Windows and not able to follow the steps to fix. I do not see any styles in the drop-down list on the HTML Elements pane.
FYI: my background with seeing Contents 2x: This file was a v 1 created in 2017. I tried upgrading that older file to v 3, gave up because of too many compile issues, and created a new v 3 file and dragged or imported my files over. This is my last one.
It should be listing any paragraph styles you have available in the Styles pane (where you would also design how the headings themselves should look).
I would also reiterate from above that in most cases you will be better served by starting from the “Ebook” compile Format, and modifying it to taste. Unless you have experience in HTML/CSS and intend to largely design the book yourself from that angle, or are looking to build a lot of detailing up from scratch, using “Default” or even legacy upgraded settings will require diving straight into the deep end, particularly if all of this is new to you.