Hello,
I am trying to label some gnuplot-generated EPS files with inkscape, in order to then use them in LateX in combination with psfrag. Everything is fine, except that the psfrag anchors are destroyed upon exporting to EPS. Here is an example:
http://mvl.chem.tu-berlin.de/people/stetten/inkscape/test_original.eps http://mvl.chem.tu-berlin.de/people/stetten/inkscape/test_inkscape_export.ep...
(Also, why is the image size and the (relative) size of the BBox changed upon export?)
I realize the importance of the "export text as paths" checkbox, and while both settings produce different EPS files, none contains the psfrag labels. I tried with inkscape 0.44.1, 0.45.1, and 0.41 (on Debian).
I found several reports on the web that the combination of EPS and inkscape and psfrag works perfectly well. Please help, what am I doing wrong?!
Greetings, David
On Mon, 2007-06-04 at 21:27 +0200, David von Stetten wrote:
Hello,
I am trying to label some gnuplot-generated EPS files with inkscape, in order to then use them in LateX in combination with psfrag. Everything is fine, except that the psfrag anchors are destroyed upon exporting to EPS. Here is an example:
http://mvl.chem.tu-berlin.de/people/stetten/inkscape/test_original.eps http://mvl.chem.tu-berlin.de/people/stetten/inkscape/test_inkscape_export.ep...
(Also, why is the image size and the (relative) size of the BBox changed upon export?)
I realize the importance of the "export text as paths" checkbox, and while both settings produce different EPS files, none contains the psfrag labels. I tried with inkscape 0.44.1, 0.45.1, and 0.41 (on Debian).
I found several reports on the web that the combination of EPS and inkscape and psfrag works perfectly well. Please help, what am I doing wrong?!
The problem is at the importing stage. The text is being converted to paths (look at the text with the XML editor dialog). psfrag does work well with Inkscape text objects. See the tip in the .tex section of:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/File-Export.html#File-Export-Ot...
You could replace the text as paths with text as text.
Tav
Hello Tav,
thanks for your reply!
I realize the importance of the "export text as paths" checkbox, and while both settings produce different EPS files, none contains the psfrag labels. I tried with inkscape 0.44.1, 0.45.1, and 0.41 (on Debian).
I found several reports on the web that the combination of EPS and inkscape and psfrag works perfectly well. Please help, what am I doing wrong?!
The problem is at the importing stage. The text is being converted to paths (look at the text with the XML editor dialog). psfrag does work well with Inkscape text objects. See the tip in the .tex section of: http://tavmjong.free.fr/INKSCAPE/MANUAL/html/File-Export.html#File-Export-Ot...
Hmm, just to make sure I understand you correctly: psfrag works well with text labels which are inserted by inkscape, but any labels already existing in the original EPS file are inevitably destroyed?? I hope that's not right, as in this case I'd have to look for an entirely different solution.
You could replace the text as paths with text as text.
Uhm, what do you mean by this?
Many greetings, David
On Tue, 2007-06-05 at 07:03 +0200, David von Stetten wrote:
Hmm, just to make sure I understand you correctly: psfrag works well with text labels which are inserted by inkscape, but any labels already existing in the original EPS file are inevitably destroyed?? I hope that's not right, as in this case I'd have to look for an entirely different solution.
I've studied the problem a bit more...
Yes, psfrag works with text labels inserted by Inskcape. And yes, importing EPS into Inkscape may convert the text labels to paths... losing their ability to be used as tags for psfrag. This depends on which version of Inkscape you are using and where you got it from.
The current SVN version uses the program "pstoedit" to convert EPS into svg. The exact command is `pstoedit -f plot-svg`. This command does not convert the text to paths (although the SVG file it produces looks a bit strange).
To use the SVN version, replace the contents of: share/inkscape/extensions/eps_input.inx with
<inkscape-extension> <_name>EPS Input</_name> <id>org.inkscape.input.eps</id> <dependency type="executable">pstoedit</dependency> <input> <extension>.eps</extension> <mimetype>image/x-encapsulated-postscript</mimetype> <_filetypename>Encapsulated Postscript (*.eps)</_filetypename> <_filetypetooltip>Encapsulated Postscript</_filetypetooltip> <output_extension>org.inkscape.output.eps</output_extension> </input> <script> <command reldir="path">pstoedit -f plot-svg</command> </script> </inkscape-extension>
You must have "pstoedit" available with plot-svg from the GNU libplot library.
Another way to get a decent svg file for input into Inkscape is to use the chain:
pstoedit -f sk test_original.eps test_original.sk skconvert test_original.sk test_sk.svg
This seems to produce a bit better svg, again with the text not converted to paths.
You could replace the text as paths with text as text.
Uhm, what do you mean by this?
That you could manually replace the text (paths) imported by Inkscape by text objects (real text). Obviously one of the above methods would be better.
Tav
Hello Tav,
thanks for your explanations! Good to hear that there seems to be a way to do what I'd like to do... even though I haven't tried it yet. ;-)
Yes, psfrag works with text labels inserted by Inskcape. And yes, importing EPS into Inkscape may convert the text labels to paths...
Is there some reason why this text-to-path conversion can be disabled upon export of EPS, but not when loading EPS? Both cases seem equally important to me.
losing their ability to be used as tags for psfrag. This depends on which version of Inkscape you are using and where you got it from.
Well, I (unsuccessfully) tried 0.41, 0.44.1, and 0.45.1. Would the SVN version be different in this respect?
The current SVN version uses the program "pstoedit" to convert EPS into svg. The exact command is `pstoedit -f plot-svg`. This command does not convert the text to paths (although the SVG file it produces looks a bit strange).
To use the SVN version, replace the contents of: share/inkscape/extensions/eps_input.inx with
You mean to *only* patch this file, in order to get the SVN behaviour? OK, I'll try (with 0.44.1, which is the version included in Debian etch).
Another way to get a decent svg file for input into Inkscape is to use the chain:
pstoedit -f sk test_original.eps test_original.sk skconvert test_original.sk test_sk.svg
This seems to produce a bit better svg, again with the text not converted to paths.
OK, I'll try this as well...
That you could manually replace the text (paths) imported by Inkscape by text objects (real text). Obviously one of the above methods would be better.
Not really an option considering the number of figures that I'm dealing with.
Thanks a lot, your help is very much appreciated! I'll let you know if it worked.
Greetings, David
Hello,
some new experiences related to the issue of inkscape's text import and export in EPS format! :-)
To use the SVN version, replace the contents of: share/inkscape/extensions/eps_input.inx with
Soo... after I changed that file, the psfrag part worked again, but the BBox is messed up. If I copy the BBox line directly from the original EPS file to the new one, everything is fine! The size of the resulting image is still slightly different than before the im/export, but I guess I can live with that. It might be adjustable by fiddling with pstoedit. I have to check that, or sed otherwise. Ah, and also the psfrag labels are displayed in inkscape at 10% of the real size (i.e., dots), but that might be a local problem with that font (Helvetica), as marking the label and changing it to something else gives a correct size. The resulting EPS has the correct psfrag label fontsize again, anyway. :-)
However, by now I'm kinda thinking I am going to program the labeling that I wanted to do manually into octave/gnuplot. I don't know what other disasters to expect with this whole conversion stuff...
pstoedit -f sk test_original.eps test_original.sk skconvert test_original.sk test_sk.svg This seems to produce a bit better svg, again with the text not converted to paths.
Yes, that also worked, except that the labels of the x-axis were slighty moved upwards, into the x-axis. :-( Therefore, not an option. (BBox was also wrong.)
That you could manually replace the text (paths) imported by Inkscape by text objects (real text). Obviously one of the above methods would be better.
Yes. :-)
Thanks a lot for your help! Greetings, David
participants (2)
-
David von Stetten
-
Tavmjong Bah