Substituting text formatting when compiling to text?

Is it possible to substitute formatting information (italics, bold, etc.) at compile time with text decorations? I’ve got some documents where I want to maintain formatting when producing PDFs, etc. … but when I compile to text I want to substitute formatting with something useful for that format, for example surrounding underlined text with underscores.

The closest I’ve found is using Format -> Convert -> Bold and Italics to MultiMarkdown … but that’s a permanent conversion and isn’t reversible for when I want to compile to some format that can use formatting information.

I was hoping to find something in Transformations or Replacements, but no luck (or I’m just missing it). Is the option there, but just somewhere I’m not seeing it?

Not 100% since it’s not something I personally use, but I think selecting “MultiMarkdown” in the “Compile For” selection at the bottom of the Compile menu might achieve what you’re after?

ETA: Just tested, and seems I was mistaken. Sorry!

I played with those. The multimarkdown compile options assume you’ve got a document already in multimarkdown format (i.e. used the “Bold and Italics to MultiMarkdown” menu to remove bold/italics information).

Yep, hence my ETA: :wink:

If it’s just bold and italic you’re after, you could use MMD when writing (or convert to it, since it’s after the fact), then for formats like PDF you can use the transformation option to convert Markdown to bold and italic in order to get your formatting there.

No, not just bold and italic, but also underline. I’m looking for something more flexible than MMD. Besides, an MMD source text has fewer compile output options than rich text.

Since it sounds like perhaps this doesn’t exist, maybe this can be taken as a feature request. I’d love to see something like this show up in the Transformations compile options, maybe as something that gets enabled when “Convert to plain text” is enabled (ETA: unless someone can think of a use case for this when not converting to plain text… I suppose there might be such a case).