MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

Postscript with Mathematica 3.0

  • To: mathgroup at smc.vnet.net
  • Subject: [mg6782] Postscript with Mathematica 3.0
  • From: weber at be4at18.iam.uni-bonn.de (Matthias Weber)
  • Date: Fri, 18 Apr 1997 02:37:55 -0400 (EDT)
  • Organization: RHRZ - University of Bonn (Germany)
  • Sender: owner-wri-mathgroup at wolfram.com


I have (like others) some troubles using Mathematica's 3.0
EPS export feature: the resulting files do not print and
are not viewable properly.

I compared the ps files with the corresponding files produced by
Mathematica 2.2 and found a couple of differences. 

Changing two of them in the new ps files resulted in printable files.

Because this might be of interest to others, I describe the process
of changing a Mathematica 3.0 ps file so that it becomes printable
on OUR system. I do not promis any applicability of that recipe
on any machine whatsoever, and I am not responsible for any kind of damage
this might cause under any circumstances. Etc.

My own configuration is a Macintosh PowerPC, and I usually print the files
under unix on an Iris. I am not willing to solve any more postscript problems,
requests should be sent to Wolfram.


Here is the recipe:

Select a graphic under Mathematica 3.0, and save it using Edit/Save Selection as EPS.

Choose your favourite editor to edit the file.
This is a text file. It consists logically of two sections, one
containing a rather long general preamble, the other the essential
data of the graphic you have exported.
At about line 20, there is a postscript statement as follows:

/MathPictureStart {
	/Mimatrix
	 matrix currentmatrix
	def
	gsave
	newpath
	Mleft
	Mbottom
	translate
	/Mtmatrix
	matrix currentmatrix
	def
	Plain
	Mfontsize scalefont
	setfont
	0 setgray
	0 setlinewidth
} bind def


You have to insert a line here after 'translate', so that it becomes:

/MathPictureStart {
	/Mimatrix
	 matrix currentmatrix
	def
	gsave
	newpath
	Mleft
	Mbottom
	translate
	1 -1 scale
	/Mtmatrix
	matrix currentmatrix
	def
	Plain
	Mfontsize scalefont
	setfont
	0 setgray
	0 setlinewidth
} bind def

Now you have to find the end of this section. This is most easily done
by searching for the second Mathematica (!?) in your file. 
You should arrive at a line saying

%%Creator: Mathematica

Above this line, you can read (if you want to)

/Mnodistort true def
/colorimage where
{ pop /Mcolorimage {colorimage} bind def /Mimage {image} bind def}
{
/colorimage {Mcolorimage} bind def
} ifelse
1.000000 1.000000 scale
0.000000 288.000000 translate
1.000000 -1.000000 scale
-0.000000 -0.000000 translate
/Mleft		0.000000 def
/Mbottom	0.000000 def
/Mwidth		288.000000 def
/Mheight	288.000000 def
0 setgray
0 setlinewidth
/Courier findfont 12 scalefont setfont
/Mfontsize 12 def
/Plain /Courier findfont def
0 Mbottom Mheight neg add 2 mul Mheight add translate
1 -1 scale
%!

Replace all this by

/Mnodistort true def
/colorimage {Mcolorimage} bind def
/image {Mimage} bind def
/Mleft		0.000000 def
/Mbottom	282.000000 def
/Mwidth		282.000000 def
/Mheight	282.000000 def
/Mfontsize 12 def
/Plain /Courier findfont def
0 Mbottom Mheight neg add 2 mul Mheight add translate
1 -1 scale
%!


That's it. I guess the second surgery can be simplified by some
addition of another 1 -1 scale statement, but I don't know postscript.

I have also noo clue whether this is a bug in Mathematica 3.0 or
an incompatibility of some sort. In any case it wasn't too much fun.

Is there any homepage listing the (known...) bugs in Mma 3.0?


Good luck,

Matthias Weber
 


  • Prev by Date: FindMinimum
  • Next by Date: Fitting Explicit Functions
  • Previous by thread: FindMinimum
  • Next by thread: Re: Postscript with Mathematica 3.0