texlive[74344] Master/texmf-dist: odt output row colors with

commits+karl at tug.org commits+karl at tug.org
Fri Feb 28 18:19:04 CET 2025


Revision: 74344
          https://tug.org/svn/texlive?view=revision&revision=74344
Author:   karl
Date:     2025-02-28 18:19:04 +0100 (Fri, 28 Feb 2025)
Log Message:
-----------
odt output row colors with colortbl, tex4ht r1655

Revision Links:
--------------
    https://tug.org/svn/texlive?view=revision&revision=1655

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

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog	2025-02-28 16:55:54 UTC (rev 74343)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog	2025-02-28 17:19:04 UTC (rev 74344)
@@ -1,5 +1,9 @@
 2025-02-28  Michal Hoftich  <michal.h21 at gmail.com>
 
+	* tex4ht-oofice.tex (ooffice.4ht): added support for row colors with
+	the Colortbl package.
+	https://github.com/michal-h21/make4ht/issues/165
+
 	* tex4ht-oofice.tex (ooffice.4ht): support addition of automatic
 	styles later in the document.
 	https://github.com/michal-h21/make4ht/issues/165

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex	2025-02-28 16:55:54 UTC (rev 74343)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex	2025-02-28 17:19:04 UTC (rev 74344)
@@ -1,4 +1,4 @@
-% $Id: tex4ht-ooffice.tex 1654 2025-02-28 16:01:39Z michal_h21 $
+% $Id: tex4ht-ooffice.tex 1655 2025-02-28 17:09:49Z michal_h21 $
 % compile 3 times: latex tex4ht-ooffice
 %      htlatex tex4ht-ooffice "xhtml,4,sections+"
 %
@@ -6814,13 +6814,31 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 
-For this moment, we just ignore row color, but we still need to 
-provide a configuration, to discard the color value from the document.
+We can save the row color in automatic styles.
 
+
 \<configure ooffice colortbl\><<<
-\Configure{rowcolor}{\@gobble}
+\def\:tblrowcolor#1{%
+  \bgroup
+  \HAdvance\HRow by 1% update row number locally
+  % get the row color in the #RRGGBB format
+  \expandafter\extractcolorspec\expandafter{#1}{\row:color}%
+  \expandafter\convertcolorspec\row:color{HTML}\row:color%
+  % we are writting to an temporary file, so we need to write \# here, it will be expanded 
+  % to # when the temp file is read 
+  \protected at edef\row:color{\detokenize{\#}\row:color}%
+  \OOautomaticstylesxml{<style:style style:name="TBL-\TableNo-\HRow-" style:family="table-row"> 
+    <style:table-row-properties fo:background-color="\row:color" >  
+    <style:background-image/>
+    </style:table-row-properties>
+</style:style>}%
+ \egroup
+}
+\Configure{rowcolor}{\:tblrowcolor}
 >>>
 
+
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{tabbing}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/ooffice.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/ooffice.4ht	2025-02-28 16:55:54 UTC (rev 74343)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/ooffice.4ht	2025-02-28 17:19:04 UTC (rev 74344)
@@ -1,4 +1,4 @@
-% ooffice.4ht (2025-02-28-08:52), generated from tex4ht-ooffice.tex
+% ooffice.4ht (2025-02-28-09:13), generated from tex4ht-ooffice.tex
 % Copyright 2009-2025 TeX Users Group
 % Copyright 2001-2009 Maarten Wisse, James Naughton, Eitan M. Gurari
 %
@@ -17,7 +17,7 @@
 %
 % If you modify this program, changing the
 % version identification would be appreciated.
-\immediate\write-1{version 2025-02-28-08:52}
+\immediate\write-1{version 2025-02-28-09:13}
 
   \exit:ifnot{Preamble,% 
 algorithmicx,% 
@@ -13154,7 +13154,23 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                 \ConfigureHinput{colortbl}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-    \Configure{rowcolor}{\@gobble}
+    \def\:tblrowcolor#1{%
+  \bgroup
+  \HAdvance\HRow by 1% update row number locally
+  % get the row color in the #RRGGBB format
+  \expandafter\extractcolorspec\expandafter{#1}{\row:color}%
+  \expandafter\convertcolorspec\row:color{HTML}\row:color%
+  % we are writting to an temporary file, so we need to write \# here, it will be expanded
+  % to # when the temp file is read
+  \protected at edef\row:color{\detokenize{\#}\row:color}%
+  \OOautomaticstylesxml{<style:style style:name="TBL-\TableNo-\HRow-" style:family="table-row">
+    <style:table-row-properties fo:background-color="\row:color" >
+    <style:background-image/>
+    </style:table-row-properties>
+</style:style>}%
+ \egroup
+}
+\Configure{rowcolor}{\:tblrowcolor}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   



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