Skip to content

Commit

Permalink
Merge branch 'hotfix/v2.02d'
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpiggi committed Oct 22, 2019
2 parents 3a0df38 + 8c49113 commit a1d6626
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 27 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ it is rendered within the LaTeX document using either ***ImageMagick*** or
Versions
--------

**v2.02d** (2019/10/22)
+ fix bugs with current kernel (2019/10/01) regarding file name parsing, see
https://github.com/mrpiggi/svg/issues/16
+ use `\filemoddate` with XeLaTeX, see https://github.com/mrpiggi/svg/issues/12

**v2.02c** (2019/10/10)
+ fix bugs with current kernel (2019/10/01) regarding file name parsing

Expand Down
75 changes: 48 additions & 27 deletions source/svg.dtx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% \CheckSum{3838}
% \CheckSum{3884}
% \iffalse meta-comment
%
% svg and svg-extract -- Include and extract SVG pictures in LaTeX documents
Expand Down Expand Up @@ -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)%
]
Expand Down Expand Up @@ -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]
%
%
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}%
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a1d6626

Please sign in to comment.