96

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.

1
  • 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. Sep 30, 2013 at 16:06

6 Answers 6

112

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.

0
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.

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

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.

2
  • and if it is a github markdown, then directly view and copy-paste.. very simple :-) Sep 1, 2022 at 6:12
  • Yes, you can copy from a github page and paste into word. The minor downside is that Word doesn't use named styles (like "heading 1") for markdown headers, it just makes the font bigger. Sep 6, 2022 at 21:11
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.

3

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

3

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .