Page 1 of 1

Scrivomatic Style character text color

Posted: Wed May 15, 2019 11:03 pm
by arevell
Is there a way to style the text color from scrivener to have it output a predefined word style (where I made it the same color)?

So let's say I have this in scrivener:
Screen Shot 2019-05-15 at 6.53.53 PM.png
.
Screen Shot 2019-05-15 at 6.53.53 PM.png (192.66 KiB) Viewed 230 times


And I want this in Word (artificially made for display here):
Screen Shot 2019-05-15 at 6.56.06 PM.png
.
Screen Shot 2019-05-15 at 6.56.06 PM.png (126.74 KiB) Viewed 230 times


I put this in my Styles section for my format in scrivener:

Screen Shot 2019-05-15 at 6.57.46 PM.png
.
Screen Shot 2019-05-15 at 6.57.46 PM.png (356.55 KiB) Viewed 230 times


However, the blue font does not appear. It's just black.

The markdown .MD file output looks fine with:
Explain the<span style="color:blue" importance of the problem</span> or critical ...

But I cannot figure out how to link that to the Word Style.
Out of docx, tex/pdf, and html, only html has the color style correctly.

Thanks!

Re: Scrivomatic Style character text color

Posted: Tue May 21, 2019 12:22 pm
by AmberV
Yes, this is something Pandoc can do, though you’ll have to set it up a bit, at least from what I have seen in my simple testing of it. The two key ingredients are:

  • A custom reference.docx file (save it into your user folder under .pandoc for it to be used automatically. Instructions for creating and editing this file are in the Pandoc documentation, page 18.

    Once you have that file created, you would want to add your custom blue text style to the bottom of the file. Apply the formatting attributes you desire, and then create a new character style for it.

    And you can modify the formatting of this document as well to adjust default .docx output. So that’s a nice trick to know about anyway.
  • Marking the text as styled in the source. This technique is documented under the Custom Styles section, starting on page 107. This is what you would want to add to Scrivener’s settings, as your style prefix/suffix, instead of the HTML. For example:

    Code: Select all

    Here is some [blue text]{custom-style="Blue Text"}.

I do think that this approach is fairly format-specific. It doesn’t seem to produce a good result for LaTeX or HTML. There may be ways around that (I’m not a Pandoc expert), but if not—that’s one nice thing about Scrivener’s compile Format system. You can have one format producing special HTML spans, another wrapping your text in DOCX styles, etc.

Re: Scrivomatic Style character text color

Posted: Tue May 21, 2019 3:20 pm
by gr
It sounds like you need a markdown path, but if compiling straight to docx is an option at all, then the remedy is easy. Just name your blue style with the very same style name as you have set in Word. Also, in the style area of compile (for docx output), make sure the preserve-style-info-in-output option is enabled.