diff --git a/.local/bin/compiler b/.local/bin/compiler index 4092306e..9127087d 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -18,7 +18,7 @@ cd "$dir" || exit 1 textype() { \ command="pdflatex" - texroot=$(grep -Poi "^ *% *\! *tex root *= *\w+(?:\.\w*)?" "$file" | cut -d "=" -f 2 | tr -d "[:blank:]") + 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" &&