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

Michal Hoftich INVALID.NOREPLY at gnu.org.ua
Thu Feb 20 17:59:57 CET 2025


Author: michal_h21
Date: 2025-02-20 16:59:57 +0000 (Thu, 20 Feb 2025)
New Revision: 1648

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-4ht.tex
Log:
fixed support for escaped latex code in listings comments

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2025-02-20 11:12:32 UTC (rev 1647)
+++ trunk/lit/ChangeLog	2025-02-20 16:59:57 UTC (rev 1648)
@@ -1,5 +1,9 @@
 2025-02-20  Michal Hoftich  <michal.h21 at gmail.com>
 
+	* tex4ht-4ht.tex (listings.4ht): fixed support for escaped LaTeX
+	code in comments.
+	https://puszcza.gnu.org.ua/bugs/index.php?648
+
 	* tex4ht-html4.tex (html4.4ht): remove spurious </p> tags from
 	Listings.
 	https://puszcza.gnu.org.ua/bugs/?648

Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2025-02-20 11:12:32 UTC (rev 1647)
+++ trunk/lit/tex4ht-4ht.tex	2025-02-20 16:59:57 UTC (rev 1648)
@@ -34139,6 +34139,17 @@
 \NewConfigure{listings-init}{2}
 >>>
 
+This configuration should prevent linebreaks and collapsed spaces for escaped LaTeX commands 
+inside listings. It assumes that listings-init contains TeX4ht specials that disables and enables spaces,
+and OutputBox and PostOutput hooks provided by Listings should insert markup for the current text color.
+
+See \Link[https://puszcza.gnu.org.ua/bugs/?648]{}{}for example\EndLink.
+
+\<listings sty\><<<
+\pend:def\lst at escapebegin{\csname b:listings-init\endcsname\nobreak\hbox\bgroup\lsthk at OutputBox}
+\append:def\lst at escapeend{\lsthk at PostOutput\egroup\csname a:listings-init\endcsname}
+>>>
+
 Use the TextStyle hook to insert markup for inline listings. This hook can 
 be used also in other contexts, so we need to execute it conditionally, 
 based on the \Verb|\lst at ifmode| condition. 



More information about the tex4ht-commits mailing list.