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

Autodetection of inkscape version fails (XeLaTeX, MikTeX, Inkscape 1.01) #31

Closed
deining opened this issue Oct 21, 2020 · 10 comments
Closed

Comments

@deining
Copy link
Contributor

deining commented Oct 21, 2020

Minimal working example

\documentclass{article}
\usepackage[inkscapeversion=auto]{svg}

\begin{document}
\includesvg{first.svg}
\end{document}

Compilation of MWE fails:

! Use of \svg@tempb doesn't match its definition.
\svg@tempa ->P
              ango version: 1.46.1
l.4 \begin{document}
                    ^^M
?

Reason for failure:

Autodectection of inkscape version fails since version output of inkscape (v1.01) now has two lines, indicating pango version as well:

REM Windows
C:\>inkscape --version
Inkscape 1.0.1 (3bc2e813f5, 2020-09-07)
    Pango version: 1.46.1
# Linux
$ inkscape --version
Inkscape 1.0.1 (3bc2e813f5, 2020-09-07)
    Pango version: 1.40.14

This can be easily fixed by specifiying inkscapeversion=1 as option which causes auto-detection to be skipped.

I'm reporting this error anyway since it might confuse newcomers.

Environment

  • WIndows 10
  • MikTeX, latest version
  • Package: svg 2020/09/29 v2.02i (include SVG pictures)
  • Inkscape 1.0.1
@mrpiggi
Copy link
Owner

mrpiggi commented Oct 21, 2020

Do you have problems with Linux as well as Windows? Which LaTeX distribution do you use?

@deining
Copy link
Contributor Author

deining commented Oct 21, 2020

Do you have problems with Linux as well as Windows?

I encountered the issue with on Windows 10 system.

Afterwards I checked inkscape's version output on Linux, too. I would strongly assume that you encounter the same issue on a Linux system. I haven't verfied that, though.

Which LaTeX distribution do you use?

I'm using MikTeX, latest version.

@mrpiggi
Copy link
Owner

mrpiggi commented Oct 21, 2020

As I couldn't replicate your problem with TeX Live both on Linux and Windows, I am pretty sure that this is a specific issue with MiKTeX (maybe related to MiKTeX/miktex#532). I will have a closer look tonight.

@deining
Copy link
Contributor Author

deining commented Oct 21, 2020

As I couldn't replicate your problem with TeX Live both on Linux and Windows

I just checked. And yes, I can confirm that my MWE runs flawlessfly on Linux (TexLive).

I am pretty sure that this is a specific issue with MiKTeX

You are right. This also means that this issue is most likely not related to the multiline version output of inkscape v1.x.

(maybe related to MiKTeX/miktex#532)

Not sure. Originally, my installlation was indeed on a path containing spaces. I now reinstalled inkscape, choosing a location without spaces. This didn't cure the problem, though.

I will have a closer look tonight.

Thanks and good luck!

@mrpiggi
Copy link
Owner

mrpiggi commented Oct 21, 2020

(maybe related to MiKTeX/miktex#532)

Not sure. Originally, my installlation was indeed on a path containing spaces. I now reinstalled inkscape, choosing a location without spaces. This didn't cure the problem, though.

I did not mean potential spaces in the path but how MiKTeX treats an additional line when calling \@@input|"inkscape -V" as TeX Live only reads the first line and expands to Inkscape 1.0.1 (3bc2e813f5, 2020-09-07) without Pango version at all as you can see here:

\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
\begingroup
  \makeatletter
    \@makeother\|%
    \endlinechar=\m@ne%
    \everyeof{\noexpand}%
\edef\foo{%
  \xdef\noexpand\foo{\noexpand\@@input|"inkscape\space-V" }%
}%
\meaning\foo
\foo
\endgroup

\meaning\foo
\end{document}

@mrpiggi
Copy link
Owner

mrpiggi commented Oct 22, 2020

The example also works in MiKTeX (20.10 portable) and gives Inkscape 1.0.1 (3bc2e813f5, 2020-09-07)Pango version: 1.46.1

I could not replicate the problem with the following MWE:

\listfiles
\documentclass{minimal}
\usepackage{svg}
\begin{document}
\noindent\includesvg[width=\textwidth]{test}%
\end{document}

So maybe updating your MiKTeX installation would solve your issue? If this is not the case, please provide me the output log file for the given MWE either right here or via e-mail.

@deining
Copy link
Contributor Author

deining commented Oct 22, 2020

I could not replicate the problem with the following MWE:

I realized just now that the error only occurs when using xelatex. I can run your MWE successfully using latex, pdflatex and lualatex, but not using xelatex.
Hopefully you can reproduce the issues using xelatexfrom MikTeX.

So maybe updating your MiKTeX installation would solve your issue?

No, I don't think that my xelatexinstallation is outdated.
This is XeTeX, Version 3.14159265-2.6-0.999992 (MiKTeX 20.10) (preloaded format=xelatex 2020.10.21)

If this is not the case, please provide me the output log file for the given MWE either right here or via e-mail.

Here comes the log file, as requested.

@deining deining changed the title Autodetection of inkscape version fails (Inkscape 1.01) Autodetection of inkscape version fails (XeLaTeX, MikTeX, Inkscape 1.01) Oct 22, 2020
@mrpiggi
Copy link
Owner

mrpiggi commented Oct 22, 2020

Puh, that's a tough one. There are in fact two issues. The first concerns Inkscape. Currently, the info for Pango is passed via stderr and not stdout. Running this MWE with TeX Live shows this clearly

\listfiles
\documentclass{minimal}
\usepackage[T1]{fontenc}
\begin{document}
\begingroup
  \makeatletter
  \@makeother\|%
  \@makeother\&%
  \catcode\endlinechar=10%
  \everyeof{\noexpand}%
  \edef\parseversion{%
    \xdef\noexpand\pipestdout{\noexpand\@@input|"inkscape\space-V\space2>&1" }%
    \xdef\noexpand\pipenormal{\noexpand\@@input|"inkscape\space-V" }%
  }%
\texttt{\meaning\parseversion}
\parseversion
\endgroup

\texttt{pipestdout}: \pipestdout

\texttt{pipenormal}: \pipenormal
\end{document}

Regardless of the format used (pdflatex, lualatex, xelatex) the result is the same:
Using a standard pipe only returns Inkscape 1.0.1 (3bc2e813f5, 2020-09-07) whereas redirecting stderr to stdout shows Inkscape 1.0.1 (3bc2e813f5, 2020-09-07) Pango version: 1.46.1
I created an issue for this: https://gitlab.com/inkscape/inbox/-/issues/3882

But there is another issue with MiKTeX. Depending on the format used, the result is different:

  • pdflatex: Inkscape 1.0.1 (3bc2e813f5, 2020-09-07) Pango version: 1.46.1 for both cases
  • lualatex: kscape 1.0.1 (3bc2e813f5, 2020-09-07) Pango version: 1.46.1 [sic] for redirected pipe
  • xelatex: Pango version: 1.46.1 only for both cases

So I re-opened the mentioned issue (MiKTeX/miktex#532)
I created a new issue: MiKTeX/miktex#648

@mrpiggi
Copy link
Owner

mrpiggi commented Oct 23, 2020

I'm going to provide a bug fix today. Hopefully, MiKTeX gets adopted soon.

mrpiggi added a commit that referenced this issue Oct 23, 2020
@mrpiggi
Copy link
Owner

mrpiggi commented Oct 25, 2020

svg v2.02j is now available via CTAN and so for common LaTeX distributions as well

terrex added a commit to terrex/svg that referenced this issue Nov 24, 2020
when verifying version of inkscape:

    (|'inkscape' -V 2>&1)
    Runaway argument?
    ! Paragraph ended before \svg@tempb was complete.
    <to be read again>
                       \par
    l.11 \begin{document}

    ?

Reverts partially 9b9c555
(which fixes  mrpiggi#31)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants