Graphics, Figures & Tablespsfrag doesn't find labels in eps file

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
j_kubik
Posts: 7
Joined: Thu Mar 18, 2010 6:25 pm

psfrag doesn't find labels in eps file

Post by j_kubik »

Hi.

When i generate eps file (using Origin 8, but also some other programs) and try to change some labels with psfrag, but it doesn't detect labels at all.
I don't know the eps file format, but i opened it with text editor and it seems that text is not converted to curves, and not splitted to separate letters:

Code: Select all

/MC14_Arial 84 self 0 0 m
(prawa)[47 28 47 61 47 ] xs
1 -1 sc
where my label is 'prawa'. I even changed it with binary editor to be sure that it's not some hidden text, and the real text is made of curves somewhere else in the file. I guess it's correct eps, but psfrag doesn't seem to be able to find labels anyway.
Does somebody know a reason for this behavior?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: psfrag doesn't find labels in eps file

Post by josephwright »

Please post a full example of what you are doing, along with a demo EPS file (upload to the forum).
Joseph Wright
j_kubik
Posts: 7
Joined: Thu Mar 18, 2010 6:25 pm

Re: psfrag doesn't find labels in eps file

Post by j_kubik »

I have attached eps file I am working with now, and a minimal latex script including it...
Can you tell me if this isn't working only at mine computer?
Attachments
example.tar.gz
(17.73 KiB) Downloaded 419 times
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

psfrag doesn't find labels in eps file

Post by cgnieder »

I just answered a similar question on TeX.sx:
[...]However, this is not an unknown problem:

[...] It seems that Origin redefines some EPS function/procedure (whatever the correct name is) called xs in a way that psfrag cannot find the text any more.

The “solution” posted on d.c.t.t is this:

Code: Select all

sed -r -e "s/\)\[(([0-9])+ )+\] xs/\) show/g" in.eps > out.eps
That is, in the EPS change the line

Code: Select all

(TMP1)[44 60 49 41 ] xs
into

Code: Select all

(TMP1) show
and similar for the other text tags (or at least the ones you want to replace), either by hand or somewhat automated with the above sed call.
Regards
site moderator & package author
Post Reply