Can't Get Preserve Formatting to Work in Scrivener 3

I have three sections in my book where I’ve applied Preserve Formatting and I’ve yet to get it to work.

  1. Aligning text left and without spacing between lines in my Foreword for the writer’s name, title and website.
  2. Aligning an image, also in my Foreword, to the left (it always comes up centered)
  3. A bulleted list in my Epilogue that won’t retain the assigned bullets.

Has anyone else had issues with Preserve Formatting not working and found a solution?

I have. On export, the formatting is gone.

What is the format you are trying to compile to? I just tested preserve formatting output to PDF and alignment (left vs. right anyway) was preserved, as was list bullet type (and font family and size). For your first point you may want to try line breaks, as a way to not invoke any potential paragraph spacing…

I’m compiling for Kindle KF8. I have tried every suggestion offered from tech support and in another forum thread and it just doesn’t work. No matter what I try images remain centered.

Yes, it does work for .PDF, but I need it to work for .mobi output so I can publish my book on Kindle. I’m already two weeks behind now because of several issues with Scrivener 3 and compile for Kindle (there is a known bug on this matter).

I’ve been told that centered images is now the default for Scrivener 3. It would be better if the default for images was no style so the user could make that determination on their own. Then images would not be forced to maintain a centered position.

Line breaks haven’t worked either on point #1 because only the first line remains indented. Nonetheless, I was finally able to get the left justification to work.

If you’re compiling to KF8 (which is converted from an EPub3), then the fix is incredibly simple. Images are controlled by the HTML element and all you need to do is give the element the correct margins. What compile format are you using? If you are using a default format, right-click and Duplicate and Edit, then go to the CSS setting. By default images are give an auto left and right margin (margin: 1rem auto 1rem auto), which means it centers the image. You can see that on the right in this screenshot:


You want to add the following override to the Custom stylesheet (see left panel of screenshot), where you give a fixed 1rem margin to all margins:

/* OVERRIDE for Images */
img { display: block; margin: 1rem 1rem 1rem 1rem !important; }

The images will now be left aligned (EPub opened in iBooks, I don’t have the kindle convertor installed):

Bullets for EPub/KF8 is a different matter. HTML/CSS support is totally different to Scrivener’s format, and you cannot expect the same bullet characters. BUT the huge flexibility of Scrivener 3 means you can add the correct CSS styles to get the bullets you want. You can see the types of bullet’s you can use here:

developer.mozilla.org/en-US/doc … style-type

What styling do you want?

As for your first problem, I was hoping line breaks would have been a quick fix, but this can also be fixed using a paragraph style and custom CSS.

Thanks! That’s all very helpful. The left justify css for the image works great. Is there a way to specify it for just one image? I want the signature left-justified, but not the author photo I’m using in the bio.

On the bullets, I decided to remove the bulleted list in favor of a shorter paragraph. However, I’ve been trying to use a heart image as an end of article symbol as I do on my website. However, Kindle doesn’t seem to like them. I keep getting strange characters after the heart as in the image below.

Yes, you should be able to make only 1 figure affected. You want to select the image you want, then make a NEW Style (here called MySignature).
Screen Shot 2017-12-10 at 23.20.08_SML.png

Then in your compile format you add this style name to the Styles section and give it a CSS Class Name (here we use mysignature), then in the CSS section add the rule (remove the previous rule i mentioned too):

.mysignature > img { margin: 1rem !important; }

Regarding the heart, Kindles have very poor character support (only Latin-1!) and characters like Heart are not supported:

kdp.amazon.com/en_US/help/topic/G200652310

I’ll give that a try. However, how do I import this style name to the Styles section? Do I just create a style with the same name or is there a way to actually import the style itself?

Press the + icon in the top right of the styles panel and you get a menu, select the style you made in the editor…

Styles risk being lost or overwritten (especially by someone who is mad enough to tinker a lot, like me).

Is it possible to style an image using MMD instead?

Bridey: you can add attributes to MMD images, though I haven’t tested it in the EPub compile workflow:

 ![image][]
 
 Some text...

[image]: http://path.to/image "Image title" class=myclass width=40px height=400px

For Pandoc you can add this inline, but then you would have to use Pandoc to generate the EPub:

![This is a caption](image_link){#myid .myclass width=50%}

Many thanks. Very grateful. Time to tinker.

Thanks so much for your help today. I finally have the signature image left justified and my photo centered as they should be. Many thanks!

I do have another question relating to image placement that you may be able to help with. I’ve been having a problem getting the first three words of each chapter to appear in uppercase with the appropriate settings enabled. It turns out that an image I was using at the beginning of the chapter after a quote and before the text was messing things up somehow. When I remove the image, the uppercase text appears.

Is there a way to place the image through a section layout rather than place it manually on the page. I’m hoping I can do this and not have it keep the uppercase words from appearing. What I currently have appears like this…


The chapter, section title and quote appear in one section layout and the text appears in a different section below it. Otherwise, the first three words of the quote appears in uppercase rather than the first three words of the chapter text below.

This is the ornamental break which needs to be inserted between the quote and body text…
heart-flourish-small.png

This was solved in the other thread, use a Placeholder image in the prefix of the Section Layout. 8)