diff options
author | 2018-04-02 15:32:16 +0200 | |
---|---|---|
committer | 2018-04-02 15:32:16 +0200 | |
commit | cb257af1e0731223a86cbf3f54affef0c0cfbb94 (patch) | |
tree | 836554e16487fb1f9f26f4e8b64a3aa15a5d1c6f /CreateDocument.sh | |
download | financials-rfp-cb257af1e0731223a86cbf3f54affef0c0cfbb94.tar.gz financials-rfp-cb257af1e0731223a86cbf3f54affef0c0cfbb94.tar.bz2 financials-rfp-cb257af1e0731223a86cbf3f54affef0c0cfbb94.zip |
init
Diffstat (limited to 'CreateDocument.sh')
-rwxr-xr-x | CreateDocument.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/CreateDocument.sh b/CreateDocument.sh new file mode 100755 index 0000000..2f4ee32 --- /dev/null +++ b/CreateDocument.sh @@ -0,0 +1,35 @@ +#!/bin/bash +CONFIG_BIBTEX=false +CONFIG_MAINFILE="main" +CONFIG_CLEANUP=true +CONFIG_CREATEDIFF=false +CONFIG_CREATE_GITVERSION=true + +if [[ ${CONFIG_CREATE_GITVERSION} = "true" ]]; then + git describe --tags | sed -e 's/_/ /g' > docversion.tmp || die +fi + +# Need to loop this to get proper references. If using bibtex this needs to +# be part of the processing as well +for i in $(seq 1 3); do + if [[ ${CONFIG_BIBTEX} = "true" && ${i} == "3" ]]; then + bibtex ${CONFIG_MAINFILE} + fi; + pdflatex ${CONFIG_MAINFILE} +done; + +if [[ ${CONFIG_CREATEDIFF} = "true" ]]; then + latexdiff ${CONFIG_MAINFILE}.tex.old ${CONFIG_MAINFILE}.tex > diff.tex + pdflatex diff.tex + pdflatex diff.tex +fi + +# Clean up +if [[ ${CONFIG_CLEANUP} = "true" ]]; then + for x in bbl aux blg log out dvi toc; do + rm -rf ${CONFIG_MAINFILE}.${x} + done; + if [[ ${CONFIG_CREATE_GITVERSION} = "true" ]]; then + rm -f docversion.tmp + fi +fi; |