klausuren-allgemein/build_all.sh
Marius Hofmann d1a5ce9a45 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
2018-03-09 22:08:10 +01:00

23 lines
839 B
Bash
Executable File

#!/bin/bash
#compile all tex files except settings
mkdir -p output
find ./* -maxdepth 1 -mindepth 1 -type f -name "*.tex" \
-not -name "settings.tex" \
-not -name "SSxx Klausurvorlage.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