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

Michal Hoftich INVALID.NOREPLY at gnu.org.ua
Thu Apr 28 15:36:29 CEST 2022


Author: michal_h21
Date: 2022-04-28 13:36:29 +0000 (Thu, 28 Apr 2022)
New Revision: 1121

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-4ht.tex
   trunk/lit/tex4ht-html4.tex
Log:
fixed suppoort for longtable captions

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2022-04-27 10:47:56 UTC (rev 1120)
+++ trunk/lit/ChangeLog	2022-04-28 13:36:29 UTC (rev 1121)
@@ -1,3 +1,10 @@
+2022-04-28  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-4ht.tex (longtable.4ht),
+	* tex4ht-html4.tex (html4.4ht): fixed support for longtable
+	captions.
+	https://tex.stackexchange.com/a/642350/2891
+
 2022-04-27  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-html4.tex (html4.4ht): corrected class names for Ulem

Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2022-04-27 10:47:56 UTC (rev 1120)
+++ trunk/lit/tex4ht-4ht.tex	2022-04-28 13:36:29 UTC (rev 1121)
@@ -10150,6 +10150,12 @@
   \o:noalign:\bgroup  \gHAdvance\TitleCount  1 
     \@ifnextchar[{\egroup\LT at c@ption\@firstofone}\LT at capti@n}
 \HLet\LT at caption\:tempc
+>>>
+
+
+\<old longtable makecaption\><<<
+% this code is not used anymore, it produces spurious table cells, 
+% resulting in wrong structure
 \def\:tempc#1#2#3{%
   \LT at mcol\LT at cols c{\hbox{\parbox[t]\LTcapwidth{%
     \cptA: #1{\cap:ref{#2}}\if\relax\detokenize{#1}\relax\else\cptB:\fi\cptC:#3\cptD:
@@ -10157,6 +10163,20 @@
 \HLet\LT at makecaption\:tempc
 >>>
 
+Captions in Longtable are placed inside of the table structure.
+We need to use special configuration to produce correct rendering, 
+normal code for caption will not work.
+
+\Link[https://tex.stackexchange.com/a/642350/2891] More details\EndLink
+
+\<longtable captions\><<<
+\NewConfigure{longtablecaption}{4}
+\def\:tempc#1#2#3{%
+    \a:longtablecaption #1{\cap:ref{#2}}\if\relax\detokenize{#1}\relax\else\b:longtablecaption\fi\c:longtablecaption#3\d:longtablecaption
+    \endgraf\vskip\baselineskip}
+\HLet\LT at makecaption\:tempc
+>>>
+
 \Link[https://puszcza.gnu.org.ua/bugs/?313] 
 Write table info to the LOT
 \EndLink

Modified: trunk/lit/tex4ht-html4.tex
===================================================================
--- trunk/lit/tex4ht-html4.tex	2022-04-27 10:47:56 UTC (rev 1120)
+++ trunk/lit/tex4ht-html4.tex	2022-04-28 13:36:29 UTC (rev 1121)
@@ -8169,6 +8169,9 @@
 \Css{div.longtable{text-align:center;}}
 \Css{table.longtable{margin-left:auto; margin-right: auto;}}
 \Configure{longtableparbox}{\IgnorePar\leavevmode\ShowPar\par}
+\Configure{longtablecaption}{\ifvmode\IgnorePar\fi\EndP\HCode{<caption class="longtable">}\par\ShowPar\HCode{<span class="id">}}{:\ }{\HCode{</span><span class="content">}}{\HCode{</span>}\ifvmode\IgnorePar\fi\EndP\HCode{</caption>}}
+
+\Css{caption.longtable .id{font-weight:bold;}}
 >>>
 
 



More information about the tex4ht-commits mailing list.