Skip to main content
  1. Blog/

Writing Manuscripts with Pandoc

·356 words·2 mins

What is Pandoc
#

Pandoc is a FREE universal document converter that supports various file formats including Markdown, LaTeX, Docx, HTML, etc.

Why Pandoc?

Pandoc works seamlessly with markdown files, converting them to a desired format—HTML, Docx, or PDF. We can leverage that with Obsidian’s enhanced functionality to plan, write, and edit manuscripts.

Obsidian is a markdown editor with built-in LaTeX functionality, users would have fewer issues with Pandoc’s extended markdown syntax.

Check out Pandoc’s markdown for a more detailed guide.

Using Pandoc in Obsidian
#

Prerequisites

  • Install Pandoc and a TeX distribution (needed to install pdflatex) on your machine. (I recommend MikTeX for Windows users.)
  • Install pdflatex in MikTeX

Method 1: Pandoc Plugin
#

  • Install the Pandoc plugin in Obsidian (available in community plugins).
  • Find the absolute path to Pandoc (run which pandoc on Mac/Linux or Get-Command pandoc in Powershell on Windows).
  • Copy & paste the path in the Pandoc plugin settings.
  • Copy & paste the absolute path to PDFLaTeX (which pdflatex on Mac/Linux; Get-Command pdflatex on Windows).
  • Copy & paste the absolute path to your export folder (for example: C:\Users\<YOUR_USERNAME>\Documents).

Pandoc offers a wide range of commands and functionalities. In the extra arguments section, adding --citeproc and (optionally) --bibliography=C:\Users\<YOUR_USERNAME>\path_to_bib_file.bib creates and sorts bibliographic entries under a Bibliography heading.

You can also define the .bib file in the front matter.

bibliography: 

I recommend you place the file in the root of your Obsidian vault.

Method 2: Command Line
#

The command line provides extended functionality that appeals to power users.

pandoc -f markdown -t pdf "input.md" -o "output.pdf" --citeproc --bibliography "absolute/path/to/.bib"

Method 2.1: With Shell Commands (Recommended)#

Optionally, you can create a shell command with the Shell Commands plugin. You can do some pretty cool things with this one.

obsidian-pandoc_image_1

Closing Thoughts
#

I have been a big air-conditioner* of LaTeX (Overleaf) to write project reports and papers due to the ease it offers STEM students. Now, I use Overleaf less—aside from collaborative purposes—as Pandoc addresses my personal use cases. The best part is, I get to do all of this in my note-taking app! Speechless!

* (air-conditioner = fan; Get it? I’ll leave now.)