Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inkscape droped --file and --export-TYPE= parameter #20

Closed
theScrabi opened this issue Feb 4, 2020 · 11 comments
Closed

Inkscape droped --file and --export-TYPE= parameter #20

theScrabi opened this issue Feb 4, 2020 · 11 comments
Assignees

Comments

@theScrabi
Copy link

Acording to this issue:
https://gitlab.com/inkscape/inbox/issues/1244
Inkscape 1.0 (beta) does not accept the --file and --export-TYPE= anymore. Therefore this package is broken if used with a newer inkscape version.
Problem is fedora is already rolling out this version therefore on fedora this package can not be used anymore.

Just run into this very annoying.

@theScrabi
Copy link
Author

Apperently what they want one to use in the future are actions:
https://wiki.inkscape.org/wiki/index.php?title=Using_the_Command_Line#Via_actions

@theScrabi theScrabi changed the title Inkscape droped --file and --export-TYPE= parameter Inkscape droped --file and --export-TYPE= parameter Feb 4, 2020
@mrpiggi
Copy link
Owner

mrpiggi commented Feb 4, 2020

I actually did some development for v2.03 and fixed it with #8 but currently I do not have time to go on with development. I will see, what I can do. Maybe I will provide a little patch for v2.02

For now, you can use this workaround

\usepackage{svg}
\makeatletter
\ifdefined\svg@ink@ver\else
  \def\svg@ink@ver{1}% change version to 0 if necessary
  \renewcommand*\svg@ink@cmd[2]{%
    \svg@ink@exe\space"#1.\svg@file@ext"\space%
    --without-gui\space\svg@ink@area\space%
    \ifx\svg@ink@dpi\relax\else--export-dpi=\svg@ink@dpi\space\fi%
    \if@svg@ink@latex--export-latex\space\fi%
    \ifx\svg@ink@opt\@empty\else\svg@ink@opt\space\fi%
    \ifnum\svg@ink@ver<\@ne%
      --export-\svg@ink@format="#2.\svg@ink@format"\space%
    \else%
      --export-type=\svg@ink@format\space%
      --export-file="#2.\svg@ink@format"\space%
    \fi%
  }%
\fi
\makeatother

@mrpiggi mrpiggi self-assigned this Feb 4, 2020
@mrpiggi mrpiggi added the bug label Feb 4, 2020
@theScrabi
Copy link
Author

Thank you :)

@fstengel
Copy link

Inkscape 1.0rc1 changed things a bit (again). No more --without-gui and --export-file becomes --export-filename. So the patch becomes:

\usepackage{svg}
\makeatletter
\ifdefined\svg@ink@ver\else
  \def\svg@ink@ver{1}% change version to 0 if necessary
  \renewcommand*\svg@ink@cmd[2]{%
    \svg@ink@exe\space"#1.\svg@file@ext"\space%
    \svg@ink@area\space%
    \ifx\svg@ink@dpi\relax\else--export-dpi=\svg@ink@dpi\space\fi%
    \if@svg@ink@latex--export-latex\space\fi%
    \ifx\svg@ink@opt\@empty\else\svg@ink@opt\space\fi%
    \ifnum\svg@ink@ver<\@ne%
      --export-\svg@ink@format="#2.\svg@ink@format"\space%
    \else%
      --export-type=\svg@ink@format\space%
      --export-filename="#2.\svg@ink@format"\space%
    \fi%
  }%
\fi
\makeatother

Thanks again for that precious tool

@mrpiggi
Copy link
Owner

mrpiggi commented Apr 24, 2020

Thanks for the report. I will adapt package svg as soon as I find some time for this...

@fstengel
Copy link

fstengel commented Apr 24, 2020 via email

@jvasile
Copy link

jvasile commented May 6, 2020

I and @kfogel ran into this bug and it looks like inkscape is fairly sanguine about breaking 3rd party tools. This is, after all, a major version release.

Once 1.0 ships and the interface settles, the challenge will be supporting both old and new CLI interfaces. The right answer might be to ship a wrapper script, call that, and have it call inkscape with the correct parameters. We had just started to think about what that might look like when we came here to see who else had encountered the bug and what solutions exist.

Thanks, @mrpiggi and @fstengel for the workarounds.

We've incorporated the workaround as a plugin into our Latex / Jinja templating system. It detects when the workaround is needed and adds it to your latex doc via jinja templating at build time. Thanks again.

@jendrikw
Copy link

jendrikw commented May 6, 2020

For detecting the version, inkscape recommends calling inkscape --without-gui (or inkscape -z) and checking the exit code, but I'm not sure how you can do that in latex.

https://gitlab.com/inkscape/inbox/-/issues/2416

@mrpiggi
Copy link
Owner

mrpiggi commented May 6, 2020

Detecting version in LaTeX: https://github.com/mrpiggi/svg/blob/develop/source/svg.dtx#L4138

I already did something about this some time ago. I am going to provide a bug fix release until the end of this week.

@mrpiggi mrpiggi closed this as completed in cc77367 May 8, 2020
@mrpiggi
Copy link
Owner

mrpiggi commented May 8, 2020

v2.02f was shipped to CTAN

@mrpiggi
Copy link
Owner

mrpiggi commented May 8, 2020

Inkscape 1.0rc1 changed things a bit (again). No more --without-gui and --export-file becomes --export-filename.

As well as --export-type is implied by the file extension of --export-filename

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants