32 lines
712 B
Plaintext
32 lines
712 B
Plaintext
|
#!/bin/zsh
|
||
|
DEPENDENCIES+=()
|
||
|
REQUIRED_ENV+=()
|
||
|
|
||
|
use office/latex
|
||
|
|
||
|
CHECK_ENVIRONMENT
|
||
|
#####################################################################
|
||
|
|
||
|
PDFLATEX() {
|
||
|
[ ! $1 ] && FAIL 1 'must provide filename'
|
||
|
local FILENAME=$(LATEX__GET_MAIN_FILENAME "$1")
|
||
|
|
||
|
local ARGS=(-interaction=nonstopmode)
|
||
|
ARGS+=("$FILENAME")
|
||
|
|
||
|
cd "$(dirname $FILENAME)"
|
||
|
|
||
|
STATUS 'running compile (1/2)'
|
||
|
pdflatex ${ARGS[@]} \
|
||
|
|| FAIL 2 'first compile failed (see above)'
|
||
|
|
||
|
STATUS 'running compile (2/2)'
|
||
|
pdflatex ${ARGS[@]} >/dev/null 2>&1 \
|
||
|
|| FAIL 3 'second compile failed :c'
|
||
|
|
||
|
SUCCESS "created '$(echo $FILENAME | sed 's/\.[^.]*$/.pdf/')'"
|
||
|
}
|
||
|
|
||
|
#####################################################################
|
||
|
PDFLATEX $@
|