summaryrefslogtreecommitdiff
path: root/support/TeX4ht/source/tex4ht-ooffice.tex
diff options
context:
space:
mode:
Diffstat (limited to 'support/TeX4ht/source/tex4ht-ooffice.tex')
-rw-r--r--support/TeX4ht/source/tex4ht-ooffice.tex35
1 files changed, 24 insertions, 11 deletions
diff --git a/support/TeX4ht/source/tex4ht-ooffice.tex b/support/TeX4ht/source/tex4ht-ooffice.tex
index 5a8a69ec0b..8286197a83 100644
--- a/support/TeX4ht/source/tex4ht-ooffice.tex
+++ b/support/TeX4ht/source/tex4ht-ooffice.tex
@@ -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 @@ Commands for basic character styles:
\<graphics obj manifest\><<<
<manifest:file-entry
- manifest:full-path="Pictures/\PictureFile" manifest:media-type="\get:image:mime:type\Gin@ext"/>\Hnewline
+ manifest:full-path="Pictures/\PictureFile" manifest:media-type="\get:image:mime:type\filename@ext"/>\Hnewline
>>>
\<shared manifest\><<<
@@ -1083,6 +1083,9 @@ original paths to be able to copy pictures to correct location.
\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 @@ original paths to be able to copy pictures to correct location.
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 @@ Enable supported image extensions out of the box.
\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@req@width"
- svg:height="\the\Gin@req@height"
- % \fi
+ % insert image dimension only if they really exist
+ \ifx\noBoundingBox\UnDefined
+ \ifx\Gin@req@width\undefined\else
+ \ifdim\Gin@req@width>0pt
+ \string svg:width="\the\Gin@req@width"
+ svg:height="\the\Gin@req@height"
+ \fi\fi\fi
draw:z-index="0"
>%
<draw:image\Hnewline
@@ -1228,13 +1232,22 @@ Enable supported image extensions out of the box.
>>>
+% 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@parse\expandafter{\PictureFile}%
+\ifx\Gin@base\@undefined
+\let\graphics:filename\PictureFile
+\else
+\def\graphics:filename{\Gin@base\Gin@ext}
+\fi
% \ht:special{t4ht>\PictureFile.4og}%
-\ht:special{t4ht>\Gin@base\Gin@ext.4og}%
+\ht:special{t4ht>\graphics:filename.4og}%
\ht:special{t4ht*>}%
% \ht:special{t4ht<\PictureFile.4og}%
-\ht:special{t4ht<\Gin@base\Gin@ext.4og}%
+\ht:special{t4ht<\graphics:filename.4og}%
\OOmanifest{|<graphics obj manifest|>}%
>>>