texlive[57704] Master/texmf-dist/tex/generic/tex4ht/svg.4ht: svg
commits+karl at tug.org
commits+karl at tug.org
Wed Feb 10 23:18:43 CET 2021
Revision: 57704
http://tug.org/svn/texlive?view=revision&revision=57704
Author: karl
Date: 2021-02-10 23:18:43 +0100 (Wed, 10 Feb 2021)
Log Message:
-----------
svg image dimensions, tex4ht r885
Revision Links:
--------------
http://tug.org/svn/texlive?view=revision&revision=885
Modified Paths:
--------------
trunk/Master/texmf-dist/tex/generic/tex4ht/svg.4ht
Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/svg.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/svg.4ht 2021-02-10 22:04:56 UTC (rev 57703)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/svg.4ht 2021-02-10 22:18:43 UTC (rev 57704)
@@ -1,4 +1,4 @@
-% svg.4ht (2018-12-30-09:31), generated from tex4ht-4ht.tex
+% svg.4ht (2021-02-10-14:18), generated from tex4ht-4ht.tex
% Copyright 2018 TeX Users Group
%
% This work may be distributed and/or modified under the
@@ -16,13 +16,31 @@
%
% If you modify this program, changing the
% version identification would be appreciated.
-\immediate\write-1{version 2018-12-30-09:31}
+\immediate\write-1{version 2021-02-10-14:18}
\renewcommand\includesvg[2][]{%
-% detect if an extension has been used
-\filename at parse{#2}
-\@ifundefined{filename at ext}{\edef\svg:filename{#2.svg}}{\edef\svg:filename{#2}}
-\includegraphics{\svg:filename}
+ % get file name with \svgpath support
+ \svg at get@path{#2}{}%
+ % set keys
+ \svg at local@param at set{#1}%
+ \if at svg@file at found%
+ % convert supported parameters from \includesvg for use with \includegraphics
+ \edef\svg at tempb{}
+ \ifdim\svg at param@height>\z@\relax%
+ \edef\svg at tempb{\svg at tempb,height=\svg at param@height}%
+ \fi%
+ \ifdim\svg at param@width>\z@\relax%
+ \edef\svg at tempb{\svg at tempb,width=\svg at param@width}%
+ \fi%
+ \ifdim\dimexpr\svg at param@angle\p@\relax=\z@\relax\else%
+ \edef\svg at tempb{%
+ \svg at tempb,origin=\svg at param@origin,angle=\svg at param@angle%
+ }%
+ \fi%
+ \expandafter\includegraphics\expandafter[\svg at tempb]{\svg at file@base.\svg at file@ext}
+ \else
+ \typeout{SVG file #1 cannot be found}
+ \fi
}
\Hinput{svg}
More information about the tex-live-commits
mailing list.