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

Michal Hoftich INVALID.NOREPLY at gnu.org.ua
Tue Feb 1 17:56:15 CET 2022


Author: michal_h21
Date: 2022-02-01 16:56:15 +0000 (Tue, 01 Feb 2022)
New Revision: 1068

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-html4.tex
Log:
Added support for colors in listings

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2022-02-01 16:25:25 UTC (rev 1067)
+++ trunk/lit/ChangeLog	2022-02-01 16:56:15 UTC (rev 1068)
@@ -1,8 +1,12 @@
 2022-02-01  Michal Hoftich  <michal.h21 at gmail.com>
 
+	* tex4ht-html4.tex (html4.4ht): added support for colors in
+	listings.
+	https://tex.stackexchange.com/a/632286/2891
+
 	* tex4ht-4ht.tex (color.4ht): don't redefine \@undeclaredcolor, in
 	order to preserve setting of the current color by the Color package.
-	https://tex.stackexchange.com/q/631906/2891
+	https://tex.stackexchange.com/a/632286/2891
 
 2022-01-30  Michal Hoftich  <michal.h21 at gmail.com>
 

Modified: trunk/lit/tex4ht-html4.tex
===================================================================
--- trunk/lit/tex4ht-html4.tex	2022-02-01 16:25:25 UTC (rev 1067)
+++ trunk/lit/tex4ht-html4.tex	2022-02-01 16:56:15 UTC (rev 1068)
@@ -15291,7 +15291,7 @@
          {{\everypar{}\leavevmode}}  
          {{\everypar{}\leavevmode}}  
          {|<nbsp|>%
-             \HCode{<br /><span class="label">}}  
+             \HCode{<br />\Hnewline<span class="label">}}  
          {\HCode{</span>}}%  
    }  
    {%\special{t4ht@)}
@@ -15320,6 +15320,18 @@
 %     \ifvmode \IgnorePar\fi \EndP  \HCode{</div>}\par}
 
 
+Support for colors in listings
+
+\<configure html4 listings\><<<
+\lst at AddToHook{PostOutput}{\HCode{</span>}}%
+
+\lst at AddToHook{OutputBox}{%
+  % get current color in the CSS form
+  \extractcolorspec{.}\html at color%
+  \expandafter\convertcolorspec\html at color{HTML}\html at color%
+  \HCode{<span style="color:\#\html at color">}}% init
+>>>
+
 %%%%%%%%%%%%%%%%%%%%%
 \subsection{Verbatim}
 %%%%%%%%%%%%%%%%%%%%%



More information about the tex4ht-commits mailing list.