MathGroup Archive 1996

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

Search the Archive

Re: Mathematica graphics into TeX

  • To: mathgroup at smc.vnet.net
  • Subject: [mg4220] Re: [mg4172] Mathematica graphics into TeX
  • From: Timo Felbinger <felbing at spock.physik.uni-konstanz.de>
  • Date: Tue, 18 Jun 1996 03:26:41 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

In article <4p8gfp$7d at dragonfly.wolfram.com>, Alan Schwartz
<schwartz at arch.umsl.edu> wrote:

> Is there a simple way to incorporate graphics generated by
> Mathematica into a TeX document (specifically AmsLatex 2e).
>
> I suspect that this involves somehow generating an appropriate
> Postscript file, but I cannot find out from the Mathematica
> book how to do this.
>

I assume that you already know how to include PS or EPS-files into
TeX-documents.

Depending on the system you are working on, you could of course go
through the print menu and print to a PS-file, or use the clipboard
in some way, but I would not recommend this: It's painful, because it
requires lots of mouseclicks every time you change the graphics, and
the quality of the PS-file created this way is variable at best,
depending on your printer driver (under windows, you typically end up
with about a megabyte of garbage).

A much more clever solution is to use the DISPLAY-function (this function
and the very useful job it performs is well hidden in Wolfram's book).
DISPLAY produces a file which is not yet a correct PS-file; it has to be
fixed by a program called 'psfix'. All this can be done from within mathematica;
I am running mma under Linux and use the following function, which produces
a good-quality EPS-file from any graphics object:

CreateEPS[ filename_, graphics_ ] := (
  Display[
    StringJoin[ filename, ".mps"],
    graphics
  ];
  Run[
    "psfix -epsf ",
    StringJoin[ filename, ".mps" ],
    StringJoin[ ">", filename, ".eps" ]
  ]
)

Unfortunately, psfix does not seem to be included in all distributions of mma.
It comes with the Linux version; there, it is a plain shell script which will
run on any unix system.

I do not know of any equivalent to psfix on other platforms than unix; does anyone
know of a similar program which can be run under windows?

Timo Felbinger   (timo.felbinger at uni-konstanz.de)


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


  • Prev by Date: MATLAB user
  • Next by Date: Re: How can this MapAt application be done more efficiently
  • Previous by thread: Re: Mathematica graphics into TeX
  • Next by thread: Mathematica-Matlab