#!/bin/sh # # This is mathfig, Copyright 1992 Silvio Levy # $Header: /a/tampa/h/tampa_a/fac/levy/texts/geombook/RCS/mathfig,v 1.1 92/07/17 13:27:38 levy Exp $ # umask 002 # The following lines give the locations of the auxiliary scripts # geomfix and mathlabels. geomfix=geomfix mathlabels=mathlabels init="" if test $# -eq 0 then echo "Usage: $0 [-d directory] [-i initfile] filenames"; exit; fi while test "$1" = "-d" || test "$1" = "-i" do if test $# -lt 3 then echo "Usage: $0 [-d directory] [-i initfile] filenames"; exit; fi case "$1" in "-d") if test -d "$2" && test -w "$2" && test -r "$2" then cd "$2"; shift; shift ; else echo "Directory $2 not found or permissions wrong"; exit; fi;; "-i") init="$2"; shift; shift;; esac done for i in "$@" do pref=`echo $i | sed 's/\.m$//'` /bin/rm -f $pref.ps $pref.lab math << EOF (\$Def[x_?NumberQ,_] := ToString[x]; \$Def[__,default_] := default; If["$init"!="",Print["Reading $init..."]; Get["$init"]]; Print["Reading $pref.m..."]; picture=Get["$pref.m"]; Display[StringJoin[ "! $geomfix -width ", \$Def[\$width,"5"], " -height ", \$Def[\$height,"2"], " -lmarg 0 -rmarg 0 -tmarg 0 -bmarg 0 ", "| $mathlabels $pref.lab ", \$Def[\$xlo,"OK"], " ", \$Def[\$xhi,"OK"], " ", \$Def[\$ylo,"OK"], " ", \$Def[\$yhi,"OK"], "> $pref.ps"], picture]) EOF done