zeus
1 year ago
2 changed files with 83 additions and 0 deletions
@ -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 |
@ -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…
Reference in new issue