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

Michal Hoftich INVALID.NOREPLY at gnu.org.ua
Thu Nov 9 17:19:15 CET 2023


Author: michal_h21
Date: 2023-11-09 16:19:15 +0000 (Thu, 09 Nov 2023)
New Revision: 1407

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-html4.tex
Log:
better detection of first rows in tables with the p-width option

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2023-11-06 15:17:44 UTC (rev 1406)
+++ trunk/lit/ChangeLog	2023-11-09 16:19:15 UTC (rev 1407)
@@ -1,3 +1,9 @@
+2023-11-09  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-html4.tex (html4.4ht): better detection of the first row in
+	tables with the "p-width" option.
+	https://github.com/michal-h21/make4ht/issues/114
+
 2023-11-06  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-4ht.tex (array.4ht,latex.4ht,revtex4.4ht): don't set array

Modified: trunk/lit/tex4ht-html4.tex
===================================================================
--- trunk/lit/tex4ht-html4.tex	2023-11-06 15:17:44 UTC (rev 1406)
+++ trunk/lit/tex4ht-html4.tex	2023-11-09 16:19:15 UTC (rev 1407)
@@ -19990,9 +19990,19 @@
 
 \<configure html4 latex\><<<
 \:CheckOption{p-width} \if:Option 
+  \HAssign\:hcolwidthtbl=0
+  \gdef\:hcolwidthfirst{1}
   \ExplSyntaxOn
   \Configure{HColWidth}
-     {\ifnum\HRow=1% output CSS only on the first row, to prevent duplication
+     {%
+       % in some cases, the first \HRow is not 1, for example with \multicolumn
+       % see https://github.com/michal-h21/make4ht/issues/114
+       % when we enter a new table, we will save the first row
+       \ifx\:hcolwidthtbl\TableNo\else
+         \global\let\:hcolwidthtbl=\TableNo
+         \global\let\:hcolwidthfirst=\HRow
+       \fi
+       \ifx\HRow\:hcolwidthfirst% output CSS only on the first row, to prevent duplication
       \tmp:dim=\fp_to_dim:n{\dim_to_fp:n{\HColWidth}/\f at size}
       \Css{\#TBL-\TableNo\space td:nth-child(\HCol)% CSS selects ID of the current table column
           {width:\strip at pt\tmp:dim em;}}



More information about the tex4ht-commits mailing list.