Fix Section Layout Style in Composer

User avatar
nontroppo
Posts: 990
Joined: Mon Mar 05, 2007 5:22 pm
Platform: Mac
Location: Airstrip One

Mon Jan 01, 2018 3:41 pm Post

Enjoy the family stuff, more important than nerdleing with CSS ... :D

User avatar
Bridey
Posts: 390
Joined: Wed Nov 22, 2017 2:24 pm
Platform: Mac

Mon Jan 01, 2018 9:36 pm Post

If a user styles the text in the sampler, the CSS gets generated automatically and is included in the compiled ebook (subject to ebook limitations). Sample project attached, if it helps to have a sandbox.

Compiled.jpg
Compiled.jpg (438.09 KiB) Viewed 585 times


Scrivener Test.zip
(95.56 KiB) Downloaded 26 times

sj
sjjan
Posts: 9
Joined: Fri Dec 29, 2017 2:21 pm
Platform: Mac + iOS

Wed Jan 03, 2018 10:36 am Post

That all works for as long as you do not compile for Kindle KF8/Mobi Ebook as once you select that as for your compile format, the formatting window has no effect and does not seem to work. Right? If I select the 3Pub3 format and then run that export file through Kindle Previewer 3, I am able to make some adjustments that end up in the mobi file. However, if I select Kindle KF8/Mobi as compile format, whatever I change in the CSS does not seem to end up in the book.

User avatar
nontroppo
Posts: 990
Joined: Mon Mar 05, 2007 5:22 pm
Platform: Mac
Location: Airstrip One

Wed Jan 03, 2018 1:13 pm Post

No, that is not right. Bridey's Scrivener Test.scriv project is already designed EPub3/KF8 — his TOC document uses the Table of Contents Section Layout which uses Heading 1 style for title and toc style for text. He has modified Heading 1 to be green using the Styles panel, and made a toc style that is magenta text, also edited using Styles and adding a CSS class called toc, but he has added no custom CSS, he has only used the GUI to make these changes AFAICT.

As I mentioned above (viewtopic.php?p=256588#p256588), you can modify font size, line spacing, bold, italic, color, indentation, margins using the Styles visual editor. If you have more detailed changes, then the CSS can be edited for more specific needs. Again this is for EPub3/KF8, where the output is semantic clean and elegant HTML5.

User avatar
nontroppo
Posts: 990
Joined: Mon Mar 05, 2007 5:22 pm
Platform: Mac
Location: Airstrip One

Thu Jan 04, 2018 3:44 am Post

Actually I may have misunderstood you. You are saying EPub3 looks OK, and if you maually convert EPub3 to KF8 it is OK, but if you use KF8 directly then you can't see the changes? This could be possible as the base CSS is different, I'll need to test.


EDIT: KF8 output is working as EPub3 for me, here i've centered the heading, coloured it green, bold+italics and the text is right-aligned, bolded coloured red using the Styles editor, viewed in Calibre's .mobi viewer:
Screen Shot 2018-01-04 at 11.52.01.png
Screen Shot 2018-01-04 at 11.52.01.png (8.31 KiB) Viewed 499 times


Scrivener Test.mobi.zip
(39 KiB) Downloaded 17 times

Scrivener Test.scriv.zip
(74.15 KiB) Downloaded 18 times