You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
681 B

12 months ago
#!/bin/bash
usage() { echo "Usage: $0 [-f file]" 1>&2; exit 1; }
LATEX=xelatex
#$(LATEX) $(FILE_NAME)
#clean:
# @rm -f *.log *.aux *.dvi *.ps *.blg *.bbl *.out *.bcf *.run.xml
while getopts ":f:" o; do
case "${o}" in
f)
cwdir=$PWD
s=${OPTARG}
BASEDIR=$(dirname "$s")
BASENAME=$(basename "$s")
#echo $BASEDIR
#echo $BASENAME
echo "==> change to $BASEDIR"
cd $BASEDIR
$LATEX $BASENAME
makeglossaries $BASENAME
$LATEX $BASENAME
echo "==> change to $cwdir"
cd $cwdir
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "${s}" ]; then
usage
fi