Browse Source

new makefile

master
zeus 1 year ago
parent
commit
c9d68b6cbb
  1. 46
      latex-clean
  2. 37
      latex-pdf

46
latex-clean

@ -0,0 +1,46 @@
#!/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
#rm -f *.log *.aux *.dvi *.ps *.blg *.bbl *.out *.bcf *.run.xml
find $BASEDIR -type f -name '*.log' | xargs rm -f
find $BASEDIR -type f -name '*.lof' | xargs rm -f
find $BASEDIR -type f -name '*.aux' | xargs rm -f
find $BASEDIR -type f -name '*.dvi' | xargs rm -f
find $BASEDIR -type f -name '*.ps' | xargs rm -f
find $BASEDIR -type f -name '*.blg' | xargs rm -f
find $BASEDIR -type f -name '*.bib' | xargs rm -f
find $BASEDIR -type f -name '*.bbl' | xargs rm -f
find $BASEDIR -type f -name '*.out' | xargs rm -f
find $BASEDIR -type f -name '*.bcf' | xargs rm -f
find $BASEDIR -type f -name '*.run.xml' | xargs rm -f
echo "==> change to $cwdir"
cd $cwdir
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "${s}" ]; then
usage
fi

37
latex-pdf

@ -0,0 +1,37 @@
#!/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
Loading…
Cancel
Save