build.sh 492 Bytes
Newer Older
Dominik Becker's avatar
Dominik Becker committed
1 2 3 4 5 6 7 8 9 10 11
#!/bin/bash

# cleanup
latexmk -C
if [ -f chapter/out.tex ]
then
    rm chapter/out.md
    rm chapter/out.tex
fi

# run pandoc
12
if [ $1 == "pandoc" ]
Dominik Becker's avatar
Dominik Becker committed
13 14
then
    cat chapter/*.md > chapter/out.md
15
    pandoc --citeproc --filter pandoc-crossref \
Dominik Becker's avatar
Dominik Becker committed
16 17 18 19 20 21 22 23 24 25
        -M cref=true --top-level-division=chapter \
        --bibliography library/library.bib --biblatex \
        -o chapter/out.tex chapter/out.md
fi

# run latex build
if [ $1 != "clean" ]
then
    latexmk -latexoption="-shell-escape" main.tex
fi