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

Michal Hoftich INVALID.NOREPLY at gnu.org.ua
Fri Feb 28 18:09:50 CET 2025


Author: michal_h21
Date: 2025-02-28 17:09:49 +0000 (Fri, 28 Feb 2025)
New Revision: 1655

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-ooffice.tex
Log:
added support for row colors in the odt output

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2025-02-28 16:01:39 UTC (rev 1654)
+++ trunk/lit/ChangeLog	2025-02-28 17:09:49 UTC (rev 1655)
@@ -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/lit/tex4ht-ooffice.tex
===================================================================
--- trunk/lit/tex4ht-ooffice.tex	2025-02-28 16:01:39 UTC (rev 1654)
+++ trunk/lit/tex4ht-ooffice.tex	2025-02-28 17:09:49 UTC (rev 1655)
@@ -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}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



More information about the tex4ht-commits mailing list.