How to maintain font color in section title?

This question relates to producing an ePub 2 output file from Scrivener 3.

When I go to File > Compile > select a format > Edit Format > Section Layouts, I can select my desired font color for chapter titles, in this case blue. The chapter title shows as blue in the preview pane (see attached image). But when I create the ePub document and open it in iBooks, the chapter titles are black. The blue is lost. Any ideas what I am doing wrong?

FYI I tested this same functionality creating an ePub 2 file from Scrivener 2, and it works fine - it retains the blue titles. So I don’t think it’s an iBooks issue, but maybe there is something I’m not understanding about Scrivener 3. Thx

It looks like we’ll need a little more configuration detail than what is shown in the screenshot. I created a test Layout that looks like you have it set up in the screenshot. I had to make some presumptions about the settings in the Title Options tab, using “Day <$n>” as the prefix, with a line feed following, and setting both the prefix and main title to uppercase transformation. Here is the HTML I get from that:

[code]

DAY 1

RED BOOK


[/code]

The “color” value is included, and in reader software the result looks fine. (Well on second inspection, I was using a primary H1 heading for this layout and it looks like you are using a second-level header. I just ran a quick test though and that doesn’t make a difference—nor should it.)

Oh, and along the lines of checking to make sure whether or not the printer is plugged in, make sure you don’t have Remove text color enabled in the compile overview screen, under the general options tab. :slight_smile:

Hi Amber. Thank you for replying. I have confirmed that the Remove Text Color box is unchecked. I am less clear on what you are trying to tell me about the HTML. Are you suggesting I need to directly edit the HTML?

Attached is a small test file with my title settings. Would you be able to look at it and see what I’m doing wrong?

Thank you.
Test - Blue Titles.scriv.zip (122 KB)

Thanks, that helps a lot.

I was just showing you an example of what the HTML should look like with a typicall arrangement of settings—and more importantly where to look to see if the colour is being correctly applied, but perhaps ignored by the reader (in this case, iBooks should be fine about text colours though).

In this case, it doesn’t seem to be applied when the Small Caps setting is in use:

<h2 style="margin: 36.0px 0.0px 36.0px 0.0px; text-align: center; text-indent: 0.0px; font-size: 100%"><span style="font-size: 133%"><b><i><a id="doc1"></a>D</i></b></span><span style="font-size: 80%"><b><i>AY</i></b></span><span style="font-size: 133%"><b><i> 1</i></b></span><b><i></i></b></h2>

As you can see, the style attribute for the h2 element is missing the “color:” setting. If you switch the compiler to use uppercase, you get:

<h2 style="margin: 36.0px 0.0px 36.0px 0.0px; text-align: center; text-indent: 0.0px; font-size: 133%; color: #0246a9"><b><i><a id="doc3"></a>DAY 2</i></b></h2>

So for the moment it looks like there is a bug creating a conflict between these two formatting approaches.

Thank you Amber. Are you with LL, or do I need to report the bug separately to them?

Yup, no worries! It’s already been reported directly to Keith (or will be Monday). If it’s an easy fix it’ll be in the 3.0.2 maintenance update. If you need to get something compiled right now though, you’ll either have to edit the HTML or choose between one or the other formatting types.

Great, thanks. I’ll just compile with Scrivener 2 for now …

This bug was introduced by another fix I made in 3.0.1 and has been fixed for 3.0.2. In general, though, I recommend using ePub 3 format in Scrivener 3 - ePub 2 is mainly there for use with legacy projects and will one day be phased out.

All the best,
Keith

This now works in 3.0.2. Thanks!

Excellent! Thanks for the confirmation.