[scripts] feat: compile luatex + main project if exists
This commit is contained in:
parent
12182ea487
commit
5689005285
@ -31,15 +31,21 @@ shebangtest()
|
||||
}
|
||||
|
||||
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")"
|
||||
|
||||
if [ -n "$bibliography" ]; then
|
||||
pdflatex --output-directory="$dir" "$base" &&
|
||||
$cmd --output-directory="$dir" "$base" &&
|
||||
bibtex "$base" &&
|
||||
pdflatex --output-directory="$dir" "$base" &&
|
||||
pdflatex --output-directory="$dir" "$base"
|
||||
$cmd --output-directory="$dir" "$base" &&
|
||||
$cmd --output-directory="$dir" "$base"
|
||||
else
|
||||
pdflatex --output-directory="$dir" "$base" &&
|
||||
pdflatex --output-directory="$dir" "$base"
|
||||
$cmd --output-directory="$dir" "$base" &&
|
||||
$cmd --output-directory="$dir" "$base"
|
||||
fi
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user