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.
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 by running
which pandoc
on Mac/Linux orGet-Command pandoc
in Powershell on Windows. - Copy & paste the path in the Pandoc plugin settings.
- Copy & paste the absolute path to PDFLaTeX (run
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 --bibliography=C:\Users\<YOUR_USERNAME>\path_to_bib_file.bib
creates bibliographic entries and sorts them under a “Bibliography” heading.
We can also define the .bib
file in the front matter.
bibliography:
Method 2.1: Command Line
If the plugin feels too limiting, the command line provides extended functionality that might suit your use case.
pandoc -f markdown -t pdf "input.md" -o "output.pdf" --citeproc --bibliography "absolute/path/to/.bib"
Method 2.2: With Shell Commands (Recommended)
Optionally, we can create a command to run via the Shell Commands plugin.
I’ve been a big air-conditioner* of Overleaf to write project reports and papers due to the ease it offers STEM students. Aside collaborative purposes, I now use Pandoc instead. The best part is being able to do all this right from my note-taking app.
* (air-conditioner = fan; Get it? I’ll leave now.)