Numbered bullets not showing numbers on compile to epub

Hi,
I am running a compile for an epub I have created using Scrivener for Windows V3.1.1.0. In it I use numbered bullets / lists. This display and work as expected when editing, however, when I compile to epub3 there are no numbers present. I’ve had a look at compile and project settings but it is so comprehensive I think I must have missed something to make them display.

Any ideas on what I can check and where?

Thanks,
Daim

This should go good. It’s of course not so hard to change an <ul> to an <ol> in Sigil.

Maybe reset to No list and reapply the Numbered list?

Thanks,

I could not find “sigil” anywhere in the menus? I have tried different list types, deleting and re-inserting and even turned on invisible characters to see if there is anything odd there but I found nothing.

I have tried delving into the epub itself, relevant lines from the HTML file within the epub:

<link type="text/css" rel="stylesheet" href="css/stylesheet.css"/>
<ol>
  <li class="ps4">D</li>
  <li class="ps4">D</li>
</ol>

I can see that the HTML for the ordered list is OK.
So, I checked the CSS file called from the HTML to see if that is affecting it. From css/stylesheet.css:

.ps4 {margin-left: 3.00rem; text-indent: -2.08rem}
/* Numbered lists */
/* 1. 1.1. 1.1.1. ... */

/* Level One */

ol li {
	list-style: none;
	display: block;
}

ol {
	counter-reset: levelOne;
}
ol li:before {
	content: counter(levelOne) '. ';
	counter-increment: levelOne;
}

/* Level Two */
ol ol {
	counter-reset: levelTwo;
}
ol ol li:before {
	content: counter(levelOne) '.' counter(levelTwo) '. ';
	counter-increment: levelTwo;
}

/* Level Three */
ol ol ol {
	counter-reset: levelThree;
}
ol ol ol li:before {
	content: counter(levelOne) '.' counter(levelTwo) '.' counter(levelThree) '. ';
	counter-increment: levelThree;
}

/* Level Four */
ol ol ol ol {
	counter-reset: levelFour;
}
ol ol ol ol li:before {
	content: counter(levelOne) '.' counter(levelTwo) '.' counter(levelThree) '.' counter(levelFour) '. ';
	counter-increment: levelFour;
}

/* Level Five */
ol ol ol ol ol {
	counter-reset: levelFive;
}
ol ol ol ol ol li:before {
	content: counter(levelOne) '.' counter(levelTwo) '.' counter(levelThree) '.' counter(levelFour) '.' counter(levelFive) '. ';
	counter-increment: levelFive;
}

/* Level Six */
ol ol ol ol ol ol {
	counter-reset: levelSix
}
ol ol ol ol ol ol li:before {
	content: counter(levelOne) '.' counter(levelTwo) '.' counter(levelThree) '.' counter(levelFour) '.' counter(levelFive) '.' counter(levelSix) '. ';
	counter-increment: levelSix;
}

/* Level Seven */
ol ol ol ol ol ol ol {
	counter-reset: levelSeven;
}
ol ol ol ol ol ol ol li:before {
	content: counter(levelOne) '.' counter(levelTwo) '.' counter(levelThree) '.' counter(levelFour) '.' counter(levelFive) '.' counter(levelSix) '.' counter(levelSeven) '. ';
	counter-increment: levelSeven;
}

I don’t really know what is going on here but I assume this is breaking it somehow (maybe “list-style: none;”?) and something needs to be changed in the Scrivener settings for numbered bullets / lists either in the project or in compile but I have no idea what or where? Seems odd as I don’t think I’ve fiddling with anything that would affect it and I doubt there is a setting like “Display numbers” that is unticked!

At least I’ve ruled out the numbers being output in the same colour as the background :slight_smile:

I’ve just tried with ordinary bullets / unordered lists and they are not displayed either.

I’m becoming convinced that there must be a tickbox in Options or Compile or Project Settings that turns bullets on or off but I can’t find it anywhere - surely someone must know?

I’ve even tried changing fonts (I can’t get compile to output in the font I want either!) but as I can’t change the fonts that appear in the epub maybe it is that the font itself doesn’t have bullets?! (I can’t actually identify the font in the HTML or CSS that Scrivener outputs - maybe someone knows what the default font is?)

I never imagined the compile process would be this difficult for sure :slight_smile:

https://sigil-ebook.com

This Scrivener’s attempt to create a multi - level hierarchical list, using the counter system.

list-style: none is the line removing the numbers from the list, so they can be replaced by a counter.

But actually these don’t matter, because we have to look at the ps4 class. These rules places the List Items 3 times the relatieve height of the default text to the right and negatively indenting them two rem to the left.

What happens when you replace those numbers by zero? What happens when you remove the ps4 class from the List Items?

Thanks for the report, this is the result of a bug in how the compiler is trying to add too much formatting to the ebook (it’s a widespread problem in fact, where it spams these “ps#” classes all over the place, whether they are needed or not). They should never be applied to lists, those should always use the CSS provided by the setting made in the Tables & Lists compile format pane, in the format designer window—or of course if you set it to “None” the output should be fully vanilla and capable of more easily applying your own CSS to them.

For now, there are two workarounds:

  • You’ll need to load the .epub file in Sigil and delete these unnecessary “.ps#” selectors from the stylesheet.css. This can be a pain as each list might have its own serialised styles added and there wouldn’t be a good way of collating them without trudging through the whole book. Save it for last, in other words, and ignore the issues in proofing.
  • If you go into the CSS compile format pane and disable the Create styles for paragraphs using custom formatting checkbox at the bottom of the pane, this will make list output cleaner, in my testing. It unfortunately has the side effect of making the rest of the HTML way, way messier and almost impossible to add your own CSS to. So this option is only useful if you use the GUI only and have no intention of styling the book with your own custom CSS, and don’t care if the ebook is technically speaking, full of bad practices.

In short, there are layers of bugs in the ebook implementation. That might make things seem more complicated than they are. :slight_smile: Most of them are invisible to most people, but you’ll quickly run into a mess of them if you try to push past vanilla settings, or do things that are relatively unusual (like nested lists).

As a postscript, if you aren’t seeing any numbering at all, that may be a problem with your book reader not supporting counters. They are part of the CSS specification, so they should, but you should use a simpler list format if your target hardware can’t support the more complex stuff.

Thanks Antoni, rms & Amber :smile:

Here’s an update of where I’ve got to: (tl;dr: looks like it is the reader not displaying bullets rather than Scrivener)

  1. Sigil - I thought Antoni was referring to the sigil used for the bullets but now I see it is software - maybe people should think up new names and not use existing words for their software?!! Anyway, thanks for the suggestion (and for the link @rms), much easier than unzipping the epub and checking it by hand!

  2. Bullets - While looking at Sigil it occurred to me to try different epub readers. The results were interesting:

  • SumatraPDF does not show bullets ( whether ul’s or ol’s) and uses a serif font no matter what I have set them to be
  • FBReader shows bullets and uses a sans-serif font no matter what
  • Kindle Previewer 3 shows bullets and a weird sans-serif font no matter what
  • Sigil shows bullets but over the top of text and a sans-serif font no matter what
    I haven’t tested these thoroughly (maybe the readers will change between serif & sans serif) but it seems that each bit of software uses its own font and ignores what the epub has set them to.
  1. Fonts - Scrivener does not embed the font in the epub which will mean that the end user must have the font installed or have the ability to download the font from the internet, this means that using fonts is a no-no or some other solution must be found.

My plan going forward is now:

  1. Try other formats for Kindle self publishing and use that format (e.g. MS Word DOCX, KPF, mobi, etc)
  2. (and it pains me to have to do this outside of Scrivener compile), see if I can use Sigil or similar to embed all fonts used along with any other issues I have found. Change CSS to apply specific fonts to text/para styles.
  3. And while I’m about it, maybe tidy up the HTML / CSS to keep the download to a minimum and less chances of ebook readers mis-interpreting what I’m trying to achieve.

I appreciate this thread has now gone off topic from my original question and I think the original issue (bullets) appears to be not Scrivener but any thoughts / advice that might help me will always be appreciated, thanks for all your help so far :slight_smile:

1 Like

I haven’t tested these thoroughly (maybe the readers will change between serif & sans serif) but it seems that each bit of software uses its own font and ignores what the epub has set them to.

If you go through the CSS you’ll find all of the font family information is stripped out. 90% of the time the book reader won’t have the font you used to write with or put into your compile settings, anyway. It is considered best practices to strip font declarations out, and particularly for body text, which should be left up to the reader theme/preference.

As for embedding, you can read up on our reasoning for why that isn’t done fully automatically. As I hinted at toward the end, it’s very easy to set things up for them though, since you can add your own CSS. There are a 1,001 guides out there for creating the CSS you need to declare a font and then use it, so once you have that put together, just paste the results into the CSS compile format pane. In the future, all you’ll need to do with Sigil is add the font files with File ▸ Add ▸ Existing Files.... It’ll do all of the difficult work for you (declaring them in the manifest and so forth), and if you have the CSS set up right for where it puts the fonts, that should be the only command you need to use. Save it and you’re done.

And while I’m about it, maybe tidy up the HTML / CSS to keep the download to a minimum and less chances of ebook readers mis-interpreting what I’m trying to achieve.

It’s a completely different approach, and a separate learning curve from Scrivener’s built-in ebook generator, but for anyone who cares about that aspect of the ebook, I like to recommend at least giving Scrivener’s Pandoc integration to try. It’s easy to install, and after a restart of Scrivener you’ll find new compile options at the bottom of the “Compile For” dropdown. Unless you also want to write with Markdown, you’ll want to enable the Convert rich text to Markdown option in the general options tab of compile overview.

The main point of difference with “normal” Scrivener usage is that you won’t be using Scrivener to establish the formatting, that will be 100% the CSS (which you can control from the “Pandoc Settings” compile format pane); feel free to pilfer any CSS from our stock settings with copy and paste. That does also mean a heavier use of styles to establish formatting. It might take a little more up-front work to learn a new approach and establish a look you like, but it will be time well invested for the future. You can just build off of what you already know and have done. The question, to my mind, is whether that investment of time is better spent than trawling through a “clean up” checklist every time you compile.

The result though is super clean. It shouldn’t take but a few minutes to try it out, and if it’s not to your liking you can switch right back to what you were doing before. All of the settings for this workflow are self-contained and “vanish” when switching “Compile For” back to ePub3.