1
0
Fork 0

reformat compiler script

This commit is contained in:
Luca Bilke 2023-02-06 14:17:17 +01:00
parent 2c4c52e72e
commit c67723cd24
1 changed files with 3 additions and 3 deletions

View File

@ -17,8 +17,8 @@ cd "$dir" || exit 1
textype() { \
command="pdflatex"
texroot=$(readlink -f "$(grep -Poi "^ *% *\! *tex root *= *\w+(?:\.\w*)?" "$file" | cut -d "=" -f 2 | tr -d "[:blank:]")")
[ -n "$texroot" ] && base=$texroot && echo "Compiling from TeX root: $texroot"
texroot=$(readlink -f "$(grep -Poi "^ *% *\! *tex root *= *\w+(?:\.\w*)?" "$file" | cut -d "=" -f 2 | tr -d "[:blank:]")")
[ -n "$texroot" ] && base=$texroot && echo "Compiling from TeX root: $texroot"
( head -n5 "$file" | grep -qi 'xelatex' ) && command="xelatex"
$command --output-directory="$dir" "$base" &&
grep -qi addbibresource "$file" &&
@ -36,7 +36,7 @@ case "$ext" in
go) go run "$file" ;;
h) sudo make install ;;
# findup is a script available here: https://unix.stackexchange.com/a/35265
java) loc=$(findup . -name gradlew); [ "$loc":w != "" ] && exec "$loc" run -q -p "$(dirname $loc)" ;;
java) loc=$(findup . -name gradlew); [ "$loc":w != "" ] && exec "$loc" run -q -p "$(dirname $loc)" ;;
m) octave "$file" ;;
md) if [ -x "$(command -v lowdown)" ]; then
lowdown --parse-no-intraemph "$file" -Tms | groff -mpdfmark -ms -kept > "$base".pdf