texlive[60231] Master/texmf-dist/source/generic/tex4ht: tex4ht source

commits+karl at tug.org commits+karl at tug.org
Fri Aug 13 00:04:53 CEST 2021


Revision: 60231
          http://tug.org/svn/texlive?view=revision&revision=60231
Author:   karl
Date:     2021-08-13 00:04:53 +0200 (Fri, 13 Aug 2021)
Log Message:
-----------
tex4ht source file updates

Modified Paths:
--------------
    trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
    trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
    trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog	2021-08-12 22:04:01 UTC (rev 60230)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog	2021-08-12 22:04:53 UTC (rev 60231)
@@ -1,3 +1,11 @@
+2021-08-12  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-ooffice.tex (ooffice.4ht): added support for SVG image inclusion.
+	* tex4ht-ooffice.tex (ooffice.4ht): fixed support for images created by
+	\Picture+{} and \Picture+{} commands.
+	* tex4ht-4ht.tex (graphics.4ht, graphicx.4ht): moved mapping to .xbb files
+	from graphicx.4ht to graphics.4ht, so they work with both packages.
+
 2021-08-03  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-4ht.tex (mdframed.4ht): correctly empty the frame title.

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex	2021-08-12 22:04:01 UTC (rev 60230)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex	2021-08-12 22:04:53 UTC (rev 60231)
@@ -1,4 +1,4 @@
-% $Id: tex4ht-4ht.tex 969 2021-08-03 18:00:44Z michal_h21 $
+% $Id: tex4ht-4ht.tex 972 2021-08-12 20:24:34Z michal_h21 $
 % tex tex4ht-4ht   or   ht tex tex4ht-4ht
 %
 % Copyright 2009-2021 TeX Users Group    
@@ -25920,6 +25920,18 @@
 \def\if:boundingbox#1#2{\ifdim\Gin at req@width=\Gin at nat@width\ifx\noBoundingBox\UnDefined#1\else#2\fi\else#1\fi}
 >>>
 
+We need to find bounding boxes of images. Graphics support the .xbb file that contain this information.
+It is necessary to provide the DeclareGraphicsRule commands for supported image formats so 
+the .xbb file works.
+
+\<fix graphics\><<<
+\DeclareGraphicsRule{.png}{bmp}{.xbb}{}
+\DeclareGraphicsRule{.jpg}{bmp}{.xbb}{}
+\DeclareGraphicsRule{.gif}{bmp}{.xbb}{}
+\DeclareGraphicsRule{.pdf}{bmp}{.xbb}{}
+\DeclareGraphicsRule{.svg}{bmp}{.xbb}{}
+>>>
+
 %\expandafter\def\csname c:graphics-file:\endcsname#1{\Gin at drafttrue
 %   \def\Gin at setfile##1##2##3{%
 %     \def\:temp####1####2{#1}\:temp{##3}{\Gin at base}}}
@@ -26037,11 +26049,6 @@
    \fi
    \Gin:esetsize
 }
-\DeclareGraphicsRule{.png}{bmp}{.xbb}{}
-\DeclareGraphicsRule{.jpg}{bmp}{.xbb}{}
-\DeclareGraphicsRule{.gif}{bmp}{.xbb}{}
-\DeclareGraphicsRule{.pdf}{bmp}{.xbb}{}
-\DeclareGraphicsRule{.svg}{bmp}{.xbb}{}
 
 \NewConfigure{rotatebox}{2}
 \pend:def\Grot at box{\a:rotatebox}
@@ -26605,7 +26612,7 @@
 
 \<mdframed.4ht\><<<
 % mdframed.4ht (|version), generated from |jobname.tex
-% Copyright 2017 TeX Users Group
+% Copyright 2017-2021 TeX Users Group
 |<TeX4ht license text|>
 
 \NewConfigure{mdframed}{2}

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex	2021-08-12 22:04:01 UTC (rev 60230)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex	2021-08-12 22:04:53 UTC (rev 60231)
@@ -1,4 +1,4 @@
-% $Id: tex4ht-ooffice.tex 904 2021-04-16 20:30:30Z karl $
+% $Id: tex4ht-ooffice.tex 971 2021-08-12 20:15:30Z michal_h21 $
 % compile 3 times: latex tex4ht-ooffice
 %      htlatex tex4ht-ooffice "xhtml,4,sections+"
 %
@@ -628,7 +628,7 @@
 
 \<graphics obj manifest\><<<
 <manifest:file-entry
-    manifest:full-path="Pictures/\PictureFile" manifest:media-type="\get:image:mime:type\Gin at ext"/>\Hnewline
+   manifest:full-path="Pictures/\PictureFile" manifest:media-type="\get:image:mime:type\filename at ext"/>\Hnewline
 >>>
 
 \<shared manifest\><<<
@@ -1083,6 +1083,9 @@
 \Configure{graphics*}
    {jpeg}
    {|<save image name|>\Picture[IMG]{\imgBase.jpeg |<graphics dimensions|> }}
+\Configure{graphics*}
+   {svg}
+   {|<save image name|>\Picture[IMG]{\imgBase.svg |<graphics dimensions|> }}
 
 
 |<graphics default extensions|>
@@ -1144,7 +1147,7 @@
 Enable supported image extensions out of the box.
 
 \<graphics default extensions\><<<
-\DeclareGraphicsExtensions{.png,.jpg,.eps,.pdf}
+\DeclareGraphicsExtensions{.png,.jpg,.eps,.pdf,.svg}
 >>>
 
 \<configure ooffice tex4ht\><<<
@@ -1162,12 +1165,13 @@
    \ht:special{t4ht=<draw:frame  
       draw:name="\PictureFile"  
       text:anchor-type="as-char"  % "paragraph"  
-%      svg:width="...pt"  
-%      svg:height="...pt"  
-				% \ifx\noBoundingBox\UnDefined
-				 \string svg:width="\the\Gin at req@width"
-				  svg:height="\the\Gin at req@height"
-				% \fi
+        % insert image dimension only if they really exist
+        \ifx\noBoundingBox\UnDefined
+         \ifx\Gin at req@width\undefined\else
+         \ifdim\Gin at req@width>0pt
+         \string svg:width="\the\Gin at req@width"
+          svg:height="\the\Gin at req@height"
+        \fi\fi\fi
       draw:z-index="0"
     >%
       <draw:image\Hnewline
@@ -1228,13 +1232,22 @@
 >>>
 
 
+% we need to support both images inserted by \includegraphics,
+% and pictures created using \Picture*{}. 
 
 \<insert shadowing fig file\><<<
+% parse the image extension, will be used later
+\expandafter\filename at parse\expandafter{\PictureFile}%
+\ifx\Gin at base\@undefined
+\let\graphics:filename\PictureFile
+\else
+\def\graphics:filename{\Gin at base\Gin at ext}
+\fi
 % \ht:special{t4ht>\PictureFile.4og}%
-\ht:special{t4ht>\Gin at base\Gin at ext.4og}%
+\ht:special{t4ht>\graphics:filename.4og}%
 \ht:special{t4ht*>}%
 % \ht:special{t4ht<\PictureFile.4og}%
-\ht:special{t4ht<\Gin at base\Gin at ext.4og}%
+\ht:special{t4ht<\graphics:filename.4og}%
 \OOmanifest{|<graphics obj manifest|>}%
 >>>
 



More information about the tex-live-commits mailing list.