-
Notifications
You must be signed in to change notification settings - Fork 2
/
lualatexmk.engine
executable file
·29 lines (25 loc) · 988 Bytes
/
lualatexmk.engine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/zsh
# create a zsh argument list from $2
xargarray=( ${(z)2} )
for ((i=1; i <= $#xargarray; i++ )); do xargarray[$i]=${(Q)xargarray[$i]}; done;
# for TeXShop 4.66+ only
export TSBIN="$HOME/Library/TeXShop/bin/tslatexmk"
#export LTMKBIN="$HOME/Library/TeXShop/bin/tslatexmk"
whereisit="`which latexmk`"
if [ "${whereisit}" != "latexmk not found" ] ; then
export LTMKBIN="`dirname ${whereisit}`"
else
echo "sorry latexmk not found: using internal default"
export LTMKBIN="${HOME}/Library/TeXShop/bin/tslatexmk"
fi
export LTMKEDIT="$HOME/Library/TeXShop/bin"
# make sure latexmkrcedit exists in bin
if [ ! -e "${LTMKEDIT}/latexmkrcedit" ] ; then
cp "${TSBIN}/latexmkrcDONTedit" "${LTMKEDIT}/latexmkrcedit"
fi
# Use local rc file platexmkrc if it exists. p = project. zsh version
export localrc=""
if [ -e ./platexmkrc ] ; then
export localrc=( -r ./platexmkrc )
fi
"${LTMKBIN}"/latexmk -pdf -r "${LTMKEDIT}/latexmkrcedit" ${xargarray} -r "${TSBIN}/lualatexmkrc" ${localrc} "$1"