This web site is not a blog, even though it's a collection of random pieces of text on different subjects. However, I prefer more structure to the pages than the continuous flow common to the blog.

This is somewhat back to the root. I have for long been looking at avoiding that common word processor that is commonly used. Early on, I used to write in LaTeX, but the necessity to be able to collaborate with colleagues using that word processor forced me into using it for many years. A few months ago I was hinted that writing in Markdown with Pandoc could be an alternative. Pandoc can generate docx-files, perfect when asking for comments from those who prefer that word processor.

Given that I already used Visual Studio Code to edit source code, writing text in VSCode comes as a natural choice. The clean interface is a lot less distractive than the W^h word processor interface. This leads to the second issue: what workflow to use for reference handling. Pandoc is fully capable of handling references in a proper manner. It support CSL style files for rendering and can import bibtex or csl json reference databases to be rendered. Thus, Zotero can be used for reference handling. Add in the Better Bibtex for Zotero extension to Zotero and the VSCode extension Citation Picker for Zotero. Once configured, citations can be inserted by pressing Option-Z (on the Mac).

Setup

The setup I use is heavily based on the workflow suggested by George Starke with a few modifications. To get up and running:

  • Install the extensions mentioned above.
  • Set up auto export of your Zotero library in Better BibTeX for Zotero as outlined here. I export my library to ~/Zotero/better-bibtex/export.json
  • Now it should be straight forward to write markdown in VSCode and then insert citations using Option-Z. (See also the section on citation formatting in the Pandoc manual)

To generate pdf and docx I use this generic Makefile, which I put in the same directory as the markdown files.

CSL_JSON=~/Zotero/better-bibtex/export.json

PDF_FILES=$(patsubst %.md,%-p.pdf, $(wildcard *.md))
DOCX_FILES=$(patsubst %.md,%-p.docx, $(wildcard *.md))

all: pdf
pdf: $(PDF_FILES)
docx: $(DOCX_FILES)

%-p.pdf: %.md
	pandoc --citeproc --bibliography $(CSL_JSON) -f markdown -t pdf -o $@ $^

%-p.docx: %.md
	pandoc --citeproc --bibliography $(CSL_JSON) -f markdown -t docx -o $@ $^

Copyright © 2025 Mikael Durling. Published June 3, 2025, updated June 4, 2025.