Hi everybody!

        I want to report the results of my experiments in combining SVG figures 
and 
the PSFrag package in LyX, hoping that they will be useful to somebody.

        The point was to draw a SVG figure in, say, Inkscape and insert it 
directly 
into LyX without converting it to EPS first, to skip a step in producing a 
document while having an instant preview within LyX. I also wanted to be able 
to select View -> PostScript and have LyX automatically produce the EPS file 
from the SVG and include any LaTeX code I wanted via PSFrag.

        I followed the advice in these two pages:

        [1] http://wiki.lyx.org/Tips/UseInkscapeSVGImages
        [2] 
http://www.ma.utexas.edu/users/stirling/computergeek/latexgraphics.html

        Result: It works. Kind of.

        I managed to get LyX to accept SVG figures and SVG to EPS conversion 
without 
any problem by following the info in [1]. Everything works as advertised 
(although the PDF conversion gives ugly figures sometimes). The problem is 
when I want to use PSFrag. I found three problems:

        1. The info in [1] is wrong; to convert SVG to EPS, you have to disable 
the "convert text to path" function in Inkscape or your text will be exported 
as a picture. Do *not* use the--export-text-to-path switch with Inkscape.

        2. Automatic inclusion of LaTeX code via PSFrag fails, and I don't know 
why. 
Inkscape converts SVG to EPS correctly; if you insert manually these EPS 
files in your LyX document, PSFrag works perfectly. The problem is when you 
insert the original SVG in LyX and expect it to handle the conversion by 
itself (which is the whole point of doing all this!); in this case, the final 
document shows the text anchors instead of the LaTeX code whatever I do. I am 
still looking into this.

        3. A minor but annoying issue is that, while the PS documentis OK, when 
using 
Veiw->PDF, the figures look very degraded (and no PSFrag, of course). I am 
still looking into this.

        Hope all this is useful to somebody. Has anybody tried to do this? Did 
it 
work? I am specially annoyed at problem (2), because I have the feeling that 
it'd work with just a little tweak somewhere. Am I missing something, or is 
there a problem with the interaction between LyX, PSFrag and Inkscape?

        Yours,

        - Urtzi -

-- 
If you would know the value of money, go try to borrow some.
                -- Ben Franklin

Reply via email to