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

Michal Hoftich INVALID.NOREPLY at gnu.org.ua
Tue Apr 23 22:53:18 CEST 2024


Author: michal_h21
Date: 2024-04-23 20:53:18 +0000 (Tue, 23 Apr 2024)
New Revision: 1508

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-4ht.tex
   trunk/lit/tex4ht-html4.tex
Log:
fixed support for the \textls command

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2024-04-22 13:28:48 UTC (rev 1507)
+++ trunk/lit/ChangeLog	2024-04-23 20:53:18 UTC (rev 1508)
@@ -1,3 +1,10 @@
+2024-04-23  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-4ht.tex (microtype.4ht),
+	* tex4ht-html4.tex (html4.4ht): added support for letter spacing
+	using the \textls command.
+	https://github.com/michal-h21/tex4ebook/issues/127
+
 2024-04-22  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-4ht.tex (tcolorbox.4ht): fixed handling of labels in

Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2024-04-22 13:28:48 UTC (rev 1507)
+++ trunk/lit/tex4ht-4ht.tex	2024-04-23 20:53:18 UTC (rev 1508)
@@ -31392,8 +31392,10 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
 % microtype.4ht                         |version %
 % Copyright (C) |CopyYear.2007.       Eitan M. Gurari         %
+% Copyright 2024 TeX Users Group
 |<TeX4ht copyright|>
   |<disable microtype|>
+  |<microtype textls|>
 \Hinput{microtype}
 \endinput
 >>>        \AddFile{9}{microtype}
@@ -31406,11 +31408,26 @@
 \renewcommand{\UseMicroTypeSet}[2][]{} 
 \renewcommand{\SetProtrusion}[3][]{} 
 \renewcommand{\SetExpansion}[3][]{} 
-\ifx \textls\UnDef\else
-  \renewcommand{\textls}[2][]{#2}
-\fi
 >>>
 
+We can try to provide a letterspacing command:
+
+\<microtype textls\><<<
+\NewConfigure{textls}{2}
+\ExplSyntaxOn
+\providecommand\:textls[2][]{%
+  \begingroup%
+    \ifx\relax#1\relax\else
+      \edef\:letterspacing{\fp_eval:n{#1/1000}}
+    \fi
+    \a:textls%
+    #2%
+    \b:textls%
+  \endgroup%
+}
+\ExplSyntaxOff
+\HLet\MT at textls\:textls
+>>>
 %%%%%%%%%%%%%
 \Section{Bm.sty}
 %%%%%%%%%%%%%

Modified: trunk/lit/tex4ht-html4.tex
===================================================================
--- trunk/lit/tex4ht-html4.tex	2024-04-22 13:28:48 UTC (rev 1507)
+++ trunk/lit/tex4ht-html4.tex	2024-04-23 20:53:18 UTC (rev 1508)
@@ -21751,7 +21751,16 @@
 \ExplSyntaxOff
 >>>
 
+%%%%%%%%%%%%%%%%%%%%%
+\section{microtype}
+%%%%%%%%%%%%%%%%%%%%%
 
+\<configure html4 microtype\><<<
+\Configure{textls}{\HCode{<span class="textls" \ifdefined\:letterspacing style="letter-spacing:\:letterspacing rem" \fi>}}{\HCode{</span>}}
+\Css{.textls{letter-spacing:0.1rem;}} % default letter spacing, if no amount is specified
+>>>
+
+
 %%%%%%%%%%%%%%%%%%%%%
 \section{mhchem}
 %%%%%%%%%%%%%%%%%%%%%



More information about the tex4ht-commits mailing list.