From d1a5ce9a4540262f1e266be1213af06cd636d10c Mon Sep 17 00:00:00 2001 From: Marius Hofmann Date: Fri, 9 Mar 2018 22:08:10 +0100 Subject: [PATCH] Add option to delete compile helper files - build_all.sh now asks you, if you want to delete the helper files (.aux, .log, etc) after compiling is done --- build_all.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/build_all.sh b/build_all.sh index 2fcac3b..31ef11c 100755 --- a/build_all.sh +++ b/build_all.sh @@ -1,5 +1,6 @@ #!/bin/bash +#compile all tex files except settings mkdir -p output find ./* -maxdepth 1 -mindepth 1 -type f -name "*.tex" \ -not -name "settings.tex" \ @@ -7,3 +8,15 @@ find ./* -maxdepth 1 -mindepth 1 -type f -name "*.tex" \ -not -name "klausuren-Settings-utf8.tex" \ -print0 | \ xargs -0 -P 4 -I [] bash -c 'cd "$(dirname "[]")"; latexmk -pdf -outdir=../output "$(basename "[]")";' + +echo "finished compiling" +#cleanup compile help files +read -p "Delete complile helping files (aux, log, ...)?" -n 1 -r + +if [[ $REPLY =~ ^[Yy]$ ]]; then + extensions="acn acr alg aux bbl bcf blg -blx.bib dvi fdb_latexmk fls glg glo gls idx ilg ind ist lof log lot maf mtc mtc0 nav nlo out pdfsync ps snm synctex.gz toc vrb xdy tdo .DS_Store" + + for ext in $extensions; do + find ./output -maxdepth 1 -mindepth 1 -type f -name "*.$ext" -delete + done +fi