mirror of
https://github.com/tiyn/dotfiles.git
synced 2026-07-18 11:41:36 +02:00
Nvim: Updated knap to use working dynamic engine selection
This commit is contained in:
29
.local/bin/etc/nvim/compiler
Executable file → Normal file
29
.local/bin/etc/nvim/compiler
Executable file → Normal file
@@ -27,13 +27,28 @@ has_python_version() {
|
||||
|
||||
textype() {
|
||||
command="pdflatex --shell-escape"
|
||||
(sed 5q "$file" | grep -i -q 'xelatex') && command="xelatex"
|
||||
$command --output-directory="$dir" "$base" &&
|
||||
grep -i addbibresource "$file" >/dev/null &&
|
||||
biber --input-directory "$dir" "$base" &&
|
||||
$command --output-directory="$dir" "$base" &&
|
||||
makeglossaries "$basenodir" &&
|
||||
$command --output-directory="$dir" "$base"
|
||||
# Detect XeLaTeX from the first 15 lines. Supported forms include:
|
||||
# % !TeX program = xelatex
|
||||
# % xelatex
|
||||
# and packages which require or commonly imply XeLaTeX.
|
||||
if sed -n '1,15p' "$file" | grep -Eiq \
|
||||
'(^%+[[:space:]]*!tex[[:space:]]+program[[:space:]]*=[[:space:]]*xelatex)|(^%+[[:space:]]*xelatex[[:space:]]*$)|(\\usepackage[^}]*\{(fontspec|unicode-math|mathspec)\})'; then
|
||||
command="xelatex"
|
||||
fi
|
||||
|
||||
$command --output-directory="$dir" "$base" || return 1
|
||||
|
||||
if grep -iq '\\addbibresource' "$file"; then
|
||||
biber --input-directory "$dir" "$base" || return 1
|
||||
$command --output-directory="$dir" "$base" || return 1
|
||||
fi
|
||||
|
||||
if grep -iq '\\makeglossaries' "$file"; then
|
||||
makeglossaries "$basenodir" || return 1
|
||||
$command --output-directory="$dir" "$base" || return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
case "$file" in
|
||||
|
||||
Reference in New Issue
Block a user