MathGroup Archive 2011

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

Search the Archive

Aw: Re: mathematica 8 and psfrag

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119646] Aw: Re: mathematica 8 and psfrag
  • From: Sebastian Hofer <sebhofer at gmail.com>
  • Date: Thu, 16 Jun 2011 03:59:37 -0400 (EDT)
  • Reply-to: comp.soft-sys.math.mathematica at googlegroups.com

Am Mittwoch, 15. Juni 2011 13:21:02 UTC+2 schrieb pmt:
> > On Sat, Jun 11, 2011 at 3:59 AM, pmt
> >
>  wrote:
> >
> > > I recently updated from mathematica 7.0 to 8.0, and
> > have now encountered problem with replacing
> > > my plot labels with LaTeX code using the psfrag
> > package. Everything worked perfectly with the
> > > earlier version and the exact same plots, but now
> > psfrag leaves all labels unchanged. I use Kile
> > > on Ubuntu 11.04 for LaTeX editing.
> >
> > I do this frequently and have had no problems,
> > although I use TeXShop
> > on the Macintosh.  One might conjecture that your
> > graphics are being
> > rasterized, either explicitly or behind the scenes.
> >  If you are
> > rasterizing your graphics, say to reduce the file
> > size of 3D graphics
> > or to get opacity to work correctly, then you might
> > try overlaying the
> > text on top of the graphics.  Here's an example that
> > includes the
> > string "expmx2" in four spots; two are inside the
> > Rasterize command
> > and two are outside.
> >
> > g = Plot3D[Exp[-x^2 - y^2], {x, -2, 2}, {y, -2, 2}];
> > Labeled[
> >  Overlay[{Rasterize[
> >     Show[g, Graphics3D[Text["expmx2", {1, 1, 1}]],
> >      PlotLabel -> "expm2"],
> >     RasterSize -> 800, ImageSize -> 400],
> >    "expmx2"}, Alignment -> {-0.5, 0.5}],
> >  "expmx2"]
> >
> > I then call LaTeX with the following psfrag command:
> > \psfrag{expmx2}{$e^{-(x^2+y^2)}$}
> >
> > Only the two strings outside the Rasterize are
> > affected.
> >
> > If you are not explicitly calling Rasterize or
> > otherwise converting
> > your graphics to bitmap, then there may be some other
> > reason that your
> > graphics are being rasterized behind the scences.  Of
> > course, explicit
> > code exhibiting the problem would help diagnose the
> > problem.
> >
> > Mark McClure
> >
>
> Thank you for your detailed reply. Good to know about Rasterize, however,
 I don't think that is the problem here. Are you using mathematica version 
8? My suspicion is that there is some difference in how mathematica 8 creates eps files compared to earlier versions. Even simplest examples fail for me after upgrading to 8, say:
>
> plot = Plot[x, {x, -0.1, 0.1}, AxesLabel -> {eps, SUM},
>   BaseStyle -> {FontSize -> 10}]
> Export["plot.eps", plot]
>
> \psfrag{eps}{$\epsilon$}
> \psfrag{SUM}{$\Sigma$}
> \includegraphics{plot.eps}


Hi,
I think my original post to mathgroup got lost, so please excuse possible double postings.
I can confirm this problem under Linux and Mathematica 8. The ps export apparently changed in this version. Strings are now exported as single characters rather than as the whole string (sorry for the handwavingexplanation, I know nothing about the innards of postscript), therefore replacement of multi-character strings breaks. I would guess that replacing single characters still works. My pragmatic solution was to go back to v.7 to export my graphics. However a fix or at least a workaround would be desirable, as I don't want to keep v.7 around forever.
Best regards,
Sebastian


  • Prev by Date: Re: Is there ToNumber?
  • Next by Date: Re: Seaching in Pi a sequence. Looking for a faster method
  • Previous by thread: Interval and IntervalIntersection with a List
  • Next by thread: Re: How to extract a pattern