How to maintain font color in section title?

po
pomme4mois
Posts: 144
Joined: Wed Aug 10, 2016 11:13 pm
Platform: Mac

Sat Jan 13, 2018 8:18 pm Post

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

Screen Shot 2018-01-13 at 14.09.46.png
Screen Shot 2018-01-13 at 14.09.46.png (330.64 KiB) Viewed 1085 times

User avatar
AmberV
Posts: 22061
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Sun Jan 14, 2018 1:20 pm Post

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: Select all

<h1 style="margin: 0.0px 0.0px 48.0px 0.0px; text-align: center; text-indent: 0.0px; font-size: 133%; color: #0094de"><b><i>DAY 1<br />
RED BOOK</i></b></h1>


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. :)
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

po
pomme4mois
Posts: 144
Joined: Wed Aug 10, 2016 11:13 pm
Platform: Mac

Sun Jan 14, 2018 2:54 pm Post

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.
Attachments
Test - Blue Titles.scriv.zip
(122.01 KiB) Downloaded 25 times

User avatar
AmberV
Posts: 22061
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Sun Jan 14, 2018 4:51 pm Post

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:

Code: Select all

<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:

Code: Select all

<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.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

po
pomme4mois
Posts: 144
Joined: Wed Aug 10, 2016 11:13 pm
Platform: Mac

Sun Jan 14, 2018 5:31 pm Post

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

User avatar
AmberV
Posts: 22061
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Sun Jan 14, 2018 5:49 pm Post

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.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

po
pomme4mois
Posts: 144
Joined: Wed Aug 10, 2016 11:13 pm
Platform: Mac

Sun Jan 14, 2018 6:16 pm Post

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

User avatar
KB
Site Admin
Posts: 20118
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Mon Jan 15, 2018 6:19 pm Post

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
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

po
pomme4mois
Posts: 144
Joined: Wed Aug 10, 2016 11:13 pm
Platform: Mac

Wed Mar 07, 2018 1:16 am Post

This now works in 3.0.2. Thanks!

User avatar
AmberV
Posts: 22061
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Wed Mar 07, 2018 11:15 am Post

Excellent! Thanks for the confirmation.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles