I’ve written in the past about my love for Markdown, especially in its relation to scholarly work. Some people have written whole books with plain text, and my dissertation is being written entirely in Markdown. But I often need the plain text converted to, well, a more commonly-used file format. My system ties together Markdown and Pandoc for converting plain text into PDF or .docx for distribution.
But I wanted a faster way to convert these files without having to remember the Pandoc string I wanted for controlling the layout, bibliography style, and output location. So, I wrote a bash script to output the files for me. The script takes in the file ($ ./pub.sh chapter.md), uses the template, bibliography, and bibliographic style I’d like for the document, and outputs the generated files in both PDF and .docx.