#!/bin/bash
#
# script to generate combined LaTeX, EPS from gnuplot input
#
if [ -z "$2" ]
then
    echo "usage `basename $0` infile outfile"
    exit 1
fi
if [ ! -r "$1" ]
then
    echo "$1" not found
    exit 2
fi

infile="$1"
outfile="$2"
tmpfile=tmp-$$
echo "set terminal epslatex color clip" >> $tmpfile
echo "set output \"$outfile\"" >> $tmpfile
cat $infile >> $tmpfile
gnuplot $tmpfile
rm -v $tmpfile

