Fix Section Layout Style in Composer

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

Fri Dec 29, 2017 2:27 pm Post

I have been updating my documents from Scrivener 2 to 3 and worked through some instructional videos and documents, but can't find how to make section titles bold and left aligned in the Kindle output. I have to update a Kindle e-book and just can't find it. Same for the TOC formatting. Where can I adjust?
Last edited by sjjan on Sun Dec 31, 2017 10:38 am, edited 1 time in total.

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

Fri Dec 29, 2017 3:04 pm Post

You can edit styles in the compiler (see image). For the ToC, this thread might help:

viewtopic.php?p=256296#p256296

This guide also has info and samples covering compile settings:

http://www.literatureandlatte.com/scriv ... date-guide

Styles Compiler.jpg
Styles Compiler.jpg (344.33 KiB) Viewed 644 times

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

Sat Dec 30, 2017 2:06 pm Post

I have studied the above documents and the official manual as well. Thanks for the information provided and I was able to import my old version 2 compiler format into version 3. However, it feels to me that for a change in the available Section Layouts offered in the compiler, I have to resort to doing CSS stuff??? I can assign a Section Layout to Section Types, but if the Section Layout needs to be finetuned, I have to resort to adjusting the CSS/Stylesheet? That is, except for some basic changes such as setting Title Prefix or setting a title in all Uppercase.

The formatting window only shows the result as that formatted by styles and CSS, but if I go to the styles menu, there is not much I can change that has an effect on how Section Layouts behave.

So, I have a TOC but it is only defined in the Default CSS Stylesheet as follows:
/* Table of contents navigation */
nav#toc ol { list-style: none; padding: 0em; text-align: center; line-height: 1.5em; margin-top: 0.5rem; margin-bottom: 0.5rem; }
nav#toc ol li:before { content: none; }

Do I really have to dive into adjusting the CSS Stylesheet if I want the TOC to look a bit different?

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

Sat Dec 30, 2017 8:36 pm Post

Not unless you want something really exotic.

Format a named style using the WYSIWYG sampler, and the CSS will be generated for you.

Styles.jpg
Styles.jpg (325.26 KiB) Viewed 592 times


Compile TOC.png
Compile TOC.png (89.37 KiB) Viewed 592 times

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

Sun Dec 31, 2017 11:25 am Post

OK. I by now read a short primer on CSS (should have done that earlier). What am I still missing out on? The WYSIWYG sample text "editor" as can be seen in the screenshot below is not really helpful. I can make it bold or italic, but not change the font size. I must be missing something important here.

Image

I also do not have any style noted on that list of Styles there as well, but I could add Heading 1 or others, but no toc or other options there.

Image

So how do I change the appearance of a Section Title? Or how do I change the word Content in the table of contents from left-aligned to centred and bold? How to decrease the spacing between an image and the text right below it? How to make the image appear left-aligned and not centred?

Let me give some samples of how it appears now after compiling and what I had before.

This is how the table of contents appears in the Kindle App on a published book. The word "CONTENTS" is bold and centred.

Image

With the new compiler, the table of contents looks different and the word "Contents" is to the left now and not bold. Where, oh where ... can I change its appearance? I had the frontwork also stated in the TOC, but now it is gone.

Image

The section headers/titles would initially look like this.

Image

Now it looks different.

Image

A line of text right underneath an image would look initially like this.

Image

Now there is more white space in between the image and the line of text below. Where can I adjust it?

Image

I did not have the title of the book running at the top of each page in the Kindle e-book, but now I have.


It must be me, but I find it hard to figure out the workings of the new compiler and do not understand why from a usability perspective it has become easier to use. Any help appreciated or a pointer to a clear instruction document where it is specified how to adjust the above.

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

Sun Dec 31, 2017 11:38 am Post

The thread below includes a sample project and, perhaps, some answers (with caveats).

viewtopic.php?f=2&t=50041

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

Sun Dec 31, 2017 12:52 pm Post

That link was posted above as well, but it seems so overly complicated for basic formatting needs. I might understand that "under the hood" the new setup of the composer is better, but from a point of view of a typical Scrivener user, I can't see how this would work out. I am still trying to figure out where my TOC is defined and styled as I do not have a section layout defined for it and still it shows up. Can't find anywhere in the menus an option for it. And I do even own a software company :-) but have trouble figuring it out (I don't code).

If I try to follow the logic on that post, I get stuck.
I a new section layout with the name "Table of Contents" and assigned a class name to it of "toc".

Image

Then next I tried to add a new Style called "toc" but it is not available on the list.

Image

The latest version of the Scrivener Manual also is not of much help here. What am I missing or doing wrong?
Thanks for the comments and help provided.

One thing I do notice is that if I compile using the older Kindle format <Kindle Mobi Ebook (.mobi)> the output is fine, but when I compile for the newer Kindle format <Kindle KF8/Mobi Ebook (.mobi)> I just can't get it to render my text to look the same.

User avatar
lunk
Posts: 1910
Joined: Wed Aug 21, 2013 4:24 pm
Platform: Mac + iOS
Location: Sweden 64° N

Sun Dec 31, 2017 2:10 pm Post

sjjan wrote: What am I still missing out on? The WYSIWYG sample text "editor" as can be seen in the screenshot below is not really helpful. I can make it bold or italic, but not change the font size. I must be missing something important here.

Image



If you click in the text and then click on the Aa, can’t you change the font then?

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

Sun Dec 31, 2017 3:17 pm Post

Yes, that works for choosing another font or font size. Thanks! What about the rest and how to implement? There is not much else you can define here and it is unclear where next to do.

So, in Styles, I could add a predefined Section Layout using the + sign and renamed it to "Test heading", then saved the adjustment.

Image

When going back to Section Layouts and to the formatting screen at the bottom, the new Style I just created and saved is not there.

Image

I am assuming that most of the people using Scrivener are authors and writers and not technicians, software-engineers or coders. It seems to me that I am more or less stuck with some basic templates in the composer that can create a range of formatted documents for me, but that it is damn hard to tweak these predefined formats. I might be mistaken and hope someone can clarify for me how it can be done.

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

Sun Dec 31, 2017 5:50 pm Post

I suppose we are all different; after a first shock of the large change from V2 to V3, I adapted quickly to S3's compile, and consider it to be carefully designed to deal with a *large* diversity of outputs (Scrivener doesn't only output to kindle). I consider myself a technical user in that I prefer Pandoc to drive all my compilation running custom processing filters, there are quite a few technical writers here too... I do not exactly understand where you are having difficulty? There is nothing stopping you from using the old mobi format, but it is more limited and generates poor HTML so to consider it somehow more flexible is incorrect. EPub3 and KF8 are basically HTML5 + CSS based formats, and Scrivener 3 allows you to layer customisation flexibly. The Style editor only creates basic CSS formatting, and if you want more detailed changes then you augment it with custom CSS. Section layouts and styles allow you to semantically tag your parts with CSS classes, and to be able to do all this via a GUI is great.


When going back to Section Layouts and to the formatting screen at the bottom, the new Style I just created and saved is not there


First you are trying to edit the old mobi format that cannot fully support CSS adjustments. Technically it is better to adapt to the new EPub3 (and derived KF8) format. Your screenshot shows you are selecting the wrong GUI element (it is the text level, not the style, and it does not say it is a style menu anywhere), because you are trying to edit the old mobi format. You may benefit from reading through the Scrivener 2 to 3 tutorial and manual. I would also recommend looking at the EPub3/KF8 EBook compile format as it shows you exactly how to layer section layouts, styles and CSS to build a flexible good looking output.

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

Sun Dec 31, 2017 7:28 pm Post

Thank you for your reply and I do really appreciate the feedback. I slowly am starting to understand that to tweak the output in the new composer I would have to do that using custom HTML5/CSS code. As said, I just read a short primer on CSS and was already more or less familiar with the basics of HTML, but I am just surprised that Scrivener would require its users to resort to writing custom CSS code in order to change basic stuff in how the composer generates its output.

Sure, if you are a technical savvy Scrivener user, I understand that you have a lot of flexibility and power at hand, but what about all the other Scrivener users? How many Scrivener users are able to actually write CSS code to tweak the output? I personally doubt that there are many able to do so.

I did read the documents several times that explain how the migration from version 2 to 3 work out and I do have the same issues when selecting the Kindle KF8/Mobi format. I just cannot change the style or Section Layout as specified above or it is not intuitive for me to figure out. I don't write code, but own two software companies for many years. If I can't figure this out, how about all the non-technical authors and writers using Scrivener? Am I the only one having trouble with this part?

It would help if I would get just a step-by-step guide to something as simple as adjusting the TOC title to be centred and bold instead of left-aligned and in normal type.

I have no problem using the older Kindle Mobi Ebook format for now, but since it was mentioned that the KF8/Mobi format was designed in a better way, I would like to know how to use it without losing control on the look-and-feel over the eventual .mobi file submitted to Amazon.com.

Image

Screenshot of the composer frontend with the KF8/Mobi format selected and having the same issues as described above. The focus/selection is on the sample text in the bottom right part.
Last edited by sjjan on Mon Jan 01, 2018 9:24 am, edited 1 time in total.

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

Mon Jan 01, 2018 3:03 am Post

Are you using a manual TOC or autogenerated one? Can you share a minimal test project that demonstrates your problem, which will be easier for us to tinker with and give more focussed advice?

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

Mon Jan 01, 2018 1:55 pm Post

Reading through the Scrivener Manual again, I found this statement that the control of the layout with Epub and Kindle formats is only handled through CSS and not through the Formatting window you find bottom right in the Composer frontend window. That Formatting window becomes active if you select a format for e.g. print or PDF and then allows you to set a title to be left-aligned or the even change its type or font-size. Once you select an Epub or Kindle output, any of these changes you made in the Formatting window will have no effect on the output. It is now for 100% determined by styles and CSS settings, That is why you get the extra CSS menu in the composer screen to configure it.

So, even if you first configure it for print, save it and them open it to be compiled for Kindle, the preview in the formatting window will still show the format as in print with the Title to the left, but once you run the composer and compile for Kindle, the results will have nothing to do with what was in that Formatting screen and take the format purely out of the CSS window.

So, if I am not happy with how the new composer generates the output for an Epub or Kindle format, it seems to me that the only way I can control and tweak the output is by going into the CSS.

As a side effect, select Kindle as output format and then edit the format. The Formatting preview screen will look different and not allow you to select a title, move it to the left, change its font-size and so on. All these things are possible if you would have selected the print format.

In Scrivener 2, this limitation was not there, so I had more control of the outcome. Now I have to do it in CSS.

Again, the CSS option is probably great and gives me great control, but who in the world of Scrivener wants to go into CSS coding to tweak a bit of formatting?

I can upload a test document, but please double check first if you can use the formatting window in the composer frontend if you select Epub or Kindle as output format. You probably can't and it explains all the issues above.

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

Mon Jan 01, 2018 2:42 pm Post

You are still not distinguishing between Epub2/legacy mobi and EPub3/KF8 — these use a radically different process for compilation. The old method used Apple's RTF to HTML4 converter, which transformed much of the editor formatting but produced really messy and outdated HTML. The EPub3/KF8 engine uses RTF⇨MMD which produces very clean HTML, with the caveat that it uses markdown structuring. Both methods use CSS under the hood; it is the only way to style HTML, but for EPub3 the automatic style conversion is more limited, the trade off for a much cleaner and easier to tweak HTML output.

Here is what I edit in the formatting pane:

Screen Shot 2018-01-01 at 22.19.09.png
Screen Shot 2018-01-01 at 22.19.09.png (83.55 KiB) Viewed 455 times


And what gets automatically added to the CSS (font size, line spacing, bold, color, indentation, margins — I did NOT add this CSS, Scrivener did):
.bordered-title { margin: 0rem 0% 0.83rem 0rem; text-indent: 0rem; text-align: right; line-height: 1em; font-size: 1.33rem; font-weight: bold; color: #FB0017; }


And the right-aligned bolded coloured EPub title output (iBooks):
Screen Shot 2018-01-01 at 23.03.12.png
Screen Shot 2018-01-01 at 23.03.12.png (108.34 KiB) Viewed 441 times


That should get you most of what you want, the formatter does not add more because MOST ebook readers override the formatting anyway. If you want more precise tweaking, you can supplement the default styles with your own custom overrides. I would agree that some bits of the UI are a bit misleading (the "Include font family" toggle does nothing for Epub3, font families are never included!) This is due to the fact there at least 13 major compile format targets, and designing a UI that is consistent across so many different outputs is challenging...

Perhaps reading this will help: http://www.literatureandlatte.com/blog/ ... crivener-3

Why not just use legacy mobi format, which is what you were using in Scrivener 2? It is *still available* for you, just use it and when you have time learn to use the more powerful modern format, then you have that option. I just tested this in Scrivener 2 setting custom fonts present on my system for titles and they are not visible in my eBook viewer at all. Scrivener 3 is more flexible, more powerful, yet retains the old format so you really have the best of all worlds...
Screen Shot 2018-01-01 at 23.03.12.png
Screen Shot 2018-01-01 at 23.03.12.png (108.34 KiB) Viewed 441 times
Last edited by nontroppo on Mon Jan 01, 2018 3:08 pm, edited 2 times in total.

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

Mon Jan 01, 2018 3:02 pm Post

Thank you for the response and advise. I have just downloaded an e-book from Amazon about Markup and Pandoc. Just to get a better picture. Will respond tomorrow. Tied up now with New Year family stuff :-) but thanks again for the great willingness to help out on this forum.