mrpiggi / svg

Handling SVG pictures in LaTeX documents using Inkscape, ImageMagick and/or Ghostscript
Other
65 stars 12 forks source link

Inkscape 1.0 still called with '-z' flag, fails to start #25

Closed RaphaelWimmer closed 4 years ago

RaphaelWimmer commented 4 years ago

This is a continuation of Issue #20 regarding support for Inkscape 1.0.

Maybe I am missing something but it seems the code still uses the -z flag for all Inkscape versions: \def\SVG@cmd@inkscape{inkscape -z -C}%

However, -z is just an alias for --without-gui (see e.g. Issue #8 ) so it probably should be removed from the above definition. The package already sets the --without-gui flag for Inkscape 0.x so there is no need to set it via -z. Calling Inkscape 1.0 with -z will cause it to fail with error message Unknown option -z.

(Inkscape 1.0 dropped the --without-gui flag completely man page and automatically runs export commands without GUI unless specified with --with-gui.)

Solution would probably be to just change this line to:

\def\SVG@cmd@inkscape{inkscape -C}%

or even better (because more verbose):

\def\SVG@cmd@inkscape{inkscape --export-area-page}%

mrpiggi commented 4 years ago

\def\SVG@cmd@inkscape{inkscape -z -C}% is nowhere in the code since release v2.00 so you are probably using a very old version of package svg.sty.

RaphaelWimmer commented 4 years ago

Oh, sorry - I just found this line in the current svg.dtx. Why is it there?

Edit: oh:

% \section{Old Implementation}

Sorry for wasting your time. I was using an old version of the package and misunderstood the code because I just Ctrl-F-ed '-z'). I'll upgrade svg.sty. Thank you for your work!

In my local 2.02b svg.sty, "-z" is here (and this version is causing problems with Inkscape 1.0):

\ProvidesPackage{svg}[%
  2018/11/12 v2.02b\space%
  (include SVG pictures)
[...]
\newcommand*\svg@ink@cmd[2]{%
  \svg@ink@exe\space-z\space\svg@ink@area\space%

(Debian package texlive-latex-extra, version: 2018.20190227-2)

mrpiggi commented 4 years ago

Oh, sorry - I just found this line in the current svg.dtx. Why is it there?

When I took over the maintenance of the package, users with compatibility problems should be able to work around them and build the old version v1.0 locally with svg.dtx. Since the new user interface has been official for more than 3 years now, I will remove this part with the next main release v2.03.

In my local 2.02b svg.sty, "-z" is here (and this version is causing problems with Inkscape 1.0):

\newcommand*\svg@ink@cmd[2]{%
  \svg@ink@exe\space-z\space\svg@ink@area\space%

That's the cause of the problem and was resolved with v2.02f. See https://github.com/mrpiggi/svg/blob/1014d8c67955ecfb5cd9a7acaf1f07567ccb6024/source/svg.dtx#L2309-L2320