Tommi Space

Academic writing with Pandoc

I am writing my thesis in Markdown, I take advantage of Zotero to store and process citations, and I use Obsidian as the main editor (exploiting the great obsidian-citation-plugin to ease the citing process).

Finally, a simple and wonderful Pandoc command compiles the whole thesis.

Pandoc

In order to correctly format all the styling, it is necessary to convert the Markdown source file to HTML first, and then convert the HTML to PDF

pandoc -s Thesis.md --wrap=none --resource-path="$PWD" --metadata-file=Thesis.yml -C -o Thesis.html &&\
pandoc -s Thesis.html --wrap=none --resource-path="$PWD" --metadata-file=Thesis.yml -C -o Thesis.tex &&\
pdflatex Thesis.tex
  • -s parses the output in one standalone file
  • --citeproc (abbreviated, -C) activates citations, references and bibliography processing
  • --resource-path specifies the path(s) where to look for resources. I cannot understand what it defaults to, so explicitly specify it as PWD
  • add --toc in the case a Table of Contents is intended to be added and a toc boolean (toc: true) is not present in YAML metadata for the document
  • add --bibliography to specify where the bibliography is located, but only if bibliography field is not present in

Parameters

Inside the front matter, different parameters could be customized, following Pandoc manual’s suggestions.

Open questions

Resources

🔎