Formatting styles not working for .mobi

ke
keithyd
Posts: 23
Joined: Sat Sep 08, 2018 4:09 pm
Platform: Windows

Wed Jul 01, 2020 4:13 pm Post

I've been using Scrivener for several years and I like it a lot, but this latest 'upgrade' to the styles formatting is driving me nuts.

Exporting to .mobi, I want to configure the Chapter headings to be centred and the first paragraph to be ranged left and have the first 3 words capitalised. Using the default Heading style didn't work, so I copied it and created a Heading with the Chapter One etc centred (although there doesn't seem to be a 'centre' option, it seems to default to being centred.)

But try as I might, I can't get the Chapter One centred on compilation and neither are the first three words capitalised. Here are some examples of settings and compiled outputs.

You'll also see that after one has been playing around with this for a while, one gets a ton of 'Chapter Heading's in a list. Click on the first 'Title' box and the preview display shows Chapter One centred. But if you highlight that row of boxes, with the 'Title' box still ticked, you get 'Section title' appearing in the preview box. Which is correct - highlight the row or not when saving?

The first image above is my despairing attempt to use the Assignation of the style that has the Heading and the Text all together in one style, with the first 3 words capitalised. All that got me in the resultant compilation was a blank screen. The next two boxes show the preview screen when the Title box row is highlighted, and not highlighted, and also the plethora of 'Chapter Heading' rows that have been created. I have one more image but this Topic won't allow me to add it - it simply shows the output of the compilation, with Chapter One ranged left and without the first 3 words of the actual chapter's text capitalised - in other words, ignoring the styles I'm trying to give it. I'll see if I can post it in a follow-up post.

Any help gratefully received!
Attachments
Chapter layout 1.png
Chapter layout 1.png (24.45 KiB) Viewed 380 times
Chapter heading layout 2.png
Chapter heading layout 2.png (24.33 KiB) Viewed 380 times
Chapter Heading duplicates.png
Chapter Heading duplicates.png (26.17 KiB) Viewed 380 times

ke
keithyd
Posts: 23
Joined: Sat Sep 08, 2018 4:09 pm
Platform: Windows

Wed Jul 01, 2020 4:15 pm Post

I'm hoping that I can attach an image of the resultant compilation ... nothing I do seems to alter this output.
Chapter layout resulting compile 1.png
Chapter layout resulting compile 1.png (12.69 KiB) Viewed 377 times

st
strice
Posts: 1
Joined: Wed Jul 01, 2020 5:13 pm
Platform: Windows

Wed Jul 01, 2020 5:31 pm Post

Aha! I've been wrestling with the same issue today. None of my heading sections will centre - they preview on the middle in the compile options, but end up on the left. These issues also happen when using epub. So I compiled an epub2 and checked it out in Sigil to see what was going on.

In the style sheet only the "page-title" class (and some caption classes) had text-align set to centre. The header text that was supposed to be centred for me was an <h1> with class of "title"... but the style didn't have any text-align. I expect there's a bug where this style hasn't been added correctly.

Incidentally, custom separators also don't centre for me either.


If you're interested in some inventive workarounds - you can change the formatting of your heading section to use the "page-title" style and it should centre. For separators I've got a much more laborious workaround that I used in Scriv v1: adding a new text section between each section with the separator as text and style set to page-title. It's not very elegant.

ke
keithyd
Posts: 23
Joined: Sat Sep 08, 2018 4:09 pm
Platform: Windows

Wed Jul 01, 2020 7:01 pm Post

Thanks! I could try that workaround but to be honest I'd rather Scrivener sort this out. The new compile function has been a trial since this beta started up, I think. Even when it worked it was - and is - difficult to understand.

ke
keithyd
Posts: 23
Joined: Sat Sep 08, 2018 4:09 pm
Platform: Windows

Wed Jul 01, 2020 11:18 pm Post

Well it seems that Scriv isn't handling centered text at all. I use a section break in my books which is simply oOo - the text letter o in small letters and the central one in capitals. I've used the format button (the icon with lines centred on it), a style definition for centred text, and even tried to invent a character style for 'centred' ... nothing works. My section break is always compiled ranged left, like the Chapter headings I've been trying to centre. I even experimented by taking a paragraph of my text and centering it using the icon and the Centered text paragraph style, and it was compiled ranged left and justified right, no centering at all.

Help!

ch
chrisdr2
Posts: 29
Joined: Wed Oct 16, 2019 9:09 am
Platform: Windows

Fri Jul 03, 2020 8:15 am Post

I see the same centering chapter/separator problems with .mobi output. I partially fixed the custom separator by importing an image into scrivener, centering it then using <$include:Separator>.. But this only worked for one chapter - after that, the image got replaced by a default, and the html truncated, leading to several compile errors.

viewtopic.php?f=57&t=61990

User avatar
Jestar
Posts: 289
Joined: Sun Feb 19, 2017 6:51 pm
Platform: Mac + Windows

Fri Jul 03, 2020 6:25 pm Post

I'm wondering if this isn't related to (or the same) for all compiled outputs as mentioned here: https://www.literatureandlatte.com/forum/viewtopic.php?f=57&t=62150 and with a bug number attached here: https://www.literatureandlatte.com/forum/viewtopic.php?f=57&t=61212&p=314541&hilit=headers+and+footers#p314541.
Win 10 Ent. 64-Bit 2004
Intel Core i7-2600 @ 3,4 GHz (Quadcore) 32 GB RAM
Samsung SSD 860 EVO 500GB
NVIDIA Quadro K600
Scrivener Version: Version: 1.9.16.0 - 14 Nov 2019 & Version: 2.9.9.8 Beta (984254) 64-bit - 12 Jul 2020

ke
keithyd
Posts: 23
Joined: Sat Sep 08, 2018 4:09 pm
Platform: Windows

Sat Jul 04, 2020 5:06 pm Post

Jestar wrote:I'm wondering if this isn't related to (or the same) for all compiled outputs as mentioned here: https://www.literatureandlatte.com/forum/viewtopic.php?f=57&t=62150 and with a bug number attached here: https://www.literatureandlatte.com/forum/viewtopic.php?f=57&t=61212&p=314541&hilit=headers+and+footers#p314541.


Well I compiled and output to Word.docx, then translated that file through Calibre to .mobi and everything that was supposed to be centred, was. It was centred in Word before the translation, too.

ch
chrisdr2
Posts: 29
Joined: Wed Oct 16, 2019 9:09 am
Platform: Windows

Tue Jul 07, 2020 10:31 am Post

keithyd wrote:
Well I compiled and output to Word.docx, then translated that file through Calibre to .mobi and everything that was supposed to be centred, was. It was centred in Word before the translation, too.


I tried using Calibre docx conversion too, When I used centred text for the separator, it worked fine. But the docx converter doesn't seem to handle centred images - they got left justified.