MathGroup Archive 1996

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

Search the Archive

Re: Printing/TeX

  • To: mathgroup at smc.vnet.net
  • Subject: [mg3499] Re: Printing/TeX
  • From: chang at wsu.edu (Ching-Mo Chang)
  • Date: Mon, 18 Mar 1996 00:57:45 -0500
  • Organization: Washington State University
  • Sender: owner-wri-mathgroup at wolfram.com

>>>>> "Tobias" == Tobias Cottmann <cottmann at zmnh.zmnh.uni-hamburg.de> writes:

 Tobias> By the way: Does anyone know how to create eps files
 Tobias> automatically? Is there something like SaveEPS[filename,
 Tobias> graphics] ?

The following (RaPrint.m) define a small function that use `rasterps.exe'
to output mathematica graph to my printer (hpdj560c) or to an eps file.

Note: I am using mathematica 2.2.4 for OS/2.

I put

<<RaPrint.m

im my init.m, and RaPrint.m in `/math/Packages/' directory.

I use

RAPrint[graph]

to print the graph, and

EPSFile[graph,"file.eps"]

to output graph to the eps file `file.eps'.

==== File: RaPrint.m ==========================================================
(* 3/4/1995 Ching-Mo Chang chang at theta.math.wsu.edu *)

(* Using rasterp to print Mathematica graph in OS/2*)

Unprotect[System`RAPrint]

System`RAPrint::usage = "Usage::RAPrint[-graphics-, \"format\", \"file\",
                         \"Options\"]."

System`RAPrint::Print = "Graphics being printed by \"`1`\".";

Begin["System`Private`"]
RAPrint[g_, fmt_String:"hplj.300", f_String:"lpt1", opt_String:""] :=
 	Block[{ filename ,RAString},
	filename = StringJoin[f, ".ps"];
	Display[filename, g] ;
	RAString = StringJoin[ "rasterps -format ",fmt," -file ",
	f," ", opt," ",filename];
	Message[RAPrint::Print,RAString];
	Run[RAString];
	DeleteFile[filename]]

EPSFile[g_,f_String] := RAPrint[g,"eps",f,"-xdpi 300 -ydpi 300"]

End[]

Protect[RAPrint]
===========================================================================

--
Ching-Mo Chang <chang at wsu.edu> <chang at theta.math.wsu.edu>

==== [MESSAGE SEPARATOR] ====


  • Prev by Date: Re: More on functions & derivatives
  • Next by Date: Integration
  • Previous by thread: Re: Printing/TeX
  • Next by thread: Mathematica for FreeBSD?