Hi everybody!
[I sent this message about an hour ago, but it looks like it got lost.
In the
meantime, I solved one of the problems I had, so I send an updated version of
my original message hoping that it will be useful to somebody else].
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, thus I 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.
[UPDATE: It works perfectly, with just a minor issue. See below]
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, as explained in [2]. 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.
[UPDATE: I solved it! The trick is to declare the packages "graphicx"
and "color" in your preamble, *even if you don't use any color at all*. Just
declare them and wham! SVG previews + autoEPS + PSFrag. Took me a while to
solve this one!]
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.
[UPDATE: Still doesn't work. The only PDF export that works roughly OK is
ps2pdf, and the images still look worse on screen than on the PS. I haven't
tried to print them though, so maybe the printed version will look better]
Hope all this is useful to somebody. Has anybody tried to do this? Did
it
work?
Yours,
- Urtzi -
--
If you would know the value of money, go try to borrow some.
-- Ben Franklin
-------------------------------------------------------
--
Urtzi Jauregi
Fakulteta za Matematiko in Fiziko, Univerza v Ljubljani
Jadranska 19, Si-1000 Ljubljana
Slovenija
Tel: ++386 01 540 13 53
e-mail: [EMAIL PROTECTED]