#!/usr/bin/env bash set -euo pipefail # reference doc: # pandoc --print-default-data-file reference.docx > pandoc_reference.docx infile="$1" outfile="$2" tmpfile="$(mktemp --suffix=.tex)" python3 preprocess_tex_for_word.py "$infile" "$tmpfile" pandoc "$tmpfile" \ --reference-doc=pandoc_reference.docx \ --lua-filter resolve_equation_labels.lua \ -F pandoc-crossref \ -M autoEqnLabels \ -M tableEqns \ --citeproc \ --bibliography=Ref.bib \ -o "$outfile" rm -f "$tmpfile"