Skip to content

Pandoc

Pandoc is a a free and open-source software (FOSS) for converting text between a range of different markup and file formats. Pandoc is a Haskell library which is also accessible as a standalone command-line tool. It is typically used to support academic writing and publishing workflows.

Personal Experience

My use for Pandoc has primarily been for the conversion of markdown documents in Obsidian or GitHub to Microsoft Word (.docx) files for wider circulation. While Pandoc preserves the structural elements of a text document it does not preserve advanced formatting. As such the converted document may require additional formatting. For our purposes the following formats are most relevant:

Tools & Software Integrations

Pandoc converts from and to a wide range of text formats outlined in the Pandoc Documentation.

N/A

Resources

Notes and Troubleshooting

Creating a PDF

To produce a PDF, specify an output file with a .pdf extension:

pandoc <INPUT FILENAME>.<EXT> -o <OUTPUT FILENAME>.pdf

Source: https://pandoc.org/MANUAL.html#creating-a-pdf

Convert Markdown into a Word Document

  • Save your Markdown document as filename.md to the desktop.
  • Open the command line terminal.
  • Enter cd Desktop to navigate to the Desktop.
  • Enter the following code:
pandoc <INPUT FILENAME>.md -f markdown -t docx -o <OUTPUT FILENAME>.docx

Source: https://mrjoe.uk/convert-markdown-to-word-document/

### Convert a Word Document into Markdown - Save your word document to the desktop. - Open the command line terminal. - Enter cd Desktop to navigate to the Desktop. - Enter the following code:

pandoc <INPUT FILENAME>.docx --wrap=none -f docx -t markdown -o <OUTPUT FILENAME>.md

NOTE: The --wrap=none flag prevents pandoc outputting the docx file with default line lengths of 80 characters.

Source: https://blog.atwork.at/post/Convert-documents-with-Pandoc