Compiling changes bullet points

Compiling to .mobi, I notice bullet points that are a,b,c etc change to 1,2,3 on compile. The remain displayed correctly in the project, just the output is changed.

Changing bullet to none and typing the letters works, though tabs for indent are removed on compile.

That sounds very messy to me, and not a recommended approach to a format that is intended to be semantic.

Ebooks use CSS for list formatting, rather than RTF formatting, and with how lists are converted, they end up as one of two types: ordered or unordered. So particular flavours of ordered list elements is one of those things that gets lost in the translation. Here is what all of your ordered lists look like upon output:

[code]

  1. one
  2. two
  3. three
[/code]

But since these are formatted with CSS, you can determine how they should work. There are two basic approaches here, universal and targeted.

[size=100]Universal Formatting[/size]

This approach will be good enough, if all you want is for every list in the ebook to use a,b,c formatting:

  1. Open File ▸ Compile….
  2. Double-click on your compile Format in the left sidebar to edit it.
  3. First, go into the Tables & Lists pane, and set the Numbered lists type to “None”. This will remove a bunch of preset list formatting CSS that would otherwise be a pain to fully override.
  4. Next, click on the CSS pane, and ensure you have the mode set to “Append Custom CSS Stylesheet”. In the left column, add the following text:
ol { list-style-type: lower-alpha; }
  1. Click the Test… button and see how it looks.

[size=100]Targeted Formatting[/size]

If on the other hand you only want some lists to use a,b,c formatting, but the rest to go on using whatever complex (or simple) settings you use, then you’ll need to add a little HTML into your book to create a more detailed stylesheet:

  1. On a line above the list in question, type in:
<div class="alpha-list">
  1. With the cursor in that line, create a new style and name it, “Raw HTML Block” (the naming is important, our stock Ebook format comes with a paired style built-in that will handle the rest for you—but if you are rolling your own, you’ll want to create a paired style in your Format’s Styles pane, and check the Treat as raw markup flag in its options).
  2. Add a line below the list, with the following text, also assigned to this new style:
</div>

So at this point you should have something that looks like this (I’ve added a background highlight to the raw HTML style, to make it stand out from normal text):

If you were to compile and examine the source HTML, you’d find:

[code]

  1. one
  2. two
  3. three
[/code]

And if you know CSS, you know that’s good enough to do what you want, but I’ll spell it out in case not.

  1. Now go back into compile and edit the Format.
  2. In the CSS pane, as before, ensure you have the mode set to “Append Custom CSS Stylesheet”, and paste the following into the left column:
.alpha-list ol { list-style-type: lower-alpha; }
  1. Click the Test… button and see how it looks.

Not really a satisfactory outcome. One would expect that bullets within Scrivener should compile in the same type as displayed.

Your solution is messy in that:

  1. There are a mix of many numeric and many alpha, with typically a numeric having several alphas as a sub of that number.
  2. There are a number that are alpha numeric, eg a1, a2.

As to your follow-up questions, I don’t follow what is “messy” about it, at least with regards to these specific items—especially since HTML/CSS addresses both of them. Perhaps they seem messy because of how messy it is creating custom lists like that in the basic list editor? Once you adapt to a dynamic system driven by the stylesheet, you can forever dispense with wasting time fiddling with custom marker prefixes and so forth.

Take note of how we do things in the example CSS, when you make different selections in the Tables & List pane. See how some of those choices employ a diverse mix of enumeration styles based on indent level? Feel free to copy any techniques you see there. A simple example based on what I think you are describing here can be extracted from one of the built-in choices verbatim, in fact:

.alpha-list ol ol { list-style-type: lower-alpha; }

Note all we changed from the above is to add a nesting requirement to the selector. This now only changes second level (or greater) list elements to lower-alpha, leaving level one to use default numerals.

To continue that line of logic, say you need Roman numerals at level three:

.alpha-list ol ol { list-style-type: lower-alpha; } .alpha-list ol ol ol { list-style-type: lower-roman; }

That is more complicated, but still well within the realm of what CSS can do. I’d look up tutorials on creating custom numbered lists with CSS, and get a browser that lets you manipulate loaded pages in real-time, used in conjunction with Scrivener’s source file output options. Sigil also works well, as you can edit the stylesheet.css file while viewing example text in the preview pane. Either way, you can tweak book code directly, and once you get a satisfying result, copy and paste the CSS into the compile settings.

Conceptually the idea is very much similar to Scrivener’s auto-number placeholders, particularly with regards to how you can give numbering streams names, reset them and etc. The two main difference is that incrementing a counter and printing a counter into the book are two discrete actions, and secondly the format of the output (decimal, Roman, alpha, etc.) is a function of output rather than an inherent quality of the counter (meaning you can print the same counter instance several different ways). In case the syntax is unfamiliar, here’s a working example that you can get started with. I use this same technique to number headings in some of my stylesheets (1, 1.1, 1.1.1 style), so it is trivial to adapt it to a list schema instead:

[code]/* Alphabetic lists with compound numeral subnumbering (a, b (b1, b2), c…) /
.alpha-special > ol {
/
Drop native numbering and set up our own counter for each new list. /
list-style-type: none;
/
If we have a bunch of different complex list styles in the book, we’d want a less generic name here, like ‘alpha-special-levelone’. /
counter-reset: levelone;
}
.alpha-special > ol li {
counter-increment: levelone;
/
Hanging indent for the manually added marker. You may have to fiddle with measurements depending on format. /
text-indent: -1.5em;
margin-left: 1.5em;
}
.alpha-special > ol li::before {
/
Print the counter value as alpha at the start of the list item */
content: counter(levelone, lower-alpha) “)”;
margin-right: 0.5em;
}

.alpha-special > ol ol {
list-style: none;
}

.alpha-special > ol ol li {
counter-increment: leveltwo;
text-indent: -2em;
margin-left: 1em;
}

.alpha-special > ol ol li::before {
content: counter(levelone, lower-alpha) counter(leveltwo) “.”;
margin-right: 0.5em;
}

/* Level 3 and lower just uses bullets. We basically want to override much of the above and reset things back to normal. /
.alpha-special ol ol ol {
list-style-type: decimal;
}
.alpha-special ol ol ol li {
/
This keeps subsublists from incrementing leveltwo. /
counter-increment: none;
padding-left: 0.5em;
text-indent: 0em;
margin-left: 0em;
}
.alpha-special ol ol ol li:before {
/
Otherwise due to cascading inheritance, we’d get “b2. 1. List text”. */
content: none;
}[/code]

And again, all you need in Scrivener is any enumeration list. It doesn’t matter at all, so no longer waste time fiddling with marker settings. My motto is to keep formatting complexity out of the editor and in the stylesheet. You do the latter once, but the former dozens or even hundreds of times in the course of writing a book—and heaven forbid you ever need to adjust the schema if each list is manually hard-coded to one format.