summaryrefslogtreecommitdiff
path: root/graphics/svg/source
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/svg/source')
-rw-r--r--graphics/svg/source/svg.dtx75
1 files changed, 48 insertions, 27 deletions
diff --git a/graphics/svg/source/svg.dtx b/graphics/svg/source/svg.dtx
index 7715e96811..8952e01128 100644
--- a/graphics/svg/source/svg.dtx
+++ b/graphics/svg/source/svg.dtx
@@ -1,4 +1,4 @@
-% \CheckSum{3838}
+% \CheckSum{3884}
% \iffalse meta-comment
%
% svg and svg-extract -- Include and extract SVG pictures in LaTeX documents
@@ -111,11 +111,11 @@ svg-extract -- Extract independent graphic files from SVG pictures
\ifx\ProvidesFile\@undefined\def\ProvidesFile#1[#2]{}\fi
\ProvidesFile{svg.dtx}[%
%</driver>
-%<package&option>\NeedsTeXFormat{LaTeX2e}
+%<package&option>\NeedsTeXFormat{LaTeX2e}[2019-10-01]
%<package&option&base>\ProvidesPackage{svg}[%
%<package&option&extract>\ProvidesPackage{svg-extract}[%
%<*driver|package&option>
- 2019/10/10 v2.02c\space%
+ 2019/10/22 v2.02d\space%
%<package&option&base> (include SVG pictures)%
%<package&option&extract> (extract independent graphics from SVG pictures)%
]
@@ -260,6 +260,10 @@ svg-extract -- Extract independent graphic files from SVG pictures
% \changes{v2.02c}{2019/10/10}{%
% fix bugs with current kernel (2019/10/01) regarding file name parsing
% }^^A
+% \changes{v2.02d}{2019/10/22}{%
+% fix bugs with current kernel (2019/10/01) regarding file name parsing, see
+% \url{https://github.com/mrpiggi/svg/issues/16}
+% }^^A
% \ToDo{Workaround for missing \cs{transparent} (Lua\TeX lacks support)}[v2.03]
%
%
@@ -410,9 +414,7 @@ svg-extract -- Extract independent graphic files from SVG pictures
% graphic~file either does not exist or the file~modification date of the
% SVG~file is newer than that of the exported graphic~file. Thus the
% compilation time of the \LaTeX~document can be reduced to the necessary
-% minimum. Unfortunately a primitive like \cs{pdffilemoddate} is missing for
-% XeTeX, so with this engine, the behaviour will be the same as
-% \opt{inkscape}|=|\val{forced}.
+% minimum.
% \item[forced/force/overwrite]
% The \app{Inkscape}~export will definitely be done, any already existing
% exported file will overwritten regardlessly.
@@ -601,13 +603,8 @@ svg-extract -- Extract independent graphic files from SVG pictures
% PDF/EPS/PS/PNG~file (see~\opt{inkscapeformat}) and perhaps a correlating
% \LaTeX~file (see~\opt{inkscapelatex}). The export with \app{Inkscape} is only
% invoked, if the SVG~file is newer than the exported graphic~file or latter
-% doesn't exist at all.\footnote{\ignorespaces%
-% Due to the lack of XeTeX to compare file~modification dates, using this
-% \LaTeX~engine leads to \app{Inkscape}~exports with every run unless
-% \opt{inkscape}|=|\val{false} is used.%
-% }%
-% Once the export has been done, the graphic~file and maybe the \LaTeX~file are
-% included.
+% doesn't exist at all. Once the export has been done, the graphic~file and
+% maybe the \LaTeX~file are included.
%
% All previously described options can also be used as optional parameters to
% \cs{includesvg} and do have the same effect as described before. However, the
@@ -2283,6 +2280,10 @@ svg-extract -- Extract independent graphic files from SVG pictures
% \begin{macrocode}
\@svg@tempswafalse%
\expandafter\IfFileExists\expandafter{\svg@tempa}{%
+ \expandafter\svg@quotes@check\expandafter{\svg@tempa}%
+ \if@svg@quotes@found\else%
+ \svg@quotes@remove{\@filef@und}%
+ \fi%
\@svg@tempswatrue%
\edef\@filef@und{\expandafter\trim@spaces\expandafter{\@filef@und}}%
\svg@filename@parse[{#1}]{\@filef@und}%
@@ -2499,25 +2500,45 @@ svg-extract -- Extract independent graphic files from SVG pictures
% \end{macrocode}
% \end{macro}^^A \svg@file@missing
% \begin{macro}{\svg@iffilenewer}
+% \changes{v2.02d}{2019/10/22}{%
+% use \cs{filemoddate} with Xe\LaTeX, see
+% \url{https://github.com/mrpiggi/svg/issues/12}
+% }^^A
% The macro \cs{svg@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@filemoddate} is definied. Unfortunately this functionality
-% isn't provided by Xe\TeX.
+% done, if \cs{pdf@filemoddate} or \cs{filemoddate} is definied.
% \begin{macrocode}
+\newcommand*\svg@iffilenewer[2]{\@gobbletwo}
\ifx\pdf@filemoddate\@undefined
- \newcommand*\svg@iffilenewer[2]{\@gobbletwo}
+ \ifx\filemoddate\@undefined\else
+ \ifx\strcmp\@undefined\else
+ \renewcommand*\svg@iffilenewer[2]{%
+ \begingroup%
+ \edef\svg@tempa{\filemoddate{#1}}%
+ \edef\svg@tempb{\filemoddate{#2}}%
+ \ifnum\strcmp{\svg@tempa}{\svg@tempb}>\z@\relax%
+ \aftergroup\@firstoftwo%
+ \else%
+ \aftergroup\@secondoftwo%
+ \fi%
+ \endgroup%
+ }%
+ \fi
+ \fi
\else
- \newcommand*\svg@iffilenewer[2]{%
- \begingroup%
- \edef\svg@tempa{\pdf@filemoddate{#1}}%
- \edef\svg@tempb{\pdf@filemoddate{#2}}%
- \ifnum\pdf@strcmp{\svg@tempa}{\svg@tempb}>\z@\relax%
- \aftergroup\@firstoftwo%
- \else%
- \aftergroup\@secondoftwo%
- \fi%
- \endgroup%
- }
+ \ifx\pdf@strcmp\@undefined\else
+ \renewcommand*\svg@iffilenewer[2]{%
+ \begingroup%
+ \edef\svg@tempa{\pdf@filemoddate{#1}}%
+ \edef\svg@tempb{\pdf@filemoddate{#2}}%
+ \ifnum\pdf@strcmp{\svg@tempa}{\svg@tempb}>\z@\relax%
+ \aftergroup\@firstoftwo%
+ \else%
+ \aftergroup\@secondoftwo%
+ \fi%
+ \endgroup%
+ }%
+ \fi
\fi
% \end{macrocode}
% \end{macro}^^A \svg@iffilenewer