texlive[56748] Master/texmf-dist: svg (24oct20)
commits+karl at tug.org
commits+karl at tug.org
Sat Oct 24 22:27:26 CEST 2020
Revision: 56748
http://tug.org/svn/texlive?view=revision&revision=56748
Author: karl
Date: 2020-10-24 22:27:26 +0200 (Sat, 24 Oct 2020)
Log Message:
-----------
svg (24oct20)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/svg/LICENSE.md
trunk/Master/texmf-dist/doc/latex/svg/README.md
trunk/Master/texmf-dist/doc/latex/svg/svg.pdf
trunk/Master/texmf-dist/source/latex/svg/svg.dtx
trunk/Master/texmf-dist/tex/latex/svg/svg-extract.sty
trunk/Master/texmf-dist/tex/latex/svg/svg.sty
Modified: trunk/Master/texmf-dist/doc/latex/svg/LICENSE.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/svg/LICENSE.md 2020-10-24 20:26:58 UTC (rev 56747)
+++ trunk/Master/texmf-dist/doc/latex/svg/LICENSE.md 2020-10-24 20:27:26 UTC (rev 56748)
@@ -1,9 +1,9 @@
- svg and svg-extract – Handling SVG pictures in LaTeX documents
+ svg and svg-extract – Handling SVG pictures in LaTeX documents
----------------------------------------------------------------------------
Copyright (C) Philip Ilten <philten at cern.ch>, 2012-2016<br>
- Copyright (C) Falk Hanisch <hanisch.latex at outlook.com>, 2017-
+ Copyright (C) Falk Hanisch <hanisch.latex at outlook.com>, 2017-2020
----------------------------------------------------------------------------
Modified: trunk/Master/texmf-dist/doc/latex/svg/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/svg/README.md 2020-10-24 20:26:58 UTC (rev 56747)
+++ trunk/Master/texmf-dist/doc/latex/svg/README.md 2020-10-24 20:27:26 UTC (rev 56748)
@@ -5,7 +5,9 @@
Copyright (C) Philip Ilten <philten at cern.ch>, 2012-2016<br>
Copyright (C) Falk Hanisch <hanisch.latex at outlook.com>, 2017-2020
- **svg 2020/06/23 v2.02h**
+ **svg 2020/10/23 v2.02j**
+
+ The current release is shiped via CTAN: https://www.ctan.org/pkg/svg
----------------------------------------------------------------------------
@@ -39,6 +41,8 @@
Versions
--------
+**v2.02j** (2020/10/23)
++ bug fix for automatic version detection of ***Inkscape*** with ***MiKTeX***
**v2.02i** (2020/09/29)
+ update for package **scrlfile** v3.32 and kernel (2020/10/01)
@@ -46,13 +50,13 @@
**v2.02h** (2020/06/23)
+ hot fix for package **transparent**,
see https://github.com/mrpiggi/svg/issues/28
-
+
**v2.02g** (2020/06/12)
-+ hot fix for including files with mutliple dots in it's names,
++ hot fix for including files with multiple dots in its names,
see https://github.com/mrpiggi/svg/issues/27
**v2.02f** (2020/05/07)
-+ support for ***Inkscape*** 1.0
++ support for ***Inkscape 1.0*** CLI
**v2.02e** (2020/01/13)
+ fixes for new version of package **scrbase**
@@ -76,7 +80,7 @@
+ distortion of included and extracted graphics supported with options `distort`
(or `keepaspectratio`) and `extractdistort` as well as rotation for
extractions (`extractangle`)
-+ fixed errors with active double qoutes from **babel** in path arguments
++ fixed errors with active double quotes from **babel** in path arguments
+ multiple dots within file names possible
+ package **trimspaces** required
Modified: trunk/Master/texmf-dist/doc/latex/svg/svg.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/svg/svg.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/svg/svg.dtx 2020-10-24 20:26:58 UTC (rev 56747)
+++ trunk/Master/texmf-dist/source/latex/svg/svg.dtx 2020-10-24 20:27:26 UTC (rev 56748)
@@ -64,10 +64,6 @@
\from{svg.dtx}{package,standalone,extract}
\from{svg.dtx}{package,body,extract}
}
-% \usepreamble\defaultpreamble
-% \file{svg-old.sty}{
-% \from{svg.dtx}{package,old}
-% }
}
\else
\let\endbatchfile\relax
@@ -115,7 +111,7 @@
%</dtx>
%<package&identify&main> {svg}{include SVG pictures}%
%<package&identify&extract> {svg-extract}{extract graphics from SVG pictures}%
- [2020/09/29 v2.02i]%
+ [2020/10/23 v2.02j]%
\@tempb
%</dtx|package&identify>
% \fi
@@ -193,6 +189,20 @@
\RecordChanges
\GetFileInfo{svg.dtx}
+\makeatletter
+\newcommand*\notebox[2][\svglstbelowskip]{%
+ \ifhmode%
+ \vskip\svglstbelowskip%
+ \else%
+ \addpenalty{\@beginparpenalty}%
+ \addvspace{\svglstbelowskip}%
+ \fi%
+ \noindent%
+ \fbox{\parbox{\dimexpr\linewidth-(\fboxsep+\fboxrule)*2\relax}{#2}}%
+ \par\vskip#1\noindent\ignorespaces%
+}
+\makeatother
+
\begin{document}
\title{The packages \pkg{svg} and \pkg{svg-extract}}
\author{%
@@ -207,8 +217,8 @@
\begin{abstract}
\noindent
The \pkg{svg} package is intended for the automated integration of
- SVG~graphics into \LaTeX~documents. Therefor the capabilities provided
- by \app{Inkscape}---or more precisely its command~line~interface---are used
+ SVG~graphics into \LaTeX~documents. The capabilities provided by
+ \app{Inkscape}---or more precisely its command~line~interface---are used
to export the text within a SVG~graphic to a separate file, which is
then rendered by \LaTeX{}. The two commands \cs{includesvg} and
\cs{includeinkscape} are provided as central user\hbox{-}interface,
@@ -223,8 +233,7 @@
are required in other file formats, either \app{ImageMagick} or
\app{Ghostscript} can be invoked.
- \bigskip\noindent%
- \fbox{\parbox{\dimexpr\linewidth-(\fboxsep+\fboxrule)*2\relax}{%
+ \notebox[0pt]{%
The command~line~interface~(CLI) of \app{Inkscape}\,1.0 has changed in
comparison to previous versions. In order to provide a comfortable
user\hbox{-}interface for invoking \app{Inkscape}, the used version is
@@ -231,8 +240,8 @@
detected and if necessary switch to the outdated syntax of the CLI. If
this approach fails for some reason, you can set the version of
\app{Inkscape} manually with \opt{inkscapeversion}|=|\val{0} or
- \opt{inkscapeversion}|=|\val{1}.
- }}%
+ \opt{inkscapeversion}|=|\val{1}.%
+ }%
\end{abstract}
\tableofcontents
\DocInput{\filename}
@@ -267,10 +276,12 @@
% based on file modification date implemented for Xe\TeX{}}^^A
% \changes{v2.02f}{2020/05/06}{command~line~interface of \app{Inkscape~1.0}
% is supported}^^A
-% \changes{v2.02g}{2020/06/12}{fix for mutliple dots in file names (\#27)}^^A
+% \changes{v2.02g}{2020/06/12}{fix for multiple dots in file names (\#27)}^^A
% \changes{v2.02h}{2020/06/23}{fix for package \pkg{transparent} (\#28)}^^A
% \changes{v2.02i}{2020/09/29}{update for package \pkg{scrlfile} v3.32 and
% kernel (2020/10/01)}^^A
+% \changes{v2.02j}{2020/10/23}{bug fix for automatic version detection of
+% \app{Inkscape} with MiK\TeX}^^A
%
%
%
@@ -305,7 +316,7 @@
% known to the operating system. This can be checked on shell by typing
% \file{inkscape -V}. Moreover, there are some required packages which are
% loaded by packages \pkg{svg} and \pkg{svg-extract} to provide the
-% functionallity. These are:
+% functionality. These are:
% \begin{description}[parsep=\glueexpr\smallskipamount/2\relax]
% \item[\pkg{iftex}]
% for flow control depending on the used \LaTeX~engine
@@ -362,15 +373,21 @@
% end of package \pkg{svg}. The listed options are intended to prevent these
% packages from loading. They are the only options which have to be given while
% loading the \pkg{svg} package. All supported boolean values
-% (\val{true/on/yes/false/off/no}) can be assinged to \opt{usexcolor} and
+% (\val{true/on/yes/false/off/no}) can be assigned to \opt{usexcolor} and
% \opt{usetransparent}, while \opt{noxcolor} and \opt{notransparent} don't
% accept any value.
% \begin{svgexample}
% \usepackage§\oarg{options}§{svg}
% \end{svgexample}
+% \notebox[0pt]{^^A
+% Due to the way the \LaTeX~kernel parses package options, problems may occur
+% if any option other than those just mentioned above~-- meaning the options
+% explained hereafter~-- are passed through the optional argument of
+% \cs{usepackage}\oarg{options}|\{svg\}|. It is strongly recommended to use
+% \cs{svgsetup}\marg{options} for these after loading the package instead.^^A
+% }
%
%
-%
% \subsection{General settings}
%
% \DescribeMacro{\svgsetup}^^A
@@ -378,8 +395,8 @@
% the package either in the preamble or within the document. They don't have to
% be given as optional argument to \cs{usepackage}\oarg{options}|{svg}| but can
% be set by using macro \cs{svgsetup}\marg{options} where \meta{options} is a
-% comma separated list of options. Settings with \cs{svgsetup} are done in the
-% current scope which means globally or within the current group.
+% comma separated list of options. These settings are done in the current scope
+% which means either globally or within the current group.
% \begin{svgexample}
% \svgsetup§\marg{options}§
% \end{svgexample}
@@ -471,16 +488,22 @@
% For including a SVG~file, \app{Inkscape} is used to separate the text and
% image from the SVG~file itself. In order to use the command~line~interface
% on shell, the path where the executable is located has to be known to the
-% operating system and its name is assumed to be \val{inkscape} by default.
+% operating system and is assumed to be \val{inkscape} by default.
%
% You can check if the default setting is valid for your system by typing
% \file{inkscape -V} into the terminal. If this fails and nothing is returned,
% you should add the binary directory of \app{Inkscape} to the environment
-% variable \file{PATH} on your operating system. If this is not possible or you
-% aren't willing to do so, you can alternatively use option \opt{inkscapeexe}
-% \emph{within the document preamble} to set the absolute path where the
-% executable of \app{Inkscape} is located.
+% variable \file{PATH} on your operating system. For the case, that this is not
+% possible or you aren't willing to do so, you can alternatively pass option
+% \opt{inkscapeexe} to \cs{svgsetup} \emph{within the document preamble} to set
+% the absolute path where the executable of \app{Inkscape} is located.
%
+% \notebox[0pt]{^^A
+% Especially if the executable path to be defined \emph{contains spaces}, it
+% \emph{must not} be passed as a package option but to
+% \cs{svgsetup}|\{inkscapeexe=\dots\}| instead!^^A
+% }
+%
% \DescribeOption{inkscapeversion}^^A
% \changes{v2.02f}{2020/05/06}{option {inkscapeversion} for explicitly setting
% \app{Inkscape}-CLI version; automatic detection implemented}^^A
@@ -501,11 +524,11 @@
% legacy mode or \opt{inkscapeversion}|=|\val{1} to the current CLI~version.
%
% \DescribeOption{inkscapename}^^A
-% The file names of the \app{Inkscape}~export are derived from the name of the
-% base SVG~file by default. Nevertheless, the name of the exported file can be
-% customized with \opt{inkscapename}|=|\file{\meta{filename}}. It is possible
-% to use counters for specifying the name of the exported file. Repeatedly
-% specifying the same file name will overwrite previously created files.
+% \app{Inkscape}~export file~names are derived from the SVG~file~name by
+% default. However, the name of the exported file can be customized with
+% \opt{inkscapename}|=|\file{\meta{filename}}. It is possible to use counters
+% for specifying the name of the exported file. Repeatedly specifying the same
+% file~name will overwrite previously created files.
%
% \DescribeOption{inkscapeformat}^^A
% With this option, the \app{Inkscape}~export~format can be controlled. Valid
@@ -517,7 +540,7 @@
%
% \DescribeOption{inkscapelatex}^^A
% If option \opt{inkscapelatex}|=|\val{true} is set, the output is split into
-% a seperate PDF/EPS/PS~file (see option \opt{inkscapeformat}) and a
+% a separate PDF/EPS/PS~file (see option \opt{inkscapeformat}) and a
% corresponding \LaTeX~file. This is the default setting. Setting
% \opt{inkscapelatex}|=|\val{false} will result in a single PDF/EPS/PS~file,
% where any contained text won't be rendered by \LaTeX{}.
@@ -588,7 +611,7 @@
% \end{svgexample}
%
% \DescribeOption{draft}^^A
-% This option can be used with booelan values and is equal to the identically
+% This option can be used with boolean values and is equal to the identically
% named option of the \pkg{graphicx} package. If the \opt{draft} option is
% given to \pkg{graphicx}, it's activated for \pkg{svg} as well.
%
@@ -732,7 +755,7 @@
% numbering of the current \env{subfig} environment by default. As package
% \pkg{subfig} sometime causes problems and because of the large amount of
% different \LaTeX~packages which all provide the possibility to include
-% subfigures with very different implemetations, this feature can't be provided
+% subfigures with very different implementations, this feature can't be provided
% reliably by \pkg{svg-extract}. See option \opt{extractname} for further
% information.
%
@@ -757,8 +780,8 @@
% \cs{includeinkscape}\oarg{parameters}\marg{graphic~filename} are extended.
% They can be used to control the process of graphic extraction and converting.
%
-% All option described below can be used togehter with \cs{svgsetup} and are
-% then valid in the current scope. There also exist identically named
+% All options described below can be passed to \cs{svgsetup}\marg{options} and
+% are then valid in the current scope. There also exist identically named
% parameters for the optional arguments of
% \begin{svgexample}
% \includesvg§\oarg{parameters}\marg{svg~filename}§
@@ -809,7 +832,7 @@
%
%
%
-% \subsection{Extract independent grahic files\label{sec:extract}}
+% \subsection{Extract independent graphic files\label{sec:extract}}
%
% \DescribeOption{extract}^^A
% This option can be used with boolean values. Using \opt{extract}|=|\val{true}
@@ -849,11 +872,11 @@
% Same as above, but a prefix with the current enumerated count of SVG~files
% is used instead of the suffix.
% \item[numbered/section/numberedsection/sectionnumbered]
-% The file name is composed by the current enumerated count of SVG~files and
+% The file~name is composed by the current enumerated count of SVG~files and
% the present outline numbering.
% \item[\file{\meta{filename}}]
-% You can use any file name. It's possible to use counters for specifying the
-% name of the extracted file. Repeatedly specifying the same file name will
+% You can use any file~name. It's possible to use counters for specifying the
+% name of the extracted file. Repeatedly specifying the same file~name will
% overwrite previously created files.
% \end{DescribeValues}
%
@@ -928,13 +951,13 @@
% \end{svgexample}
%
% \DescribeOption{extractruns}^^A
-% When extracting independent grahic~files by compiling the generated auxiliary
+% When extracting independent graphic~files by compiling the generated auxiliary
% \LaTeX~file, it's maybe necessary to do multiple \LaTeX~iterations on this.
% The number of iterations is controlled with option \opt{extractruns}. It is
% set to \opt{extractruns}|=|\val{2} by default.
%
% \DescribeOptions{latexexe,latexopt,latexext}^^A
-% For the extraction of an independent grahic~file, the \LaTeX~program is used
+% For the extraction of an independent graphic~file, the \LaTeX~program is used
% which is set by the \opt{latexexe} option. Depending on the \LaTeX~engine
% used for the current \LaTeX~document, it is set to either \app{pdflatex},
% \app{lualatex}, \app{xelatex} or \app{latex} by default. It's also possible
@@ -972,7 +995,7 @@
% \DescribeMacros{\includesvg,\includeinkscape}^^A
% As previously mentioned, for extracting independent graphic files it is
% sufficient to load package \pkg{svg-extract} and afterwards everything
-% necassary is done by just using \cs{includesvg} or \cs{includeinkscape}.
+% necessary is done by just using \cs{includesvg} or \cs{includeinkscape}.
%
% \begin{DescribeParameterParent}{Macro}{\includesvg}^^A
% \DescribeParameter{extractangle}^^A
@@ -993,7 +1016,7 @@
%
%
%
-% \subsection{Convert extracted grahic files\label{sec:convert}}
+% \subsection{Convert extracted graphic files\label{sec:convert}}
%
% Based on the extraction of independent graphic~files, the \pkg{svg-extract}
% packages also provides the possibility to convert these extracted graphics in
@@ -1451,7 +1474,7 @@
% \end{macro}^^A \svg at ifwindowsdetected
% \begin{macro}{\svg at ifvalueisrelax}
% For some keys the usage of \val{\cs{relax}} as a value should lead to a
-% special reaction, such as restoring to default behavior or reseting the key.
+% special reaction, such as restoring to default behavior or resetting the key.
% Therefore, \cs{svg at ifvalueisrelax} checks, whether \val{\cs{relax}} was used
% as value or not.
% \begin{macrocode}
@@ -1504,8 +1527,8 @@
% \begin{macro}{\svg at deactivate@dq}
% \changes{v2.02}{2018/09/07}{new}^^A
% \changes{v2.02a}{2018/10/17}{bug fix for \pkg{polyglossia}}^^A
-% In order to avoid errors concerning file names with package \pkg{babel} and
-% it's active double quotes, this command is defined.
+% In order to avoid errors concerning file~names with package \pkg{babel} and
+% its active double quotes, this command is defined.
% \begin{macrocode}
\newcommand*\svg at deactivate@dq{}
\AfterAtEndOfPackage*{babel}{%
@@ -1617,7 +1640,7 @@
% \changes{v2.02}{2018/09/07}{usage of \cs{svg at remove@leadingchar}}^^A
% \changes{v2.02}{2018/09/07}{usage of \cs{svg at extension@parse}}^^A
% As the internal \LaTeX{} command \cs{filename at parse} is not able to split a
-% given file name containing quotes, \cs{svg at filename@parse} is defined to
+% given file~name containing quotes, \cs{svg at filename@parse} is defined to
% resolve this problem. The optional argument can be used to give a specific
% file extension, which should be searched within \cs{filename at ext}. If found
% at the very end, the previous part is appended to \cs{filename at base}.
@@ -1679,8 +1702,8 @@
% \changes{v2.02}{2018/09/07}{new}^^A
% \begin{macro}{\svg at extension@@parse}
% \changes{v2.02}{2018/09/07}{new}^^A
-% These macros are used to permit multiple dots in file names. The content of
-% \cs{filename at ext} is split at each occurence of \val{.} and the trailing part
+% These macros are used to permit multiple dots in file~names. The content of
+% \cs{filename at ext} is split at each occurrence of \val{.} and the trailing part
% is compared against the content of the argument of \cs{svg at extension@parse},
% which is probably \cs{svg at file@ext}. If they are equal, the previous part is
% appended to \cs{filename at base} and \cs{filename at ext} is set to the content of
@@ -1730,7 +1753,7 @@
\IfArgIsEmpty{#2}{}{%
\Ifstr{\detokenize{#2}}{\detokenize{#3.}}{%
% \end{macrocode}
-% If the trailing extension is found, \cs{svg at tempb} is definied.
+% If the trailing extension is found, \cs{svg at tempb} is defined.
% \begin{macrocode}
\edef\svg at tempb{#3}%
}{%
@@ -1746,7 +1769,7 @@
% \url{https://github.com/mrpiggi/svg/issues/12}}^^A
% The macro \cs{svg at iffilenewer} is used to decide, whether the export with
% \app{Inkscape} is necessary due to an updated SVG~file. This can only be
-% done, if \cs{pdf at filemoddate} or \cs{filemoddate} is definied.
+% done, if \cs{pdf at filemoddate} or \cs{filemoddate} is defined.
% \ToDo{\cs{svg at iffilenewer} instead \cs{IfFileExists} to check results}[v2.03]
% \begin{macrocode}
\newcommand*\svg at iffilenewer[2]{\@gobbletwo}
@@ -1789,7 +1812,7 @@
% \begin{macro}{\svg at shell@@mv}
% \begin{macro}{\svg at shell@rm}
% \begin{macro}{\svg at shell@@rm}
-% Finally, platform dependend macros for creating directories as well as
+% Finally, platform dependent macros for creating directories as well as
% moving and deleting files are provided.
% \begin{macrocode}
\newcommand*\svg at shell@mkdir[1]{%
@@ -1910,10 +1933,10 @@
% \section{Including SVG files with package \pkg{svg}}
% \subsection{Options}
%
-% All options, which can be set either as package options or with
-% \cs{svgsetup}, as well as the optional parameters for both user commands
-% \cs{includesvg}\oarg{parameters}\marg{svg~filename} and
-% \cs{includeinkscape}\oarg{parameters}\marg{graphic~filename} are defined with
+% All options, which are recommended to be set with \cs{svgsetup}\marg{options}
+% but are also available as package options, as well as the optional parameters
+% for both user commands \cs{includesvg}\oarg{parameters}\marg{svg~file}
+% and \cs{includeinkscape}\oarg{parameters}\marg{file} are defined with
% the interface provided by package \pkg{scrbase}.
% \begin{macrocode}
\DefineFamily{SVG}
@@ -2083,7 +2106,7 @@
% \begin{macrocode}
\ifx\FamilyKeyState\FamilyKeyStateProcessed\else% legacy option
% \end{macrocode}
-% Splitting executable from options with delimitted macros. After calling
+% Splitting executable from options with delimited macros. After calling
% \cs{svg at tempa} with the given value, the part for the executable is stored in
% \cs{svg at tempa} and the option part---which is recognized by the first |-|
% character--- in \cs{svg at tempb}.
@@ -2247,7 +2270,7 @@
% \changes{v2.00b}{2017/03/28}{new, alternative key for \opt{inkscapelatex}}^^A
% \begin{macro}{\svg at ink@latex}
% This option controls whether the \app{Inkscape} export will be invoked with
-% or without the generation of a seperate \LaTeX~file.
+% or without the generation of a separate \LaTeX~file.
% \begin{macrocode}
\newif\if at svg@ink at latex
\FamilyBoolKey{SVG}{inkscapelatex}{@svg at ink@latex}
@@ -2317,10 +2340,10 @@
\ifx\svg at ink@dpi\relax\else--export-dpi=\svg at ink@dpi\space\fi%
\if at svg@ink at latex--export-latex\space\fi%
\ifx\svg at ink@opt\@empty\else\svg at ink@opt\space\fi%
- \ifnum\svg at ink@ver=\z@%
+ \ifcase\svg at ink@ver\relax% 0.x detected
--without-gui\space%
--export-\svg at ink@format="#2.\svg at ink@format"%
- \else%
+ \else% 1.x or nothing detected
--export-filename="#2.\svg at ink@format"%
\fi%
}
@@ -2705,9 +2728,9 @@
% \changes{v2.00}{2017/02/17}{new}^^A
% \begin{macro}{\setsvg}
% \changes{v2.00}{2017/02/17}{deprecated}^^A
-% The macro \cs{svgsetup} can be used to change options after loading the
-% package \pkg{svg} both in preamble and the document body. For compatibility
-% reasons, \cs{setsvg} is also defined.
+% The macro \cs{svgsetup}\marg{options} can be used to change options after
+% loading packages \pkg{svg} or \pkg{svg-extract} both in preamble and the
+% document body. For compatibility reasons, \cs{setsvg} is also defined.
% \begin{macrocode}
\newcommand*\svgsetup{\FamilyOptions{SVG}}
\newcommand*\setsvg{\FamilyOptions{SVG}}
@@ -2856,7 +2879,7 @@
% \changes{v2.02}{2018/09/07}{validation of argument}^^A
% \begin{parameter}{origin}
% \changes{v2.00}{2017/02/17}{new}^^A
-% The parameters \prm{angle} and \prm{origin} are definied as pendants to the
+% The parameters \prm{angle} and \prm{origin} are defined as pendants to the
% keys provided by \cs{includegraphics}.
% \begin{macrocode}
\newcommand*\svg at param@angle{0}
@@ -3066,7 +3089,7 @@
\if at svg@ink at run%
\ifnum\pdf at shellescape=\@ne\relax%
% \end{macrocode}
-% For exporting PNG~files, the used density ist set to \val{300dpi}, if no
+% For exporting PNG~files, the used density is set to \val{300dpi}, if no
% value was given.
% \begin{macrocode}
\ifx\svg at ink@dpi\relax%
@@ -3087,44 +3110,16 @@
\svg at quotes@remove[\svg at file@base]{\svg at tempa}%
\svg at quotes@remove[\svg at out@name]{\svg at tempb}%
% \end{macrocode}
-% The last try to detect the version automatically, if this wasn't succesful
-% until now. We try to create the desired file by invoking the \app{Inkscape}
-% command~line~interface for both versions. If the desired file was created the
-% used version is stored in \cs{svg at ink@ver}.
+% The last try to detect the version automatically, if this wasn't successful
+% until now.
% \begin{macrocode}
\ifnum\svg at ink@ver=\m at ne\relax%
- \begingroup%
- \@svg at tempswafalse%
- \@tfor\svg at ink@ver:={1}{0}\do{%
- \ShellEscape{\svg at ink@cmd{\svg at tempa}{\svg at tempb}}%
- \IfFileExists{\svg at out@name.\svg at ink@format}{%
- \@svg at tempswatrue%
- }{}%
- \if at svg@tempswa%
- \@break at tfor%
- \fi%
- }%
+ \svg at ink@ver at explore{\svg at tempa}{\svg at tempb}{\svg at out@name}%
+ \fi%
% \end{macrocode}
-% If even this attempt does not lead to a valid version, an error message is
-% shown.
+% Now it's time to actually create the desired graphic.
% \begin{macrocode}
- \if at svg@tempswa%
- \xdef\svg at ink@ver{\svg at ink@ver}%
- \else%
- \PackageError{svg}{Inkscape version not detected}{%
- It was tried to invoke `\svg at ink@exe'\MessageBreak%
- for file "\svg at tempa.\svg at file@ext"\MessageBreak%
- but no result was produced. Check the log file\MessageBreak%
- and set `inkscapeversion=<version>' manually.%
- }%
- \fi%
- \endgroup%
-% \end{macrocode}
-% If we already do have a valid version, we on have to invoke the CLI itself.
-% \begin{macrocode}
- \else%
- \ShellEscape{\svg at ink@cmd{\svg at tempa}{\svg at tempb}}%
- \fi%
+ \ShellEscape{\svg at ink@cmd{\svg at tempa}{\svg at tempb}}%
\IfFileExists{\svg at out@name.\svg at ink@format}{%
\edef\svg at tempb{\svg at tempb.\svg at ink@format}%
\svg at quotes@remove{\svg at out@base}%
@@ -3473,35 +3468,70 @@
\newcommand*\svg@@ink at ver@detect{%
\begingroup%
\@makeother\|%
- \endlinechar=\m at ne%
+ \@makeother\&%
\everyeof{\noexpand}%
\svg at quotes@remove{\svg at ink@exe}%
+% \end{macrocode}
+% Here |stderr| is redirected to |stdout| in order to fetch all information
+% from \app{Inkscape} (some are passed via |stderr| [sic]) as well as pass any
+% found error message to the user.
+% \begin{macrocode}
\edef\svg at tempa{%
- \edef\noexpand\svg at tempa{\noexpand\@@input|"'\svg at ink@exe'\space-V" }%
+ \edef\noexpand\svg at tempa{\noexpand\@@input|"'\svg at ink@exe' -V 2>&1" }%
}%
\svg at tempa%
+ \trim at spaces@in\svg at tempa%
% \end{macrocode}
-% The invocation of commands through a pipe is buggy for MiK\TeX so we try to
-% deal with this workaround: \url{https://github.com/MiKTeX/miktex/issues/532}
-% \ToDo{Markup for link to issue}[v2.03]
+% \ToDo{remove workaround when fixed}[MiKTeX]
+% The invocation of commands through a pipe is buggy for MiK\TeX{} especially
+% for Xe\LaTeX{} (\url{https://github.com/MiKTeX/miktex/issues/648}). Either
+% |stdout| or |stderr| if former not present gets swallowed and |stderr| or
+% \cs{par} is returned\dots
% \begin{macrocode}
- \ifx\svg at tempa\@empty%
- \svg at ifwindowsdetected{%
- \def\svg at tempb{\jobname.svg.ink.ver.aux}%
- \IfFileExists{\svg at tempb}{}{%
- \ShellEscape{call "\svg at ink@exe" -V > \svg at tempb}%
- \openin\@inputcheck=\svg at tempb%
- \read\@inputcheck to\svg at tempa%
- \closein\@inputcheck%
- \ShellEscape{del \svg at tempb}%
- }%
- }{}%
+ \def\svg at tempb{\par}%
+ \ifx\svg at tempa\svg at tempb
+ \let\svg at tempa\relax%
\fi%
% \end{macrocode}
-% The found version is stored in \cs{svg at tempa} and parsed afterwards.
+% The found version is stored in \cs{svg at tempa} and parsed afterwards. Any
+% other output than the expected format is considered as error message, which
+% is picked up with |##1|.
% \begin{macrocode}
- \def\svg at tempb Inkscape ##1.##2\@nil{%
- \gdef\svg at ink@ver{##1}%
+ \def\svg at tempb ##1Inkscape ##2.##3\@nil{%
+ \gdef\svg at ink@ver{##2}%
+ \IfArgIsEmpty{##1}{}{%
+% \end{macrocode}
+% \ToDo{replace workaround with simple warning}[MiKTeX]
+% With \app{Inkscape}\,1.0 the additional version information for \app{Pango}
+% is passed via |stderr| but |stdout| is gobbled, so this can be used to
+% indetify the version.
+% \begin{macrocode}
+%^^A \PackageWarning{svg}{%
+%^^A `\svg at ink@exe\space-V' failed with:\MessageBreak%
+%^^A \detokenize{##1}%
+%^^A }%
+ \def\svg at tempc ####1Pango version:####2\@nil{%
+ \@svg at tempswafalse%
+ \IfArgIsEmpty{####2}{}{\IfArgIsEmpty{####1}{\@svg at tempswatrue}{}}%
+ }%
+ \svg at tempc ##1 Pango version:\@nil%
+ \if at svg@tempswa%
+ \gdef\svg at ink@ver{1}%
+ \else%
+% \end{macrocode}
+% No messages can be passed for MiKTeX/XeLaTeX.
+% \begin{macrocode}
+ \ifx\svg at tempa\relax%
+ \def\svg at tempa{MiKTeX/XeLaTeX did not return an error message}%
+ \else%
+ \def\svg at tempa{##1}%
+ \fi%
+ \PackageWarning{svg}{%
+ `\svg at ink@exe\space-V' failed with:\MessageBreak%
+ \detokenize\expandafter{\svg at tempa}%
+ }%
+ \fi%
+ }%
}%
\expandafter\svg at tempb\svg at tempa Inkscape \m at ne.\@nil%
\endgroup%
@@ -3525,9 +3555,45 @@
% \end{macro}^^A \svg@@ink at ver@detect
% \end{macro}^^A \svg at ink@ver at detect
% \end{macro}^^A \svg at ink@ver at settings
+% \begin{macro}{\svg at ink@ver at explore}
+% \changes{v2.02j}{2020/10/23}{new}^^A
+% If detecting the used version automatically with \file{inkscape -V} was not
+% successful, it is tried to explore this by calling \app{Inkscape} through its
+% command~line~interface with all known variations. If the desired file was
+% created the used version is stored in \cs{svg at ink@ver}.
+% \begin{macrocode}
+\newcommand*\svg at ink@ver at explore[3]{%
+ \begingroup%
+ \@svg at tempswafalse%
+ \@tfor\svg at ink@ver:={1}{0}\do{%
+ \ShellEscape{\svg at ink@cmd{#1}{#2}}%
+ \IfFileExists{#3.\svg at ink@format}{\@svg at tempswatrue}{}%
+% \end{macrocode}
+% An output file was found, break loop.
+% \begin{macrocode}
+ \if at svg@tempswa%
+ \@break at tfor%
+ \fi%
+ }%
+% \end{macrocode}
+% If even this attempt fails, an error message is shown.
+% \begin{macrocode}
+ \if at svg@tempswa%
+ \xdef\svg at ink@ver{\svg at ink@ver}%
+ \else%
+ \PackageError{svg}{Inkscape version not detected}{%
+ It was tried to invoke `\svg at ink@exe'\MessageBreak%
+ for file "#1.\svg at file@ext"\MessageBreak%
+ but no result was produced. Check the log file\MessageBreak%
+ and set `inkscapeversion=<version>' manually.%
+ }%
+ \fi%
+ \endgroup%
+}
+% \end{macrocode}
+% \end{macro}^^A \svg at ink@ver at explore
%
%
-%
% \subsection{Handling path and file names}
%
% \begin{macro}{\svg at set@input at path}
@@ -3645,7 +3711,7 @@
\svg at set@input at path[{#3}]%
% \end{macrocode}
% The specified file is searched with \cs{IfFileExists}. If the file search was
-% succesful, the macro \cs{svg at filename@parse} is called with the result.
+% successful, the macro \cs{svg at filename@parse} is called with the result.
% \begin{macrocode}
\@svg at tempswafalse%
\expandafter\IfFileExists\expandafter{\svg at tempa}{%
@@ -3810,9 +3876,9 @@
% \section{Extracting independent graphic files with \pkg{svg-extract}}
% \subsection{Options}
%
-% For package \pkg{svg-extract} the user\hbox{-}interface is extended. The
-% following options can either be set with \cs{svgsetup} or be used as local
-% optional parameters for \cs{includesvg} and \cs{includeinkscape}.
+% For package \pkg{svg-extract} the user\hbox{-}interface of package \pkg{svg}
+% is extended. The following options can either be set with \cs{svgsetup} or be
+% used as optional parameters for \cs{includesvg} and \cs{includeinkscape}.
%
% \begin{macro}{\svg at dummy@key}
% If package \pkg{svg-extract} wasn't loaded, the following options are defined
@@ -4345,7 +4411,7 @@
% targeted for a specific format. It's also possible to use something like
% \val{500x300}. Given values are resolved by \cs{svgx at cnv@get at dpi}. It's used
% like \opt{convertdpi}|=|\val{300} or \opt{convertdpi}|=|\val{\{png=600\}} If
-% the option is used for a specific or for all output formats is recocnized by
+% the option is used for a specific or for all output formats is recognized by
% \cs{svgx at ifkeyandval}.
% \begin{macrocode}
%<*main>
@@ -4483,7 +4549,7 @@
}
% \end{macrocode}
% The command \cs{svgx at useformatkey} checks, if a format specific key was
-% definded with \cs{svgx at setformatkey}, whereas the format is given in the
+% defined with \cs{svgx at setformatkey}, whereas the format is given in the
% second argument. If this is not the case, the setting for all output formats
% is used. After that, a specific key appended with a |+| can be used to do
% some additional stuff.
@@ -4765,7 +4831,7 @@
% \begin{macro}{\svgx at param@scale}
% For graphic extraction, the given settings regarding the size for inclusion
% can be overwritten with these options. Using \val{\cs{relax}} as value leads
-% to reseting an option as unset, regardless of what was previously given. The
+% to resetting an option as unset, regardless of what was previously given. The
% value \val{inherit} means, that the actual option for including is used for
% extraction as well. This is the default setting.
% \begin{macrocode}
@@ -5242,7 +5308,7 @@
% \begin{macro}{\svg at extract}
% If flag \file{-{}-shell-escape} is enabled, the command is defined with its
% intended functionality. It runs all necessary processes to extract and
-% convert grahic files.
+% convert graphic files.
% \begin{macrocode}
\renewcommand*\svg at extract[1]{%
% \end{macrocode}
@@ -5297,7 +5363,7 @@
`\svgx at out@name.\svgx at latex@ext'%
}%
% \end{macrocode}
-% The catcodes for |#| need to be changed to prevent doublification when
+% The catcodes for |#| need to be changed to prevent doubling when
% reading the line.
% \begin{macrocode}
\catcode`\#=12\relax%
@@ -5580,7 +5646,7 @@
\repeat%
% \end{macrocode}
% All files requested with option \opt{extractformat} are created with internal
-% conversion tools supplied by most \LaTeXe~distributions if necessary.
+% conversion tools supplied by most \LaTeX~distributions if necessary.
% \begin{macrocode}
\def\svg at tempa##1##2##3{%
\edef\svg at tempb{%
@@ -5718,7 +5784,7 @@
% \begin{macro}{\svgx at documentclass}
% \begin{macro}{\if at svgx@classfound}
% This delimited macro is used to find the occurrence of \cs{documentclass}
-% within a read in line. The delinmiter \cs{documentclass} is used twice in
+% within a read in line. The delimiter \cs{documentclass} is used twice in
% order to ignore the possible occurrence of white space or anything else right
% before \cs{documentclass}.
% \begin{macrocode}
@@ -5894,7 +5960,7 @@
% \changes{v2.02}{2018/09/07}{new}^^A
% \begin{macro}{\if at svgx@standalone}
% \changes{v2.02}{2018/09/07}{new}^^A
-% Within the preamble of the auxiliary \LaTeX~file, the desired grahic is used
+% Within the preamble of the auxiliary \LaTeX~file, the desired graphic is used
% to setup a box, which is used both to define the papersize as well as for the
% output itself. The macro \cs{svgx at setbox} is executed twice, the first time
% in the preamble and the second time at the very end of \cs{AtBeginDocument}
@@ -6034,349 +6100,3 @@
% \Finale
%
\endinput
-%
-% \iffalse
-%<*package&old>
-% \fi
-%
-%
-%
-% \section{Old Implementation}
-%
-% The package, which requires the packages \pkg{xkeyval} for the options,
-% \pkg{subfig} for automatic labeling within the subfigure command, the
-% \pkg{import} package for correct handling of paths, \pkg{graphicx} for the
-% PDF~file inclusion commands, \pkg{transparent} for transparency, and
-% \pkg{xcolor} for color, is initialized.
-% \begin{macrocode}
-\ProvidesPackage{svg}[2012/09/05 v1.0 SVG inclusion and extraction]%
-\@ifpackageloaded{xkeyval}{}{\RequirePackage{xkeyval}}%
-\@ifpackageloaded{subfig}{}{\RequirePackage{subfig}}%
-\@ifpackageloaded{import}{}{\RequirePackage{import}}%
-\@ifpackageloaded{graphicx}{}{\RequirePackage{graphicx}}%
-\@ifpackageloaded{transparent}{}{\RequirePackage{transparent}}%
-\@ifpackageloaded{xcolor}{}{\RequirePackage{xcolor}}%
-% \end{macrocode}
-%
-%
-%
-% \subsection{Input definition}
-%
-% All commands used for input (i.e. for the SVG~file and preamble) are
-% defined within the \cs{SVG at in} prefix, and set by the key definition of the
-% line following their definition. The \opt{exclude} boolean, used to stop the
-% inclusion of the SVG~file within the document is also defined.
-% \begin{macrocode}
-\def\SVG at in@preamble{\jobname.tex}%
-\define at key[SVG]{svg.sty}{preamble}{\def\SVG at in@preamble{#1}}%
-\def\SVG at in@path{./}%
-\define at key[SVG]{svg.sty}{svgpath}{\def\SVG at in@path{#1}}%
-\def\SVG at in@end{\begin{document}}%
-\define at key[SVG]{svg.sty}{end}{\def\SVG at in@end{#1}}%
-\define at boolkey[SVG]{svg.sty}[SVG at in@]{exclude}[true]{}%
-% \end{macrocode}
-%
-%
-%
-% \subsection{Length definition}
-%
-% All commands used for output are defined within the \cs{SVG at out} prefix,
-% beginning with the dimensions of the extracted image. If no dimensions are
-% supplied both \cs{ifSVG at out@usewidth} and \cs{ifSVG at out@useheight} are
-% \val{false}, and so the natural dimensions of the SVG~file are used.
-% If both \cs{ifSVG at out@usewidth} and \cs{ifSVG at out@useheight} are
-% \val{true}, the width is used.
-% \begin{macrocode}
-\newlength\SVG at out@width%
-\newif\ifSVG at out@usewidth%
-\define at key[SVG]{svg.sty}{width}{%
- \setlength{\SVG at out@width}{#1}\SVG at out@usewidthtrue%
-}%
-\newlength\SVG at out@height%
-\newif\ifSVG at out@useheight%
-\define at key[SVG]{svg.sty}{height}{%
- \setlength{\SVG at out@height}{#1}\SVG at out@useheighttrue%
-}%
-% \end{macrocode}
-%
-%
-%
-% \subsection{Extract booleans}
-%
-% The booleans for the extraction formats are defined. Additionally,
-% the global export variable is defined, which is set to \val{true}
-% whenever any extraction is requested.
-% \begin{macrocode}
-\define at boolkey[SVG]{svg.sty}[SVG at out@]{pdf}[true]{}%
-\define at boolkey[SVG]{svg.sty}[SVG at out@]{eps}[true]{}%
-\define at boolkey[SVG]{svg.sty}[SVG at out@]{png}[true]{}%
-\newif\ifSVG at out@extract
-% \end{macrocode}
-%
-%
-%
-% \subsection{Output definitions}
-%
-% The extraction path, extraction root name, clean boolean,
-% pre-\LaTeX~commands, and post-\LaTeX~commands are defined.
-% \begin{macrocode}
-\def\SVG at out@path{./}%
-\define at key[SVG]{svg.sty}{path}{\def\SVG at out@path{#1}}%
-\def\SVG at out@name{Fig.\arabic{svgfigure}\alph{subfigure}}%
-\define at key[SVG]{svg.sty}{name}{\def\SVG at out@name{#1}}%
-\define at boolkey[SVG]{svg.sty}[SVG at out@]{clean}[true]{}%
-\def\SVG at out@pretex{}%
-\define at key[SVG]{svg.sty}{pretex}{\def\SVG at out@pretex{#1}}%
-\def\SVG at out@postex{}%
-\define at key[SVG]{svg.sty}{postex}{\def\SVG at out@postex{#1}}%
-% \end{macrocode}
-%
-%
-%
-% \subsection{Command definitions}
-%
-% The command options are defined within the prefix \cs{SVG at cmd} and
-% are set by the key definition following each command definition.
-% \begin{macrocode}
-\def\SVG at cmd@inkscape{inkscape -z -C}%
-\define at key[SVG]{svg.sty}{inkscape}{\def\SVG at cmd@inkscape{#1}}%
-\def\SVG at cmd@pdflatex{pdflatex}%
-\define at key[SVG]{svg.sty}{pdflatex}{\def\SVG at cmd@pdflatex{#1}}%
-\def\SVG at cmd@pdftops{pdftops -eps}%
-\define at key[SVG]{svg.sty}{pdftops}{\def\SVG at cmd@pdftops{#1}}%
-\def\SVG at cmd@convert{convert -density 300}%
-\define at key[SVG]{svg.sty}{convert}{\def\SVG at cmd@convert{#1}}%
-% \end{macrocode}
-%
-%
-%
-% \subsection{Process options}
-%
-% All the options for the package are processed, and a counter is defined,
-% which is used to correctly handle the \cnt{subfigure} counting.
-% \begin{macrocode}
-\ProcessOptionsX[SVG]%
-\newcounter{svgfigure}[figure]%
-% \end{macrocode}
-%
-%
-%
-% \subsection{User interface}
-%
-% Define the macro to globally set keys.
-% \begin{macrocode}
-\def\setsvg#1{\setkeys[SVG]{svg.sty}{#1}}%
-% \end{macrocode}
-%
-% Define the macro used to include a SVG~file. Set the keys and
-% determine if extraction should occur.
-% \begin{macrocode}
-\newread\SVG at in@file%
-\newwrite\SVG at out@file%
-\def\includesvg{\@ifnextchar[\@includesvg{\@includesvg[]}}%
-\def\@includesvg[#1]#2{%
- \setkeys[SVG]{svg.sty}{#1}%
- \SVG at out@extractfalse%
- \ifSVG at out@pdf \SVG at out@extracttrue \fi%
- \ifSVG at out@eps \SVG at out@extracttrue \fi%
- \ifSVG at out@png \SVG at out@extracttrue \fi%
-% \end{macrocode}
-% Run \app{Inkscape} to separate the SVG~file into text and image. Only
-% run \app{Inkscape} if the SVG~file is newer than the generated text
-% and image.
-% \begin{macrocode}
- \ifnum\pdfstrcmp{%
- \pdffilemoddate{\SVG at in@path#2.svg}%
- }{%
- \pdffilemoddate{\SVG at in@path#2.pdf}%
- }>0\relax%
- \immediate\write18{%
- \SVG at cmd@inkscape\space%
- -f \SVG at in@path#2.svg\space%
- -A \SVG at in@path#2.pdf\space%
- --export-latex%
- }%
- \fi%
-% \end{macrocode}
-% Determine the image width and height using \cs{includegraphics}.
-% \begin{macrocode}
- \ifSVG at out@usewidth%
- \settoheight\SVG at out@height{%
- \includegraphics[width=\SVG at out@width]{\SVG at in@path#2}%
- }%
- \else%
- \ifSVG at out@useheight%
- \settowidth\SVG at out@width{%
- \includegraphics[height=\SVG at out@height]{\SVG at in@path#2}%
- }%
- \else%
- \settoheight\SVG at out@height{%
- \includegraphics{\SVG at in@path#2}%
- }%
- \settowidth\SVG at out@width{\includegraphics{\SVG at in@path#2}}%
- \fi%
- \fi%
-% \end{macrocode}
-% Open the output file for extraction.
-% \begin{macrocode}
-% Open the output file.
- \ifSVG at out@extract%
- \setcounter{svgfigure}{\value{figure}}%
- \stepcounter{svgfigure}%
- \def\SVG at out@filename{\SVG at out@name}%
- \immediate\openout\SVG at out@file=\SVG at out@path\SVG at out@filename.tex%
- \fi%
-% \end{macrocode}
-% Open and write the preamble. Notice that the catcodes for |#| need
-% to be changed to prevent double expansion when reading the line.
-% \begin{macrocode}
- \ifSVG at out@extract%
- \def\SVG at in@line{}%
- \immediate\openin\SVG at in@file=\SVG at in@preamble%
- \fi%
- \newif\ifSVG at in@read%
- \ifSVG at out@extract \SVG at in@readtrue \fi%
- \@whilesw\ifSVG at in@read\fi{%
- \catcode`\#=12\relax\endlinechar=-1%
- \immediate\read\SVG at in@file to \SVG at in@line%
- \ifx\SVG at in@end\SVG at in@line%
- \SVG at in@readfalse%
- \else%
- \immediate\write\SVG at out@file{\unexpanded\expandafter{\SVG at in@line}}%
- \fi%
- \ifeof\SVG at in@file\SVG at in@readfalse\fi%
- \endlinechar=13\catcode`\#=6\relax%
- }%
- \ifSVG at out@extract \immediate\closein\SVG at in@file \fi%
-% \end{macrocode}
-% Now write everything needed after the preamble. This includes
-% requiring the \pkg{import} package and defining all the dimensions need
-% to match the document size with the image size.
-% \begin{macrocode}
- \ifSVG at out@extract%
- \def\SVG at out@defpack{%
- \makeatletter%
- \@ifpackageloaded{import}{}{\RequirePackage{import}}%
- \@ifpackageloaded{graphicx}{}{\RequirePackage{graphicx}}%
- \@ifpackageloaded{transparent}{}{\RequirePackage{transparent}}%
- \@ifpackageloaded{xcolor}{}{\RequirePackage{xcolor}}%
- \makeatother%
- }%
- \def\SVG at out@defwidth{\def\svgwidth{0.99\textwidth}}%
- \def\SVG at out@definput{\import{\SVG at in@path}{#2.pdf_tex}}%
- \immediate\write\SVG at out@file{\unexpanded\expandafter{\SVG at out@defpack}}%
- \immediate\write\SVG at out@file{%
- \noexpand\setlength{\pdfpagewidth}{\the\SVG at out@width}%
- }%
- \immediate\write\SVG at out@file{%
- \noexpand\setlength{\pdfpageheight}{\the\SVG at out@height}%
- }%
- \immediate\write\SVG at out@file{%
- \noexpand\setlength{\paperheight}{\pdfpageheight}%
- }%
- \immediate\write\SVG at out@file{%
- \noexpand\setlength{\paperwidth}{\pdfpagewidth}%
- }%
- \immediate\write\SVG at out@file{%
- \noexpand\setlength{\textheight}{\paperheight}%
- }%
- \immediate\write\SVG at out@file{%
- \noexpand\setlength{\textwidth}{\paperwidth}%
- }%
- \immediate\write\SVG at out@file{%
- \noexpand\setlength{\textheight}{\paperheight}%
- }%
- \immediate\write\SVG at out@file{\noexpand\setlength{\oddsidemargin}{-1in}}%
- \immediate\write\SVG at out@file{\noexpand\setlength{\evensidemargin}{-1in}}%
- \immediate\write\SVG at out@file{\noexpand\setlength{\topmargin}{-1in}}%
- \immediate\write\SVG at out@file{\noexpand\setlength{\headheight}{0in}}%
- \immediate\write\SVG at out@file{\noexpand\setlength{\headsep}{0in}}%
- \immediate\write\SVG at out@file{\noexpand\setlength{\topskip}{0in}}%
- \immediate\write\SVG at out@file{\noexpand\setlength{\footskip}{0in}}%
- \immediate\write\SVG at out@file{\noexpand\setlength{\parindent}{0in}}%
- \immediate\write\SVG at out@file{\noexpand\setlength{\parsep}{0in}}%
- \immediate\write\SVG at out@file{\noexpand\setlength{\parskip}{0in}}%
- \immediate\write\SVG at out@file{%
- \noexpand\begin{document}%
- \noexpand\pagestyle{empty}%
- \noexpand\begin{center}%
- \unexpanded\expandafter{\SVG at out@defwidth}%
- \unexpanded\expandafter{\SVG at out@pretex}%
- \expandafter\noexpand\SVG at out@definput%
- \unexpanded\expandafter{\SVG at out@postex}%
- \noexpand\end{center}%
- \noexpand\end{document}%
- }%
- \immediate\closeout\SVG at out@file%
- \fi%
-% \end{macrocode}
-% Run \LaTeX{} on the extracted file and create the PDF~file.
-% \begin{macrocode}
- \ifSVG at out@extract%
- \immediate\write18{%
- \SVG at cmd@pdflatex\space\SVG at out@path\SVG at out@filename.tex%
- }%
- \fi%
-% \end{macrocode}
-% Convert the PDF~file to EPS~file if requested.
-% \begin{macrocode}
- \ifSVG at out@eps%
- \immediate\write18{\SVG at cmd@pdftops\space\SVG at out@filename.pdf}%
- \immediate\write18{%
- mv \SVG at out@filename.eps\space\SVG at out@path\SVG at out@filename.eps%
- }%
- \fi%
-% \end{macrocode}
-% Convert the PDF~file to PNG~file if requested.
-% \begin{macrocode}
- \ifSVG at out@png%
- \immediate\write18{%
- \SVG at cmd@convert\space%
- \SVG at out@filename.pdf\space\SVG at out@filename.png%
- }%
- \immediate\write18{%
- mv \SVG at out@filename.png\space\SVG at out@path\SVG at out@filename.png%
- }%
- \fi%
-% \end{macrocode}
-% Clean up if requested.
-% \begin{macrocode}
- \ifSVG at out@extract%
- \ifSVG at out@pdf%
- \immediate\write18{%
- mv \SVG at out@filename.pdf\space\SVG at out@path\SVG at out@filename.pdf%
- }%
- \else%
- \ifSVG at out@clean \immediate\write18{rm \SVG at out@filename.pdf} \fi%
- \fi%
- \ifSVG at out@clean%
- \immediate\write18{%
- rm
- \SVG at out@path\SVG at out@filename.tex\space%
- \SVG at out@filename.aux\space%
- \SVG at out@filename.log\space%
- \SVG at out@filename.out%
- }%
- \fi%
- \fi%
-% \end{macrocode}
-% Finally, include the SVG~file in the current document and end the package.
-% \begin{macrocode}
- \ifSVG at in@exclude\else%
- {%
- \def\svgwidth{\the\SVG at out@width}%
- \SVG at out@pretex%
- \import{\SVG at in@path}{#2.pdf_tex}%
- \SVG at out@postex%
- }%
- \fi%
-}%
-% \end{macrocode}
-%
-% \iffalse
-%</package&old>
-% \fi
-%
-% \Finale
-%
-\endinput
Modified: trunk/Master/texmf-dist/tex/latex/svg/svg-extract.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/svg/svg-extract.sty 2020-10-24 20:26:58 UTC (rev 56747)
+++ trunk/Master/texmf-dist/tex/latex/svg/svg-extract.sty 2020-10-24 20:27:26 UTC (rev 56748)
@@ -63,7 +63,7 @@
}%
\svg at Provides%
{svg-extract}{extract graphics from SVG pictures}%
- [2020/09/29 v2.02i]%
+ [2020/10/23 v2.02j]%
\@tempb
\edef\svg at catcodecodes@restore{%
\catcode`\noexpand\"\the\catcode`\"\relax%
Modified: trunk/Master/texmf-dist/tex/latex/svg/svg.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/svg/svg.sty 2020-10-24 20:26:58 UTC (rev 56747)
+++ trunk/Master/texmf-dist/tex/latex/svg/svg.sty 2020-10-24 20:27:26 UTC (rev 56748)
@@ -61,7 +61,7 @@
}%
\svg at 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 at ink@dpi\relax\else--export-dpi=\svg at ink@dpi\space\fi%
\if at svg@ink at latex--export-latex\space\fi%
\ifx\svg at ink@opt\@empty\else\svg at ink@opt\space\fi%
- \ifnum\svg at ink@ver=\z@%
+ \ifcase\svg at ink@ver\relax% 0.x detected
--without-gui\space%
--export-\svg at ink@format="#2.\svg at ink@format"%
- \else%
+ \else% 1.x or nothing detected
--export-filename="#2.\svg at ink@format"%
\fi%
}
@@ -980,31 +980,9 @@
\svg at quotes@remove[\svg at file@base]{\svg at tempa}%
\svg at quotes@remove[\svg at out@name]{\svg at tempb}%
\ifnum\svg at ink@ver=\m at ne\relax%
- \begingroup%
- \@svg at tempswafalse%
- \@tfor\svg at ink@ver:={1}{0}\do{%
- \ShellEscape{\svg at ink@cmd{\svg at tempa}{\svg at tempb}}%
- \IfFileExists{\svg at out@name.\svg at ink@format}{%
- \@svg at tempswatrue%
- }{}%
- \if at svg@tempswa%
- \@break at tfor%
- \fi%
- }%
- \if at svg@tempswa%
- \xdef\svg at ink@ver{\svg at ink@ver}%
- \else%
- \PackageError{svg}{Inkscape version not detected}{%
- It was tried to invoke `\svg at ink@exe'\MessageBreak%
- for file "\svg at tempa.\svg at file@ext"\MessageBreak%
- but no result was produced. Check the log file\MessageBreak%
- and set `inkscapeversion=<version>' manually.%
- }%
- \fi%
- \endgroup%
- \else%
- \ShellEscape{\svg at ink@cmd{\svg at tempa}{\svg at tempb}}%
+ \svg at ink@ver at explore{\svg at tempa}{\svg at tempb}{\svg at out@name}%
\fi%
+ \ShellEscape{\svg at ink@cmd{\svg at tempa}{\svg at tempb}}%
\IfFileExists{\svg at out@name.\svg at ink@format}{%
\edef\svg at tempb{\svg at tempb.\svg at ink@format}%
\svg at quotes@remove{\svg at out@base}%
@@ -1228,27 +1206,40 @@
\newcommand*\svg@@ink at ver@detect{%
\begingroup%
\@makeother\|%
- \endlinechar=\m at ne%
+ \@makeother\&%
\everyeof{\noexpand}%
\svg at quotes@remove{\svg at ink@exe}%
\edef\svg at tempa{%
- \edef\noexpand\svg at tempa{\noexpand\@@input|"'\svg at ink@exe'\space-V" }%
+ \edef\noexpand\svg at tempa{\noexpand\@@input|"'\svg at ink@exe' -V 2>&1" }%
}%
\svg at tempa%
- \ifx\svg at tempa\@empty%
- \svg at ifwindowsdetected{%
- \def\svg at tempb{\jobname.svg.ink.ver.aux}%
- \IfFileExists{\svg at tempb}{}{%
- \ShellEscape{call "\svg at ink@exe" -V > \svg at tempb}%
- \openin\@inputcheck=\svg at tempb%
- \read\@inputcheck to\svg at tempa%
- \closein\@inputcheck%
- \ShellEscape{del \svg at tempb}%
+ \trim at spaces@in\svg at tempa%
+ \def\svg at tempb{\par}%
+ \ifx\svg at tempa\svg at tempb
+ \let\svg at tempa\relax%
+ \fi%
+ \def\svg at tempb ##1Inkscape ##2.##3\@nil{%
+ \gdef\svg at ink@ver{##2}%
+ \IfArgIsEmpty{##1}{}{%
+ \def\svg at tempc ####1Pango version:####2\@nil{%
+ \@svg at tempswafalse%
+ \IfArgIsEmpty{####2}{}{\IfArgIsEmpty{####1}{\@svg at tempswatrue}{}}%
}%
- }{}%
- \fi%
- \def\svg at tempb Inkscape ##1.##2\@nil{%
- \gdef\svg at ink@ver{##1}%
+ \svg at tempc ##1 Pango version:\@nil%
+ \if at svg@tempswa%
+ \gdef\svg at ink@ver{1}%
+ \else%
+ \ifx\svg at tempa\relax%
+ \def\svg at tempa{MiKTeX/XeLaTeX did not return an error message}%
+ \else%
+ \def\svg at tempa{##1}%
+ \fi%
+ \PackageWarning{svg}{%
+ `\svg at ink@exe\space-V' failed with:\MessageBreak%
+ \detokenize\expandafter{\svg at tempa}%
+ }%
+ \fi%
+ }%
}%
\expandafter\svg at tempb\svg at tempa Inkscape \m at ne.\@nil%
\endgroup%
@@ -1261,6 +1252,28 @@
}%
\fi%
}
+\newcommand*\svg at ink@ver at explore[3]{%
+ \begingroup%
+ \@svg at tempswafalse%
+ \@tfor\svg at ink@ver:={1}{0}\do{%
+ \ShellEscape{\svg at ink@cmd{#1}{#2}}%
+ \IfFileExists{#3.\svg at ink@format}{\@svg at tempswatrue}{}%
+ \if at svg@tempswa%
+ \@break at tfor%
+ \fi%
+ }%
+ \if at svg@tempswa%
+ \xdef\svg at ink@ver{\svg at ink@ver}%
+ \else%
+ \PackageError{svg}{Inkscape version not detected}{%
+ It was tried to invoke `\svg at ink@exe'\MessageBreak%
+ for file "#1.\svg at file@ext"\MessageBreak%
+ but no result was produced. Check the log file\MessageBreak%
+ and set `inkscapeversion=<version>' manually.%
+ }%
+ \fi%
+ \endgroup%
+}
\newcommand*\svg at set@input at path[1][]{%
\begingroup%
\svg at deactivate@dq%
More information about the tex-live-commits
mailing list.