export to EPS with text kept undivided to letters (for LaTeX's psfrag package)
Hello,
I have a rather specific problem that I was unable to solve so far. I'm using Inkscape to draw figures that are later included in LaTeX documents. Since I often need to include math in my figures, I'm using LaTeX package called PSFrag. What this package does is it parses a given EPS file a replaces specified strings by a LaTeX rendered text. This way I can combine the power of Inkscape and LaTeX together to get beautiful and easily drawn figures with the possibility of placing complex math formulas in the figure.
Now my problem. PSFrag works by searching a given EPS file for occurences of a given string. For example the command
\psfrag{t1}{$\sin^2(x)$}
will replace the occurence of the "tag" t1 by the LaTeX rendered formula sin^2(x).
The problem is, that during the conversion to EPS, Inkscape will break any text I write into letters. For example, the text "t1", meant to be replaced by PSFrag, will get translated to
(t) show grestore gsave [1.0000000 0.0000000 0.0000000 -1.0000000 384.78790 540.19971] concat /Courier findfont 12.000000 scalefont setfont 0.0000000 0.0000000 0.0000000 setrgbcolor newpath 0.0000000 0.0000000 moveto (1) show grestore gsave [1.0000000 0.0000000 0.0000000 -1.0000000 581.42859 538.95166] concat
instead of simple (t1) show.
This causes PSFrag to miss the replacement tag "t1" since it is broken into two "show" commands.
I realize that this is probably done because of kerning. So, I tried to manually switch off kerning (for this text/and altogether) but I wasn't able to do it--I didn't find any command to do it, nor did I find it in the XML editor. I also tried to disable kerning by selecting a monospaced font but it didn't help either.
An obvious solution is to use single letter but this is rather inconvenient.
Is there anything else I might do?
Thank you!
David
This is fixed in CVS. Now the text is broken into chars only at kerns, otherwise it's a string in PS.
Excellent!! Thank you.
Is there a way to force Inkscape not do kerning on selected text? I know that it's kind of abuse but in my case, there could be cases where I might want longer "tags" and I wouldn't want to have to worry about kerning :)
Does a font selection influence kerning, meaning whether it's done or not.
David
bulia byak wrote:
This is fixed in CVS. Now the text is broken into chars only at kerns, otherwise it's a string in PS.
On 5/29/05, David Soukal <david.soukal@...719...> wrote:
Is there a way to force Inkscape not do kerning on selected text? I know that it's kind of abuse but in my case, there could be cases where I might want longer "tags" and I wouldn't want to have to worry about kerning :)
Here only the artificial kerning matters, that which you do with Alt+arrows. Any kerning pairs from the font are displayed but do not break strings in PS. It's up to the PS interpreter to use or not use the kerning pairs from font.
participants (2)
-
bulia byak
-
David Soukal