Preserve italics markdown-style when syncing to plain text

Hello, I have a wonderful workflow using Scrivener on several Macs and syncing to plain text in a Dropbox folder so I can use distraction-free editors on Mac, iOS and elsewhere. It’s served me well for years.

But…I hit a problem regularly where my italics formatting gets lost in the sync to plain text. My favourite plain text editors don’t support RTF but some of them support markdown.

Therefore, I’d love it if syncing to plain text could do minimal markdown conversion to support italics, and maybe some other markdown features in future.

Thanks for reading.

It may not be your cup of tea, but Scrivener is in fact Markdown-friendly, in that it can be used to compose in Markdown and compile to several types of output. The options are broadened if you install Pandoc, which will give you access to high quality DOCX conversion. Refer to Chapter 21 of the user manual for details.

I do very much the same thing you do with sync folders, but when I return to Scrivener I don’t stop using Markdown. I use it everywhere.

is this really possible?
i’d really like to use md everywhere (if possibie also disabling the RTF editor :wink:
going to study Chapter 21 of the manual… thanks!

Well you can’t disable RTF (and once you start looking into what these tools can actually add to the workflow, you might not want to), but absolutely—it has had integration since version 1.0, before Markdown became common. 3.0 really upped the stakes in my opinion. It has extensive designs for working with MultiMarkdown and Pandoc dialects. Part of that comes from just how powerful the compiler is, once you start digging in to it, but a lot of what makes it powerful is its ability to generate complex plain-text documents. The user manual itself is in fact written with the MMD. You can grab a copy of the .scriv to see how it is put together, from our user manual download page.

If you have questions, head over to the MultiMarkdown & LaTeX board, here on the forum.

Thanks Amber, this is interesting. I tried it, but fully committing to markdown inside Scrivener’s lovely RTF editors may not be for me at this stage. I’m happy to have my texts look functional/ugly while I’m on the go but when I get the luxury of writing in Scrivener the attractive wysiwyg presentation is quite important.

The need to double-space every paragraph is the main passion killer. Which is ironic, because when syncing to plain text, that’s the one markdown-style transformation Scrivener does do. If that need could be bypassed, I’d be fine.

I go through phases like that as well, and one of the nice things about Scrivener is that it takes a piecemeal approach to Markdown. You can go all in and use nothing but syntax, even avoiding features like footnotes and heading generation if you want. But I’d say that’s probably a rarer way of using it. Most will be blending some rich text features, like images in the editor, and even further you can use styles to generate syntax too. You can set up the built-in “Emphasis” style to put asterisks around the text you mark with it, for example, and then you can go and bind ⌘I to that instead of the regular “dumb” italics.

That it does on compile as well. :slight_smile: It isn’t a default setting or a simple checkbox, because the mechanism being used is flexible and capable of more than just Markdown conversion. But setup is simple, and once you have done it once you can easily use that configuration in future projects. I’ve made it as simple as possible with the default settings in the stock Markdown-based compile Formats:

  1. Load up File ▸ Compile…, and set your file type to “MultiMarkdown” at the top. For testing, I find that to be the best choice as you’ll be looking at what Scrivener actually produces, versus guessing at it through the lens of what MultiMarkdown converted it to.
  2. In the left sidebar, select the “Basic MultiMarkdown” compile Format.
  3. Assign your types to Section Layouts.
  4. Double-click on any of the Layout preview tiles you’re using to output body text, to edit the Format.
  5. In the Section Layouts compile format pane, switch Override text and notes formatting to be enabled. The default settings here are probably what you want. I’ve added 12pts of spacing after each paragraph. Repeat for any other Layouts in use that generate Text.
  6. In the Transformations pane, enable Convert to plain text: Paragraph spacing. That will take the 12pts of paragraph padding we are adding dynamically, and turn them into literal empty lines.

You’re done, that’s enough to take a word processor style document and format it suitably for a Markdown converter. There are a few other panes to look at for the sake of education:

  • The MultiMarkdown Options pane has a number of style conversions already set up. As you can see, if you use captions or block quotes from our default stylesheets, then they’ll be converted to MMD syntax.
  • You can create custom conversions as well. In the Styles pane, have a look at the “Addition” style. You’ll see it is adding a prefix and suffix around the text—this is what I was referring to earlier with turning “Emphasis” into a Markdown tool. Here we are using the CriticMarkup syntax for adding text to a revision.

The last thing you’ll want to do here is give the Format a better name, and switch to Save to: My Formats, so that your custom conversion settings are made globally available.

Of course the more of this you do, the less compatible with plain-text folder sync your project becomes. The aforementioned user manual project for instance is not going to benefit from that workflow because it depends very heavily upon styles which are invisible to the folder sync feature (unless I wanted to use RTF editors, which will never happen, ha!). It also makes use of the list and table conversion option, neither of which sync to text well at all.

I’m just bumping this, while the lockdown era has me doing a lot more writing than normal. With apologies to AmberV, who invested a lot of thought, I didn’t really understand where all that was going, sorry. Compiling is something I rarely do, and there’s nothing there I need to customise.

I’m writing fiction, and I just want to type it like I would in any word processor, but when syncing to plain text files have a minimal amount of formatting be preserved when going back and forth, and by minimal I really just mean italics. Because, at least in my experience of writing novels, that’s the only thing that can’t quickly be fixed manually just before compile.

It would be splendid if the Format for external Draft files setting had a 5th option, Plain Text with MD

Failing that, if the Authomatically convert plain text paragraph spacing were accompanied by Use markdown-style italics in plain text

Failing that I’d even be happy if the sync could trigger a custom python, perl, php script to run inside the sync folder and I’d do an rtf<->txt conversion myself.

Hello, I wanted to post something that works for me, in case anybody’s in the same boat and in case anyone can improve on it.

Just to recap what I’m trying to achieve; I need to write fictional prose in WYSIWYG in Scrivener and in plain text with mark-up in external ‘distraction free’ (non-RTF) editors like 1Writer on iOS, and have the two sync back and for with Sync>with External Folder. I don’t want to see mark-up in Scrivener, especially not double-spacing between every paragraph. I only need the folder sync to preserve minimal formatting in the back & forth, as required for prose writing. That’s mainly italics for me, and the occasional double-spaced paragraph break.

I’ve discovered that if I sync to .fountain and pretend all my writing is scene action blocks, everything works and the following styles are preserved perfectly when syncing back and forth, and when compiling

  • italics
  • bold
  • centred text

The slight downers, which I’d love to improve, are…

  • After syncing, Scrivener will apply screenwriting formatting (Courier etc), which has to be undone every time with Documents>Convert>Text to Default Formatting… with everything unticked except Preserve Alignment (for centred text)
  • I can’t figure out how to add an extra newline between certain paragraphs. Double/triple spacing in Fountain all collapses to single spacing in Scrivener. It does seem to be possible by accident though.
  • Some plain text editors don’t recognise .fountain files. Scrivener can be coerced into writing Fountain markup with the .txt file extension to get around this, but on the return trip, Scrivener ignores the Fountain setting and interprets the file as plain text regardless, so the markdown is ignored.
  • I’m working against the intent of the Fountain format and fear some future feature, in an attempt be helpful to screenwriters, will break this for me.

If any developers pass by, please consider a proper markdown conversion to/from plain text as an accompaniment to the Convert paragraph spacing option

Thats really helpful! I’ve been using External Sync for years and never noticed that Fountain preserves bold and italic!

I’m not a developer, but I think I may be able to help with your first point — that synced text is turned into Courier.

Try this:

  1. Format > Scriptwriting > Script Settings. It will probably have ‘Screenplay’ in the Format Title: box. Hit the ‘manage’ dropdown box and save this somewhere to back it up for safety.

  2. Click on the Action element in the left hand list, and change the font to what ever you want it to be. Don’t forget to change the settings in the Paragraph tab to change the Left Indent (it defaults to 0.5in, which probably isn’t what you want) and of course you can set a first line indent if you use those.

[attachment=1]Screenshot 2021-03-13 at 13.01.25.png[/attachment]

  1. Do the same process for any other element that’s likely to be used. One problem I’ve noticed is that # Markdown Headings are translated as General Text, which doesn’t have a setting in Script Settings, as far as I can tell, but for a novel, that’s probably not all that important.

  2. When you’ve finished you’ll be asked if you want to convert existing screenplays to your new format.

  3. BTW, You can force extra lines with two spaces on an otherwise blank line.

Obviously you’ll have to tweak the settings to get exactly what you want, and it won’t be perfect, but it may help a bit…

Here’s an example of a document synced into Scrivener — proof of concept for the above rather than fully tweaked, but I hope it can give you some ideas…

[attachment=0]Screenshot 2021-03-13 at 13.32.02.png[/attachment]

HTH.

You guys are awesome. Too bad my preferred iOS editor of the moment doesn’t do .fountain. However, that can change!

Thanks brookter for these steps to improve the process. I’ll definitely try customising the script style to save on converting formatting every time

This is a great tip, thanks. Works perfectly when going from plain text into Scrivener. It doesn’t work the other way but I figured out a Ctrl-Return creates the necessary invisibles in Scrivener and then everything works great through The back and forth…

The first paragraph should look like this with a newline symbol on the end, and its paragraph symbol isolated on the blank line.↵

The second paragraph will appear one line lower in Scrivener and two lines lower in plain text.

I’m glad (most of it) helps!

As for the blank line issue: I suppose you could use the standard html
, which is passed through by default to markdown, so it should be interpreted correctly by both the external editor and Scrivener’s compiler (not tested…)

But can I ask why you want blank lines in the text of a novel anyway? If it’s just for scene breaks, then Scrivener’s Separator feature is designed to do just that: split the text into a scene per binder document and let the compiler add the blank line or other separator as appropriate. (I appreciate there may be other reasons for blank lines, but scene separation is the usual one, I think.)

Good luck and thanks for the pointer to fountain…

It all helps, thanks. I’ve clarified the above post, which on a re-read did sound a bit dissatisfied, but everything is great now.

Regarding double spacing and why, it’s rare, but every now and again I feel the need to drop an extra bit of space for a single line or moment. A carryover from screenwriting I guess. Using multiple sections would be an annoyance for that.

It didn’t sound dissatisfied at all — I was just intrigued why you’d need blank lines in a novel (apart from scenes). It occurred to me that for very occasional use <br/> seems to be as good a way as any as it’s supposed to work everywhere and you’re not having to think about the editor you’re in…

Your project, your call, but I think most novel readers would find something like this confusing. In a script, you might have two characters looking at each other in silence while the impact of a line sinks in, but in a novel you would need to say that’s what they’re doing.

Katherine

Thank you Katherine. I didn’t expect I’d have to defend what I’m actually writing, but please see Bad Things by Michael Marshall (Smith). It’s been featured on the Scrivener testimonial page for many years, and has many examples of what I’m talking about.