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

Michal Hoftich INVALID.NOREPLY at gnu.org.ua
Mon Sep 9 16:48:03 CEST 2024


Author: michal_h21
Date: 2024-09-09 14:48:03 +0000 (Mon, 09 Sep 2024)
New Revision: 1552

Modified:
   trunk/lit/ChangeLog
   trunk/lit/mktex4ht-cnf.tex
   trunk/lit/tex4ht-4ht.tex
   trunk/lit/tex4ht-html4.tex
Log:
added support for enumitem environemnts defined using \newlist

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2024-09-03 22:26:09 UTC (rev 1551)
+++ trunk/lit/ChangeLog	2024-09-09 14:48:03 UTC (rev 1552)
@@ -1,3 +1,10 @@
+2024-09-09  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-4ht.tex (usepackage.4ht, enumitem-hooks.4ht, enumitem.4ht),
+	* tex4ht-html4.tex (html4.4ht): added support for environments
+	defined using \newlist.
+	https://github.com/michal-h21/make4ht/issues/150
+
 2024-09-03  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-fonts-noncjk.tex (

Modified: trunk/lit/mktex4ht-cnf.tex
===================================================================
--- trunk/lit/mktex4ht-cnf.tex	2024-09-03 22:26:09 UTC (rev 1551)
+++ trunk/lit/mktex4ht-cnf.tex	2024-09-09 14:48:03 UTC (rev 1552)
@@ -241,6 +241,7 @@
 \AddFile{9}{moderncv}
 \AddFile{9}{vowel}
 \AddFile{9}{enumitem}
+\AddFile{9}{enumitem-hooks}
 \AddFile{9}{esperanto}
 \AddFile{9}{IEEEtran}
 \AddFile{9}{enumerate}

Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2024-09-03 22:26:09 UTC (rev 1551)
+++ trunk/lit/tex4ht-4ht.tex	2024-09-09 14:48:03 UTC (rev 1552)
@@ -30340,6 +30340,7 @@
 % Copyright |CopyYear.2009. Eitan M. Gurari
 |<TeX4ht copywrite|>
 |<enumitem config|>
+|<enumitem newlist|>
 \Hinput{enumitem}
 \endinput
 >>>        \AddFile{9}{enumitem}
@@ -30374,7 +30375,62 @@
 \def\enit at postlabel{}
 >>>
 
+We need to provide a configuration for environments defined using \Verb+\newlist+. 
+Because they are defined in the preamble, we must catch them using the early hooks 
+file. 
 
+The test file and report can be found \Link[https://github.com/michal-h21/make4ht/issues/150]{}{}here\EndLink.
+
+
+\<add to usepackage\><<<
+\Configure{PackageHooks}{enumitem.sty}{enumitem-hooks.4ht}
+>>>
+
+\<enumitem-hooks.4ht\><<<
+% enumitem-hooks.4ht (|version), generated from |jobname.tex
+% Copyright 2024 TeX Users Group
+|<TeX4ht license text|>
+\:AtEndOfPackage{%
+|<enumitem patch newlist|>
+}
+>>> \AddFile{9}{enumitem-hooks}
+
+
+We save all defined environments in \Verb+\enumitem:newlist+. This command 
+is then called in the \Verb+\Configure{enumitemnewlist}+, which can 
+be used in the output format configuration.
+
+\<enumitem patch newlist\><<<
+\def\enumitem:newlist{}
+\def\:tempa#1#2#3#4{\concat:config\enumitem:newlist{\Configure{enumitemenv}{#2}}\o:enit at newlist{#1}{#2}{#3}{#4}}
+\let\o:enit at newlist\enit at newlist
+\let\enit at newlist\:tempa
+>>>
+
+
+This configuration is called automatically by \Verb+\Configure{enumitenewlist}+ for each 
+declared environment. The environment name is saved in \Verb+\a:enumitemenv+,
+and then we call \Verb+\enumitem:newlist+, which should provide a configuration for lists 
+in the current output format. 
+
+\<enumitem newlist\><<<
+\NewConfigure{enumitemenv}[1]{%
+\def\a:enumitemenv{#1}%
+\enumitem:newlistconfig
+}
+>>>
+
+This configuration should provide a configuration for a list in the current output format. 
+Name of the configured environment is saved in \Verb+\a:enumitemenv+.
+
+\<enumitem newlist\><<<
+\NewConfigure{enumitemnewlist}[1]{
+  \def\enumitem:newlistconfig{#1}
+  \enumitem:newlist
+}
+>>>
+
+
 %%%%%%%%%%%%%
 \Section{esperanto.sty}
 %%%%%%%%%%%%%

Modified: trunk/lit/tex4ht-html4.tex
===================================================================
--- trunk/lit/tex4ht-html4.tex	2024-09-03 22:26:09 UTC (rev 1551)
+++ trunk/lit/tex4ht-html4.tex	2024-09-09 14:48:03 UTC (rev 1552)
@@ -16846,10 +16846,27 @@
    {\end:itm \global\def\end:itm{\EndP\Tg</dd>}\HCode{<dt
         class="enumerate-enumitem">}\bgroup \bf}
    {\egroup\EndP\HCode{</dt><dd\Hnewline class="enumerate-enumitem">}}
+
 \Css{dl.enumerate-enumitem{display:grid; grid-template-columns: 3ch 1fr; align-items: top; row-gap:1ch;}}
 >>>
 
+Configurations for new list environments.
 
+\<configure html4 enumitem\><<<
+\Configure{enumitemnewlist}{%
+\ConfigureList{\a:enumitemenv}%
+   {\EndP\HCode{<dl \a:LRdir class="enumerate-enumitem enumitem-\a:enumitemenv">}%
+      |<save end:itm|>\global\let\end:itm=\empty}
+   {|<recall end:itm|>\EndP\HCode{</dd></dl>}\ShowPar}
+   {\end:itm \global\def\end:itm{\EndP\Tg</dd>}\HCode{<dt
+        class="enumerate-enumitem enumitem-\a:enumitemenv">}\bgroup \bf}
+   {\egroup\EndP\HCode{</dt><dd\Hnewline class="enumerate-enumitem">}}
+}
+
+
+>>>
+
+
 %%%%%%%%%%%%%
 \subsection{IEEEtran}
 %%%%%%%%%%%%%



More information about the tex4ht-commits mailing list.