summaryrefslogtreecommitdiffstats
path: root/.local/bin/compiler
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/compiler')
-rwxr-xr-x.local/bin/compiler14
1 files changed, 8 insertions, 6 deletions
diff --git a/.local/bin/compiler b/.local/bin/compiler
index 67992be..6e28cd0 100755
--- a/.local/bin/compiler
+++ b/.local/bin/compiler
@@ -17,13 +17,15 @@ ext="${file##*.}"
cd "$dir" || exit 1
textype() { \
+ textarget="$(getcomproot "$file" || echo "$file")"
+ echo "$textarget"
command="pdflatex"
- ( 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