summaryrefslogtreecommitdiffstats
path: root/.local/bin/compiler
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2022-08-19 14:40:25 -0400
committerLuke Smith <luke@lukesmith.xyz>2022-08-19 14:40:25 -0400
commitb82b091d96447860decae6d8495d036b4abddaa0 (patch)
treeb7569c69c92859ad7c5ef455222dfd2f88ae9eb8 /.local/bin/compiler
parent1a37b0bc99d71899ea243448a315e611b51bea2e (diff)
downloadeibhear-b82b091d96447860decae6d8495d036b4abddaa0.tar.gz
eibhear-b82b091d96447860decae6d8495d036b4abddaa0.tar.zst
eibhear-b82b091d96447860decae6d8495d036b4abddaa0.zip
separate script for use in opout, use just % root=
Diffstat (limited to '.local/bin/compiler')
-rwxr-xr-x.local/bin/compiler16
1 files changed, 8 insertions, 8 deletions
diff --git a/.local/bin/compiler b/.local/bin/compiler
index 85a0c58..6e28cd0 100755
--- a/.local/bin/compiler
+++ b/.local/bin/compiler
@@ -17,15 +17,15 @@ ext="${file##*.}"
cd "$dir" || exit 1
textype() { \
+ textarget="$(getcomproot "$file" || echo "$file")"
+ echo "$textarget"
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" &&
- biber --input-directory "$dir" "$base" &&
- $command --output-directory="$dir" "$base" &&
- $command --output-directory="$dir" "$base"
+ ( head -n5 "$textarget" | grep -qi 'xelatex' ) && command="xelatex"
+ $command --output-directory="${textarget%/*}" "${textarget%.*}"
+ grep -qi addbibresource "$textarget" &&
+ biber --input-directory "${textarget%/*}" "${textarget%.*}" &&
+ $command --output-directory="${textarget%/*}" "${textarget%.*}" &&
+ $command --output-directory="${textarget%/*}" "${textarget%.*}"
}
case "$ext" in