MultiMarkdown to RTF

Just tried to compile with the option MultiMarkdown to RTF. As result, I get a RTF document with black font color and black background color.

Opening the document in a Textmate shows the problem:
{*\background {\shp{*\shpinst\shpleft0\shptop0\shpright0\shpbottom0\shpfhdr0\shpbxmargin\shpbymargin\shpwr0\shpwrk0\shpfblwtxt1\shpz0\shplid1025{\sp{\sn shapeType}{\sv 1}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fillColor}{\sv 0}}{\sp{\sn fFilled}{\sv 1}}{\sp{\sn lineWidth}{\sv 0}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn bWMode}{\sv 9}}{\sp{\sn fBackground}{\sv 1}}}}}

Is there any way to remove this from the Markdown template? Witch file must I edit?

Thanks for help.

Unfortunately, this is not a bug in MMD—it’s in Apple’s textutil installation.

Try making a simple HTML file, and then running textutil -convert rtf -output black.rtf test.html


Every time you open one of these the first time, you have to open the font panel and set the paper colour back to white.

Thanks for pointing this out. An thanks for the hint. textutil seems to be very useful for other tasks, too :slight_smile:

I started using MMD some weeks ago and also encountered that bug. To avoid changing the paper to white everytime, you can add this metadata to your documents:

XHTML Header: <body bgcolor="white">

It bypasses the bug by hard coding the background color.

I hope this helps!

Thanks for the tip cksk! However I’d make the following suggestion to clean that up a bit. The XHTML Header field actually inserts that stuff in the head area of the HTML. Inserting a second body element in there would violate the HTML specs, potentially producing glitches in some of the XSLTs. You can achieve the same effect (I’ve just tested it), by inserted a completely valid style override:

XHTML Header: <style type="text/css" media="screen">body { background-color: #fff; }</style>

Given the limitations of the traditional MultiMarkdown-to-RTF route, it might be a good idea to check out Pandoc. It works with Markdown only (not MMD), but it has built-in support for footnotes, which is a big plus.

latex2rtf is yet another option, if you’re comfortable with with the extra step of converting to LaTeX first. IIRC, latex2rtf has also support for styles and numbered sections, which might be handy.

Ah, that’s better, Ioa! I did notice that I was creating a body tag inside the header but, since it worked and I needed to send that rtf fast, I just thought “what the heck”. But it’s nice to do it properly.