[scripts] feat: compile luatex + main project if exists
This commit is contained in:
parent
12182ea487
commit
5689005285
@ -31,15 +31,21 @@ shebangtest()
|
|||||||
}
|
}
|
||||||
|
|
||||||
texcompile() { \
|
texcompile() { \
|
||||||
|
[ -e "main.tex" ] && base="main" && file="$base.tex"
|
||||||
|
cmd="pdflatex"
|
||||||
|
case "$(head -n 1 $file)" in
|
||||||
|
*lua*) cmd="lualatex" ;;
|
||||||
|
esac
|
||||||
bibliography="$(grep '\\bibliography' "$file")"
|
bibliography="$(grep '\\bibliography' "$file")"
|
||||||
|
|
||||||
if [ -n "$bibliography" ]; then
|
if [ -n "$bibliography" ]; then
|
||||||
pdflatex --output-directory="$dir" "$base" &&
|
$cmd --output-directory="$dir" "$base" &&
|
||||||
bibtex "$base" &&
|
bibtex "$base" &&
|
||||||
pdflatex --output-directory="$dir" "$base" &&
|
$cmd --output-directory="$dir" "$base" &&
|
||||||
pdflatex --output-directory="$dir" "$base"
|
$cmd --output-directory="$dir" "$base"
|
||||||
else
|
else
|
||||||
pdflatex --output-directory="$dir" "$base" &&
|
$cmd --output-directory="$dir" "$base" &&
|
||||||
pdflatex --output-directory="$dir" "$base"
|
$cmd --output-directory="$dir" "$base"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user