Math & Sciencechemstyle | Inkscape EPS and TMP Captions

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
BoudewijnD
Posts: 60
Joined: Wed Nov 18, 2009 4:18 pm

chemstyle | Inkscape EPS and TMP Captions

Post by BoudewijnD »

Hi,

I work with chemstyle to finish my thesis. And up till now it worked great. I export my files form chemdraw to eps and use TMP captions, which in turn change with Chemstyle in the latex file to the correct numbering.

But no I changed a file a litte in Inkscape and saved it as eps again but nog the TMP captions will not be replaced by chemstyle, what ever saving mode I use.

Is there a way to over come this problem??

\BoudewijnD

p.s. a minimal working file with the eps is added as zip
Attachments
Temp.zip
Minimal work file + EPS
(186.74 KiB) Downloaded 288 times
Last edited by BoudewijnD on Fri Aug 05, 2011 11:21 am, edited 1 time in total.

Recommended reading 2024:

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

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

User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

chemstyle | Inkscape EPS and TMP Captions

Post by cgnieder »

This is because the text string isn't stored as a text string by inkscape (or -- to be more precise -- cairo) but as some ascii hexadecimal characters, it seems.

This is a known Inkscape problem or rather a cairo problem. If you scroll down on the website linked above you see that you either have to wait for cairo 1.11.x and an inkscape that uses it or need to downgrade inkscape to 0.46.

Or you can fix the problem in the eps file directly.
site moderator & package author
BoudewijnD
Posts: 60
Joined: Wed Nov 18, 2009 4:18 pm

Re: chemstyle | Inkscape EPS and TMP Captions

Post by BoudewijnD »

Hey cgnieder,

Thanx!
I thought that is was someting like that. But now I would like to fix the problem. But as far is I know I can not run to versions of Inkscape in Ubuntu. And I looked at your direct fix but thats like abracadabra for me, so would you be so kind to point me in the right direction.

\BoudewijnD
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

chemstyle | Inkscape EPS and TMP Captions

Post by cgnieder »

As a matter of fact I can. I had the same problem a while ago :)

If you open your file "1.eps" with a text editor, you will find parts of about 4 lines long that begin with a line "BT" and end with a line "ET", for example lines 521 to 527

Code: Select all

BT
6 0 0 6 52.55954 220.200324 Tm
/f-0-0 1 Tf
[<01>-2<02>]TJ
-2.860001 0.959991 Td
[<03>12<02>]TJ
ET
The lines "[ something ]TJ" are containing the text. Now comes the tricky part: you have to identify the ones corresponding to TMP1, TMP2, etc. I found the first ones: line 642

Code: Select all

[<04>5<05>25<06>10<07>]TJ
needs to be replaced with

Code: Select all

(TMP1)Tj
and line 691

Code: Select all

[<04>5<05>25<06>10<08>]TJ
needs to be replaced with

Code: Select all

(TMP2)Tj
and so on

EDIT: I was playing with your eps file a bit: TMP12 to TMP15 are not saved as text but as image, it seems. Their text strings are missing, but they disappear when you remove the image part after line 1456. You should insert these label markers as text first.

Regards
site moderator & package author
BoudewijnD
Posts: 60
Joined: Wed Nov 18, 2009 4:18 pm

chemstyle | Inkscape EPS and TMP Captions

Post by BoudewijnD »

Hey cgnieder,

Now I see but is see to me as a lot of work. I have over a hunder schemes with a minimum of 10 compound a scheme. So when I need it I will go back to 0.46 Inkscape.

A other small question how can you check which Cairo version you have. And can you update it becuase I read on http://cairographics.org/download/#development that there is a snapshot version of 1.11.02.

Thanx for the help again.

\BoudewijnD
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

chemstyle | Inkscape EPS and TMP Captions

Post by cgnieder »

BoudewijnD wrote: Now I see but is see to me as a lot of work. I have over a hunder schemes with a minimum of 10 compound a scheme. So when I need it I will go back to 0.46 Inkscape.
Probably the easier way :)
BoudewijnD wrote: A other small question how can you check which Cairo version you have.
In the package manager, I would guess...
BoudewijnD wrote: And can you update it becuase I read on http://cairographics.org/download/#development that there is a snapshot version of 1.11.02.
I don't know. I haven't tried it and can't say anything. I create all my schemes with chemfig, so for me the problem wasn't too big.

Regards
site moderator & package author
BoudewijnD
Posts: 60
Joined: Wed Nov 18, 2009 4:18 pm

Re: chemstyle | Inkscape EPS and TMP Captions

Post by BoudewijnD »

Creating all my schem's with chemfig is way to much work for me.

Thanx again for the help.

\BoudewijnD
Post Reply