#!/bin/sh # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # fig2eps version 0.2 : produce postscript files from fig sources # # Copyright (C) 2006 Glad Deschrijver, Wed Apr 12 2006, Fri Nov 24 2006 # # # # This program is free software; you can redistribute it and/or # # modify it under the terms of the GNU General Public License # # as published by the Free Software Foundation; either version 2 # # of the License, or (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # # USA. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 0.2 : - test whether pstex2eps is in the PATH # - added pstex2eps options to the usage of this script # - removed small bug progname=`echo "$0" | sed -e 's/[^\/]*\///g'` version=0.2 copyright="Copyright (C) 2006 Glad Deschrijver" args="" usage() { cat << EOF Usage: $progname [OPTIONS] file[.fig] You need pstex2eps in order to run this script. Options: -h, --help display this help and exit -v, --version output version information and exit All other options are passed to pstex2eps. pstex2eps options: [defaults in brackets after descriptions] EOF pstex2eps --help | head --lines=-2 | sed -n '4,${p}' # print all lines starting from the 4th line } if test -z "`which pstex2eps`" then echo "The script pstex2eps is not found in your PATH. Exiting." exit 1 fi while test x"$1" != x do case $1 in -h|--help) usage; exit 0;; -v|--version) echo "$progname $version" echo "$copyright" echo "This program comes with ABSOLUTELY NO WARRANTY. This is free" echo "software, and you are welcome to redistribute it under" echo "the terms of the GNU General Public License." exit 0 ;; -*) args="$args $1"; shift;; *) file=$1; shift;; esac done filebase=`echo $file | sed -e "s/\.fig//" -e "s/\.FIG//"` fig2dev -L pstex $file > $filebase.pstex fig2dev -L pstex_t -F -p $filebase.pstex $file > $filebase.pstex_t pstex2eps $filebase $args