[tex4ht-commits] [SCM] tex4ht updated: r144 - trunk/lit

karl at gnu.org.ua karl at gnu.org.ua
Sun Feb 15 19:21:55 CET 2015


Author: karl
Date: 2015-02-15 20:21:55 +0200 (Sun, 15 Feb 2015)
New Revision: 144

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-env.tex
   trunk/lit/tex4ht-ooffice.tex
Log:
for ooffice: all images in subdir Pictures/; https://puszcza.gnu.org.ua/bugs/?240

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2015-02-14 00:35:05 UTC (rev 143)
+++ trunk/lit/ChangeLog	2015-02-15 18:21:55 UTC (rev 144)
@@ -1,16 +1,23 @@
-2015-02-13  Michal Hoftich <michal.h21 at gmail.com>
+2015-02-11  Michal Hoftich  <michal.h21 at gmail.com>
 
+	* tex4ht-ooffice.tex (ooffice.4ht): fix images in subfolders
+	handling -- everything in Pictures/.
+	* tex4ht-env.tex: likewise, copy all images to one directory.
+	https://puszcza.gnu.org.ua/bugs/?240
+
+2015-02-13  Michal Hoftich  <michal.h21 at gmail.com>
+
 	* tex4ht-mathml.tex (mathml.4ht) <config mathml fontmath>: 
 	output <mi mathvariant=...
 	https://puszcza.gnu.org.ua/bugs/?226
 
-2015-02-09  Michal Hoftich <michal.h21 at gmail.com>
+2015-02-09  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-mathml.tex (mathml.4ht) <config start mtext>: \ifmmode\else
 	<config math within mtext> to avoid some (but not all)
 	problems.  https://puszcza.gnu.org.ua/bugs/?244
 
-2015-02-07  Michal Hoftich <michal.h21 at gmail.com>
+2015-02-07  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-4ht.tex (scrartcl.4ht, scrbook.4ht, scrreprt.4ht):
 	koma-script patch, mail of 6 Feb 2015 12:32:10.

Modified: trunk/lit/tex4ht-env.tex
===================================================================
--- trunk/lit/tex4ht-env.tex	2015-02-14 00:35:05 UTC (rev 143)
+++ trunk/lit/tex4ht-env.tex	2015-02-15 18:21:55 UTC (rev 144)
@@ -2,8 +2,8 @@
 %      latex tex4ht-env
 % or htlatex tex4ht-env "xhtml,3"
 %
-% Copyright (C) 2009-2014 TeX Users Group
-% Copyright (C) 1997-2009 Eitan M. Gurari
+% Copyright 2009-2015 TeX Users Group
+% Copyright 1997-2009 Eitan M. Gurari
 % Released under LPPL 1.3c+.
 % See tex4ht-cpright.tex for license text.
 
@@ -779,6 +779,7 @@
 Grm zz%%4.ps >>>
 
 \<unix dvips convert\><<<
+%echo "dbg: got to dvips to png via gs (unix dvips convert)"
 Gdvips -E -q -Ppdf -f %%1 -pp %%2 > zz%%4.ps
 Ggs -sDEVICE=pngalpha -sOutputFile=%%3 -r110x110 -dEPSCrop -dBackgroundColor=16#ffffff -dTextAlphaBits=2 -dGraphicsAlphaBits=2 -q -dbatch -dNOPAUSE zz%%4.ps -c quit 
 Grm zz%%4.ps >>>
@@ -932,6 +933,7 @@
 \<dvipng\><<<
 <dvipng>
 G.png
+%echo "dbg: got to dvi to png via (dvipng)"
 Gdvipng -T tight -x 1400 -D 72 -bg Transparent -pp %%2:%%2 %%1 -o %%3
 G.gif
 Gdvipng -T tight -x 1400 -D 72 -bg Transparent -gif -pp %%2:%%2 %%1 -o %%3
@@ -1157,9 +1159,9 @@
 .4ot mv    %%1.4ot         sxw-%%0.dir/meta.xml
 .4oy mv    %%1.4oy         sxw-%%0.dir/styles.xml
 % .4og cp  --parents %%1   Pictures    
-.4og mkdir -p              sxw-%%0.dir/Pictures/%%1 
-.4og rmdir                 sxw-%%0.dir/Pictures/%%1 
-.4og cp    %%1             sxw-%%0.dir/Pictures/%%1 
+% .4og mkdir -p              sxw-%%0.dir/Pictures/%%1 
+% .4og rmdir                 sxw-%%0.dir/Pictures/%%1 
+.4og cp    %%1             sxw-%%0.dir/Pictures/
 %-- sxw --                                                          %
 .4ox cd sxw-%%0.dir; zip -r %%0.sxw * ; cd ..
 %                                                                   %
@@ -1203,7 +1205,7 @@
 %
 .4ot move  %%1.4ot    sxw-%%0.dir\meta.xml
 .4oy move  %%1.4oy    sxw-%%0.dir\styles.xml
-.4og copy  %%1        sxw-%%0.dir\Pictures\%%1
+.4og copy  %%1        sxw-%%0.dir\Pictures\
 .4od cd    sxw-%%0.dir & zip -r -m  %%0.zip * & cd ..
 % .4od cd    sxw-%%0.dir & 7za a -y  %%0.zip * & cd ..
 .4od move sxw-%%0.dir\%%0.zip %%0.odt
@@ -1481,7 +1483,7 @@
 %  
 .4ot mv  %%1.4ot    meta.xml  
 .4oy mv  %%1.4oy    styles.xml  
-.4og cp  --parents %%1        Pictures    
+.4og cp   %%1        Pictures\
 %-- sxw --  
 .4ox zip  %%0.sxw Pictures  
 .4ox zip  %%0.sxw settings.xml            
@@ -1519,7 +1521,6 @@
 
 
 
-
 \<xtpipes: my oo\><<<
 <ooxtpipes>
 .4oo mv %%0.4oo %%0.tmp 
@@ -1929,19 +1930,23 @@
 
 
 \<unix copyright\><<<
-% tex4ht.env-unix or .tex4ht (@version), generated from @jobname.tex
-% Copyright (C) 2009-2014 TeX Users Group
-% Copyright (C) @CopyYear.1997. Eitan M. Gurari
+% tex4ht.env-unix (@version), generated from @jobname.tex
+% (can be used as ~/.tex4ht)
+% Copyright 2009-2015 TeX Users Group
+% Copyright @CopyYear.1997. Eitan M. Gurari
 @<TeX4ht copyright@>>>>
 
 \<private copyright\><<<
-% tex4ht.env or .tex4ht (private) (@version), generated from @jobname.tex
-% Copyright (C) @CopyYear.1997. Eitan M. Gurari
+% tex4ht.env (private) (@version), generated from @jobname.tex
+% (can be used as ~/.tex4ht)
+% Copyright 2009-2015 TeX Users Group
+% Copyright @CopyYear.1997. Eitan M. Gurari
 @<TeX4ht copyright@>>>>
 
 \<win32 copyright\><<<
 % tex4ht.env-win32 (@version), generated from @jobname.tex
-% Copyright (C) @CopyYear.1997. Eitan M. Gurari
+% Copyright 2009-2015 TeX Users Group
+% Copyright @CopyYear.1997. Eitan M. Gurari
 @<TeX4ht copyright@>>>>
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Modified: trunk/lit/tex4ht-ooffice.tex
===================================================================
--- trunk/lit/tex4ht-ooffice.tex	2015-02-14 00:35:05 UTC (rev 143)
+++ trunk/lit/tex4ht-ooffice.tex	2015-02-15 18:21:55 UTC (rev 144)
@@ -1,8 +1,8 @@
 % $Id$
 % compile 3 times: latex tex4ht-ooffice
 %      htlatex tex4ht-ooffice "xhtml,4,sections+"
-% Copyright (C) 2009-2013 TeX Users Group
-% Copyright (C) 2001-2009 Eitan M. Gurari
+% Copyright 2009-2015 TeX Users Group
+% Copyright 2001-2009 Eitan M. Gurari
 % Released under LPPL 1.3c+.
 % See tex4ht-cpright.tex for license text.
 
@@ -108,10 +108,8 @@
 
 
 \<copy right notice\><<<
-% Copyright (C) 2009-2010 TeX Users Group
-% Copyright (C) |CopyYear.2001. Maarten Wisse, James Naughton, Eitan M. Gurari
-% Maarten.Wisse at urz.uni-heidelberg.de, http://home.wanadoo.nl/pmwisse
-% james.naughton at st-edmund-hall.oxford.ac.uk
+% Copyright 2009-2015 TeX Users Group
+% Copyright |CopyYear.2001. Maarten Wisse, James Naughton, Eitan M. Gurari
 |<TeX4ht copywrite|>
 >>>
 
@@ -569,7 +567,7 @@
 
 \<graphics obj manifest\><<<
 <manifest:file-entry
-    manifest:full-path="Pictures/|<graphics file name|>"/>\Hnewline
+    manifest:full-path="Pictures/|<graphics base name|>"/>\Hnewline
 >>>
 
 \<shared manifest\><<<
@@ -1008,30 +1006,50 @@
 >>>
 
 
+All images should be saved in one directory (`Pictures' by default),
+regardless of the original path structure. We must save image names and
+original paths to be able to copy pictures to correct location.
 
+\<configure ooffice graphics\><<<
+\def\getImgFileParser#1/{%
+  \ifx#1\relax
+    \let\next\relax
+  \else
+    \do{#1}\let\next\getImgFileParser
+  \fi\next
+}
+\newcommand\getImgFile[2]{%
+  \def\do##1{\def\imgBaseName{##1#2}\def\imgBase{##1}}
+  \def\imgFullName{#1#2}
+  \getImgFileParser#1/\relax/
+}
 
-\<configure ooffice graphics\><<<
 \Configure{graphics*}
    {gif}
-   {\Picture[IMG]{\Gin at base.gif |<graphics dimensions|> }}
+   {|<save image name|>\Picture[IMG]{\imgBase.gif |<graphics dimensions|> }}
 \Configure{graphics*}
    {png}
-   {\Picture[IMG]{\Gin at base.png |<graphics dimensions|> }}
+   {|<save image name|>\Picture[IMG]{\imgBase.png |<graphics dimensions|> }}
 \Configure{graphics*}
    {jpg}
-   {\Picture[IMG]{\Gin at base.jpg  |<graphics dimensions|> }}
+   {|<save image name|>\Picture[IMG]{\imgBase.jpg  |<graphics dimensions|> }}
 \Configure{graphics*}
    {jpeg}
-   {\Picture[IMG]{\Gin at base.jpeg |<graphics dimensions|> }}
+   {|<save image name|>\Picture[IMG]{\imgBase.jpeg |<graphics dimensions|> }}
 >>>
 
 \<\><<<
 \Configure{graphics*}
    {eps}
-   {\Picture[IMG]{\Gin at base.eps  |<graphics dimensions|> }}
+   {|<save image name|>\Picture[IMG]{\imgBase.eps  |<graphics dimensions|> }}
 >>>
 
+\<save image name\><<<
+\expandafter\getImgFile\expandafter{\Gin at base}{\PictExt}
+>>>
 
+
+
 \<graphics dimensions\><<<
 \ifx\noBoundingBox\UnDefined
    svg:width="\the\Gin at req@width"
@@ -1045,7 +1063,7 @@
 \Configure{IMG}
   {|<insert shadowing fig file|>%
    \ht:special{t4ht=<draw:frame  
-      draw:name="|<graphics file name|>"  
+      draw:name="|<graphics base name|>"  
       text:anchor-type="as-char"  % "paragraph"  
 %      svg:width="...pt"  
 %      svg:height="...pt"  
@@ -1057,6 +1075,10 @@
          xlink:type="simple"  
         xlink:show="embed"  
         xlink:actuate="onLoad" 
+				\ifx\noBoundingBox\UnDefined
+				 \string svg:width="\the\Gin at req@width"
+				  svg:height="\the\Gin at req@height"
+				\fi
         /><!--draw:name="}}
   {" }
   {\ht:special{t4ht=" }}
@@ -1069,7 +1091,7 @@
       \Configure{IMG}
         {|<insert shadowing fig file|>%
          \ht:special{t4ht=<draw:frame  
-            draw:name="|<graphics file name|>"  
+            draw:name="|<graphics base name|>"  
             text:anchor-type="as-char"  
             draw:style-name="jtree"
             draw:z-index="0"
@@ -1111,9 +1133,9 @@
 
 
 \<insert shadowing fig file\><<<
-\ht:special{t4ht>|<graphics file name|>.4og}%
+\ht:special{t4ht>|<graphics full name|>.4og}%
 \ht:special{t4ht*>}%
-\ht:special{t4ht<|<graphics file name|>.4og}%
+\ht:special{t4ht<|<graphics full name|>.4og}%
 \OOmanifest{|<graphics obj manifest|>}%
 >>>
 
@@ -1121,7 +1143,12 @@
 \<graphics file name\><<<
 \PictureFile>>>
 
+\<graphics base name\><<<
+\imgBaseName>>>
 
+\<graphics full name\><<<
+\imgFullName>>>
+
 \<configure ooffice tex4ht\><<<
 \Configure{PictureAlt*+[]}
    {\ht:special{t4ht>\jobname .tmp}}



More information about the tex4ht-commits mailing list