#!/bin/sh
# bibtex -- run bibtex after linking in bibliography files.
#
# SUMMARY: this compensates for a bibtex which doesn't use TEXINPUTS
# to find the bibliography files.  Sigh.
#
# AUTHOR:	Gary T. Leavens

[ -n "$echo" ] && set -x

: ${BIBTEX='/home/miktex/miktex/bin/bibtex'}

BIBFILES=`echo *.bib`

if test "$BIBFILES" != '*.bib'
then
	# use just the bib files in this directory,
	# and ones found by TEXINPUTS, without removing them
	${BIBTEX} $@
else
	trap 'rm -f *.bib' 0
	cp $HOME/include/*.bib .
	${BIBTEX} $@
fi
