Markdown / Word

To move documents between Markdown / Word and LaTeX, the workhorse is pandoc — a universal converter. For Word specifically there are also dedicated tools. This page covers pandoc and the Word↔LaTeX options.

Markdown ↔ LaTeX — pandoc

pandoc (by John MacFarlane) converts between Markdown, LaTeX, HTML, docx, and more. Pick formats with -f (--from) and -t (--to): pandoc -f markdown -t latex in.md -o out.tex. It can also go straight to PDF through a LaTeX engine — --pdf-engine=lualatex. Customize the LaTeX output with --template, and transform the document with Lua filters (rewriting the AST). Pandoc’s Markdown supports LaTeX math, citations (--citeproc + .bib), and cross-references.

terminal
pandoc -f markdown -t latex in.md -o out.tex   # Markdown → LaTeX
pandoc in.md -o out.pdf --pdf-engine=lualatex  # Markdown → PDF

Word ↔ LaTeX

pandoc also handles .docxpandoc in.docx -o out.tex (Word → LaTeX/Markdown import) and pandoc in.tex -o out.docx (LaTeX → Word export, styled via --reference-doc). The easiest free route. writer2latex converts LibreOffice/OpenOffice documents (and thus Word via LibreOffice) to LaTeX — open source. oolatex (a tex4ht command) goes the other way: LaTeX → ODT, which LibreOffice can save as .docx. GrindEQ is a paid Word↔LaTeX converter, notably strong at MathType equations.

terminal
pandoc in.docx -o out.tex    # Word → LaTeX
pandoc in.tex  -o out.docx   # LaTeX → Word(--reference-doc で体裁)

A practical caveat

Round-tripping is lossy — complex layout, custom macros, and intricate math rarely survive perfectly. Use Markdown/pandoc as the clean interchange when you can, expect to fix up the output, and keep the LaTeX source as the source of truth.