Refine pandoc build workflow using build script
We should unify the build workflow in CI and VS Code using a build script to make it more consistent. Most importantly, when going the markdown way, we need to concatenate files beforehand for pandoc-crossref
to work correctly (cross references across multiple files cause issues). When generating a temporary concatenate, we need to add that to .gitignore
.
Build Script
#!/bin/bash
# cleanup
latexmk -C
if [ -f chapter/out.tex ]
then
rm chapter/out.md
rm chapter/out.tex
fi
# run pandoc
if [ $1 == "pandoc" ]
then
cat chapter/*.md > chapter/out.md
pandoc --filter pandoc-citeproc --filter pandoc-crossref \
-M cref=true --top-level-division=chapter \
--bibliography library/library.bib --biblatex \
-o chapter/out.tex chapter/out.md
fi
# run latex build
latexmk -latexoption="-shell-escape" main.tex
Edited by Dominik Becker