#! /bin/sh # # Mathematica source file # # Copyright 1986 through 1993 by Wolfram Research Inc. # # $Id: psfix,v 1.10.2.1 1993/03/26 22:29:28 rory Exp $ # # This shell file reads stdin (or any list of files) and adds the # PostScript macros that Mathematica output assumes. It uses a # default type size of 10 points, an 8.5 by 11 inch page and 1/2 inch # margins. The fonts used are specified from Mathematica. The # default font is Courier 10. Other fonts can be introduced with # a change to $DefaultFont, assigning the DefaultFont option for # or by using the FontForm directive. # # Usage is: # psfix [-lmarg l] [-rmarg r] [-bmarg b] [-tmarg r] # [-land] [-stretch] [-width w] -height h] # [-epsf] [-stringfix] [-dump] [file ...] # where the -land option causes the plot to be done in landscape mode # (i.e., the x-axis runs along the 11 inch side of the page). # Note, the sed is simply to strip off comments to save time and # space. # Defaults: lmarg=1.0 # default left margin: 1.0 inches rmarg=1.0 # default right margin: 1.0 inches bmarg=1.0 # default bottom margin: 1.0 inches tmarg=1.0 # default top margin: 1.0 inches transform='' # default transformation: identity nodistort=true # default no-stretching: no fixwid=true # default fixwid compensation fixdash=false # default fixdash compensation landg=false # landscape flag epsfg=true # default for epsf generation news=true while :; do case $# in 0) break 1 ;; esac case "$1" in -lmarg) shift lmarg=$1 shift ;; -rmarg) shift rmarg=$1 shift ;; -bmarg) shift bmarg=$1 shift ;; -tmarg) shift tmarg=$1 shift ;; -width) shift width=$1 shift ;; -height) shift height=$1 shift ;; -land) landg=true transform="90 rotate 0 Mheight neg translate" shift ;; -stretch) nodistort=false shift ;; -stringfix) fixwid=false shift ;; -dashfix) fixdash=false shift ;; -epsf) epsfg=true shift ;; -news) news=true shift ;; -dump) dump=true shift ;; -*) echo \ 'Usage: psfix [-lmarg inches] [-rmarg inches] [-bmarg inches] [-tmarg inches] [-land] [-stretch] [-width inches] [-height inches] [-epsf] [-dump] [-stringfix] [-dashfix] [file...]' \ >&2 exit 1 ;; *) break 1 ;; esac done # Default values for height and width if [ ".$epsfg" = ".true" ] ; then lmarg=0 rmarg=0 bmarg=0 tmarg=0 if [ ".$height" = "." ] ; then height=4 fi if [ ".$width" = "." ] ; then width=4 fi else if [ ".$height" = "." ] ; then if [ ".$landg" = ".false" ] ; then height=11 else height=8.5 fi fi if [ ".$width" = "." ] ; then if [ ".$landg" = ".false" ] ; then width=8.5 else width=11 fi fi fi # Compute bounding box #( #bc -l <