Writing workflow: Pandoc scripts


tl;dr I uploaded my Pandoc workflow to GitHub, feel free to use it

Having an unobtrusive workflow is important.

There are things about writing that just take too much time when done by hand. Text formatting and file converting are two that I especially hate. People expect different things. Some want .docx, others .tex or .pdfs, all complying with a set of strict formatting rules. Often enough a faithful conversion of .odt to .docx means spending hours on fiddling with margins, fonts, and other details. And do not get me started on ‘We want .tex files!’.

I think that writing itself should be separated from such mundane worries. While I absolutely love a good-looking document, if you have something to write, then write it and do not worry about the looks. Write in Notepad, in .txt, in Word, in TeX, whatever. Worry about the final format and aesthetics later.

Pandoc is a command-line universal document converter. Html, .epub, LaTeX, Markdown, .rtf, .doc, anything can be converted to anything. You just need to set some rules.

I uploaded my Pandoc scripts on GitHub. I use Scrivener for most of my writing, but I believe in writing in plain text. So i export my Scrivener projects to Markdown. I set up the script to accept .md file and a .bib file. As most of the times I need a .pdf with a .docx or .tex reference, Pandoc converts .md accordingly.

Example, a draft-looking PDF: /images/pandoc/pandoc1.png

A little bit better looking PDF: /images/pandoc/pandoc2.png

The .md file just needs to have a title field in the YAML metadata.

The script is dead simple on purpose, so that anyone with 101 in BASH can understand it and tweak it. It uses free fonts: (Lato and STIX), as well as apa and spbasic csl/bst files.

If you do not use .bib for your bibliography, Mendeley and other apps have export to bibtex option. In Mendeley you can make it so that every time you add a record to your library, a .bib file is automatically updated. Symlink that file to Pandoc script’s directory and you are good to go.

I know there are more academic-oriented Pandoc templates (pandoc-scholar), Pandoc automation tools (pandocomatic), and even Scrivener Ruby script for compiling for pandocomatic (scrivomatic). While these are great, they are too robust for my needs.