73

Here's the deal:
In school I want to write my actual content in Markdown (using [Q10] or Notepad++) in school so that I can actually focus on writing without the ugliness of Word 2000 on my screen, but I have the problem of actually converting the Markdown into the final Word document so that I can set the line spacing, margins, cover page, etc.

How can I accomplish this?

I should also mention that I'm running said programs (except Word) off of my flash drive as PortableApps, the school computers run DeepFreeze, and I do have commandline access.

  • Note that the selected answer (as of today) is not the best answer. Pandoc v1.9 and higher supports directly converting Markdown into .docx, including proper use of headings (the outline works!) and embedded images. I just tried it and it works wonderfully. – technomalogical Sep 30 '13 at 16:06
83

Get pandoc version 1.9 or higher. Then:

pandoc myfile.txt -o myfile.docx

Recent versions of pandoc allow direct conversion of markdown to word.

14

This isn't a complete answer to your situation, but you may want to investigate using Pandoc which can convert Markdown into other formats including RTF (which MS Word should be able to handle reasonably well).

Unfortunately, I have no idea if this will work with the DeepFreeze system you describe.

  • It looks like I'm stuck with writing something myself based off of Pandoc :-( – digitxp Aug 29 '10 at 13:44
11

If you already have a Markdown tool for producing HTML, open the HTML in a browser and copy/paste into Word. Alternately, just open the HTML file itself in Word then save as Word format.

7

The method that has worked best for me is to use markdown to produce HTML, upload the document to Google Docs, select the option for Google Docs to convert it to their format, then download it as a DOC file.

Using pandoc to convert to RTF works (make sure to use --standalone option), but it loses the "style* of headers in Word.

Using Google Docs, the resulting DOC file keeps the notion of style so that you can change the formatting of all h1 headers in one step.

2

There's a really handy how to for doing this on a Mac here. If you're using Notepad++ I imagine this won't apply to you, but it may help someone else :-D

2

If you work on a Mac, iA Writer now does Word (.docx) to Markdown and Markdown to Word (.docx) conversion: iAWriter.com

2

I like to use WriteMonkey, it's one of those distraction free text editors.

It exports from markdown to HTML or word. And it's portable. Requires .net though.

protected by Community Sep 23 '16 at 11:09

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.