diff options
author | Karl Berry <karl@freefriends.org> | 2020-10-24 20:27:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-10-24 20:27:26 +0000 |
commit | 2aef12d4ddaa67c815a67c0d7f3d236292a8899c (patch) | |
tree | 4bc1d9150dae32d42883ca22a0306b804f55ac34 /Master/texmf-dist/tex/latex/svg/svg.sty | |
parent | 7a0d10d41d7171536c20c298675835edfc1eb7da (diff) |
svg (24oct20)
git-svn-id: svn://tug.org/texlive/trunk@56748 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/svg/svg.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/svg/svg.sty | 97 |
1 files changed, 55 insertions, 42 deletions
diff --git a/Master/texmf-dist/tex/latex/svg/svg.sty b/Master/texmf-dist/tex/latex/svg/svg.sty index 266781993b4..8aea41a1f50 100644 --- a/Master/texmf-dist/tex/latex/svg/svg.sty +++ b/Master/texmf-dist/tex/latex/svg/svg.sty @@ -61,7 +61,7 @@ }% \svg@Provides% {svg}{include SVG pictures}% - [2020/09/29 v2.02i]% + [2020/10/23 v2.02j]% \@tempb \RequirePackage{iftex}[2020/03/06] \RequirePackage{scrbase}[2020/09/21] @@ -536,10 +536,10 @@ \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=\z@% + \ifcase\svg@ink@ver\relax% 0.x detected --without-gui\space% --export-\svg@ink@format="#2.\svg@ink@format"% - \else% + \else% 1.x or nothing detected --export-filename="#2.\svg@ink@format"% \fi% } @@ -980,31 +980,9 @@ \svg@quotes@remove[\svg@file@base]{\svg@tempa}% \svg@quotes@remove[\svg@out@name]{\svg@tempb}% \ifnum\svg@ink@ver=\m@ne\relax% - \begingroup% - \@svg@tempswafalse% - \@tfor\svg@ink@ver:={1}{0}\do{% - \ShellEscape{\svg@ink@cmd{\svg@tempa}{\svg@tempb}}% - \IfFileExists{\svg@out@name.\svg@ink@format}{% - \@svg@tempswatrue% - }{}% - \if@svg@tempswa% - \@break@tfor% - \fi% - }% - \if@svg@tempswa% - \xdef\svg@ink@ver{\svg@ink@ver}% - \else% - \PackageError{svg}{Inkscape version not detected}{% - It was tried to invoke `\svg@ink@exe'\MessageBreak% - for file "\svg@tempa.\svg@file@ext"\MessageBreak% - but no result was produced. Check the log file\MessageBreak% - and set `inkscapeversion=<version>' manually.% - }% - \fi% - \endgroup% - \else% - \ShellEscape{\svg@ink@cmd{\svg@tempa}{\svg@tempb}}% + \svg@ink@ver@explore{\svg@tempa}{\svg@tempb}{\svg@out@name}% \fi% + \ShellEscape{\svg@ink@cmd{\svg@tempa}{\svg@tempb}}% \IfFileExists{\svg@out@name.\svg@ink@format}{% \edef\svg@tempb{\svg@tempb.\svg@ink@format}% \svg@quotes@remove{\svg@out@base}% @@ -1228,27 +1206,40 @@ \newcommand*\svg@@ink@ver@detect{% \begingroup% \@makeother\|% - \endlinechar=\m@ne% + \@makeother\&% \everyeof{\noexpand}% \svg@quotes@remove{\svg@ink@exe}% \edef\svg@tempa{% - \edef\noexpand\svg@tempa{\noexpand\@@input|"'\svg@ink@exe'\space-V" }% + \edef\noexpand\svg@tempa{\noexpand\@@input|"'\svg@ink@exe' -V 2>&1" }% }% \svg@tempa% - \ifx\svg@tempa\@empty% - \svg@ifwindowsdetected{% - \def\svg@tempb{\jobname.svg.ink.ver.aux}% - \IfFileExists{\svg@tempb}{}{% - \ShellEscape{call "\svg@ink@exe" -V > \svg@tempb}% - \openin\@inputcheck=\svg@tempb% - \read\@inputcheck to\svg@tempa% - \closein\@inputcheck% - \ShellEscape{del \svg@tempb}% - }% - }{}% + \trim@spaces@in\svg@tempa% + \def\svg@tempb{\par}% + \ifx\svg@tempa\svg@tempb + \let\svg@tempa\relax% \fi% - \def\svg@tempb Inkscape ##1.##2\@nil{% - \gdef\svg@ink@ver{##1}% + \def\svg@tempb ##1Inkscape ##2.##3\@nil{% + \gdef\svg@ink@ver{##2}% + \IfArgIsEmpty{##1}{}{% + \def\svg@tempc ####1Pango version:####2\@nil{% + \@svg@tempswafalse% + \IfArgIsEmpty{####2}{}{\IfArgIsEmpty{####1}{\@svg@tempswatrue}{}}% + }% + \svg@tempc ##1 Pango version:\@nil% + \if@svg@tempswa% + \gdef\svg@ink@ver{1}% + \else% + \ifx\svg@tempa\relax% + \def\svg@tempa{MiKTeX/XeLaTeX did not return an error message}% + \else% + \def\svg@tempa{##1}% + \fi% + \PackageWarning{svg}{% + `\svg@ink@exe\space-V' failed with:\MessageBreak% + \detokenize\expandafter{\svg@tempa}% + }% + \fi% + }% }% \expandafter\svg@tempb\svg@tempa Inkscape \m@ne.\@nil% \endgroup% @@ -1261,6 +1252,28 @@ }% \fi% } +\newcommand*\svg@ink@ver@explore[3]{% + \begingroup% + \@svg@tempswafalse% + \@tfor\svg@ink@ver:={1}{0}\do{% + \ShellEscape{\svg@ink@cmd{#1}{#2}}% + \IfFileExists{#3.\svg@ink@format}{\@svg@tempswatrue}{}% + \if@svg@tempswa% + \@break@tfor% + \fi% + }% + \if@svg@tempswa% + \xdef\svg@ink@ver{\svg@ink@ver}% + \else% + \PackageError{svg}{Inkscape version not detected}{% + It was tried to invoke `\svg@ink@exe'\MessageBreak% + for file "#1.\svg@file@ext"\MessageBreak% + but no result was produced. Check the log file\MessageBreak% + and set `inkscapeversion=<version>' manually.% + }% + \fi% + \endgroup% +} \newcommand*\svg@set@input@path[1][]{% \begingroup% \svg@deactivate@dq% |