svg support working?

pviton's picture

Is svg support working properly?

I have an svg image that I'm trying to use
with SWP 6.09 on Windows. I can read it in using
Insert > Image, and it displays correctly
in the editor; but when I try to preview,
the system says that it cannot make the pdf file.

Looking at the tex file, I see a rather
odd set of commands defined:

\usepackage{svg} %% 100\IfFileExists{/dev/null}{%
\newcommand{\Inkscape}{/Applications/Inkscape.app/Contents/Resources/bin/inkscape }%
}{
\newcommand{\Inkscape}{"C:/Program Files/Inkscape/inkscape.exe" }%
}
\setsvg{
inkscape=\Inkscape -z -C, svgpath=../graphics/
}

It is true that I have Inkscape installed and that
the svg file type is associated with this program.
But the program is not located in "c:/Program Files/Inkscape"
and I'm not sure why SWP6 thinks that it is.
The relevant Registry entries give the correct path.
And if I double-click on an svg file, Inkscape
starts with the file displayed, so we know that the
association mechanism is working as it should.

From the log:

\SVG@out@width=\skip68
\SVG@out@height=\skip69
\c@svgfigure=\count109
)
! Too many }'s.
l.17 }
{
You've closed more groups than you opened.
Such booboos are generally harmless, so keep going.

! LaTeX Error: Command \Inkscape already defined.
Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help.
...

l.18 ..."C:/Program Files/Inkscape/inkscape.exe" }
%

Further comments:

(1) You seem to be assuming that the user has
Inkscape installed. What if this isn't so?
(You've downloaded or been sent an svg file,
rather than having createxd it yourself).
Inkscape is hardly a standard windows program.

(2) from the documentation of the LaTeX svg
package ( v1.0 (2012/09/05) ), p. 2: "Finally, this
package will not work on Windows, but should run on
any *nix platform as long as the paths to the appropriate
programs are correctly defined." Do you know something
that the package's author doesn't? (As far as I can tell,
there's no explanation as to why it won't
work under Windows, so maybe this is a red herring).

(3) Given that Inkscape may not be installed,
Why use it at all? You include a version of
convert.exe with swp6, and

convert image.svg -density 300 image.png

seems to work (also output as pdf or jpg).

(4) If you are going to use Inkscape, and given (2)
above, wouldn't it be easier to have SWP run inkscape
itself and then saving the result somewhere in the sci
file, rather than embedding the commands in the tex file?
(As you do with some other graphics, per the file
graphicsConversions.ini). The following seems to work,
given that the inkscape exe can be found:

inkscape -z -C C:/ftp/image.svg --export-png=c:/ftp/image.png