Monday 29 January 2018

markdown - Why would RTF files created with Pandoc be opened as plain text?


I'm experimenting with Pandoc, in particular the markdown to RTF function. When I run the converter, the resulting RTF is opened in both Word and OpenOffice as plain text (where the text looks like RTF, but isn't treated as RTF). Converting to HTML works fine.


Here is the command I used:


pandoc -f markdown -t rtf -o sample.rtf sample.txt

Here is the short sample markdown I used:


# markdown example

- uli1

_em_

__strong__

Snippet of the contents of the created file:


{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 markdown example\par}

Running on Vista 32-bit, using Pandoc 1.6 (from http://code.google.com/p/pandoc/downloads/list).


Does anyone know what the problem might be?



Answer



You just need to use the '-s' (or '--standalone') option when invoking pandoc. Otherwise pandoc produces a fragment, not a full standalone RTF file.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...