#!/bin/bash
file=$1
extra=""
shift

if [ -e listings-setup.tex ]; then
        extra=" --listings -H listings-setup.tex "
fi
if [ -e custom-reference.docx ]; then
        extra="$extra  --reference-docx=custom-reference.docx "
fi

pandoc --toc "${file}" -o "${file%.*}.docx" --number-sections --variable urlcolor=cyan ${extra} $@
