1
0
Fork 0

get tex root when compiling latex docs

This commit is contained in:
Luca Bilke 2022-08-10 17:02:00 +02:00
parent 6d825b3148
commit fd3d9a6127

View file

@ -18,6 +18,8 @@ cd "$dir" || exit 1
textype() { \
command="pdflatex"
texroot=$(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" &&