summaryrefslogtreecommitdiff
path: root/support/TeX4ht
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-10-07 03:03:15 +0000
committerNorbert Preining <norbert@preining.info>2022-10-07 03:03:15 +0000
commitbbbfa0a90645d4da46b1492f6513b28a01eb78da (patch)
treedcbf82e9f2bd50ac7596114690ad31ca7a6dbf8c /support/TeX4ht
parent678708e90ffe138885ed8c06b6780d491b80fae5 (diff)
CTAN sync 202210070303
Diffstat (limited to 'support/TeX4ht')
-rw-r--r--support/TeX4ht/source/ChangeLog9
-rw-r--r--support/TeX4ht/source/mktex4ht-cnf.tex3
-rw-r--r--support/TeX4ht/source/tex4ht-mathjax.tex30
3 files changed, 35 insertions, 7 deletions
diff --git a/support/TeX4ht/source/ChangeLog b/support/TeX4ht/source/ChangeLog
index ea11301dec..dd2ab0b0c6 100644
--- a/support/TeX4ht/source/ChangeLog
+++ b/support/TeX4ht/source/ChangeLog
@@ -1,3 +1,12 @@
+2022-10-06 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-mathjax.tex (mathjax-latex-4ht.4ht): added basic support
+ for Mhchem.
+
+ * tex4ht-mathjax.tex (mathjax-latex-4ht.4ht): added basic support
+ for \label commands inside equations.
+ https://tex.stackexchange.com/a/660581/2891
+
2022-10-05 Michal Hoftich <michal.h21@gmail.com>
* tex4ht-mathml.tex (mathml.4ht): use displaystyle attribute also in
diff --git a/support/TeX4ht/source/mktex4ht-cnf.tex b/support/TeX4ht/source/mktex4ht-cnf.tex
index b6a23db471..147cccbe24 100644
--- a/support/TeX4ht/source/mktex4ht-cnf.tex
+++ b/support/TeX4ht/source/mktex4ht-cnf.tex
@@ -1,4 +1,4 @@
-% $Id: mktex4ht-cnf.tex 1196 2022-09-20 15:05:23Z michal_h21 $
+% $Id: mktex4ht-cnf.tex 1212 2022-10-06 10:29:28Z michal_h21 $
% Manually-maintained file, listing *.4ht files created by tex4ht-4ht.tex.
% Read by tex4ht-cond4ht.
%
@@ -378,4 +378,5 @@
\AddFile{9}{sectionbreak}
\AddFile{9}{subfiles}
\AddFile{9}{fontawesome5}
+\AddFile{9}{mhchem}
% \AddFile{9}{mktex4ht}
diff --git a/support/TeX4ht/source/tex4ht-mathjax.tex b/support/TeX4ht/source/tex4ht-mathjax.tex
index 0600eb10c3..2f511185f0 100644
--- a/support/TeX4ht/source/tex4ht-mathjax.tex
+++ b/support/TeX4ht/source/tex4ht-mathjax.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-mathjax.tex 1190 2022-08-29 10:21:19Z michal_h21 $
+% $Id: tex4ht-mathjax.tex 1212 2022-10-06 10:29:28Z michal_h21 $
% compile: latex tex4ht-mathjax
%
% Copyright 2018-2022 TeX Users Group
@@ -99,12 +99,24 @@ environments. They will then keep the LaTeX code unchanged.
The \verb|\VerbMath| command redefines environments to pass their content
verbatim to the HTML output.
+The optional command can contain name of the counter that should be updated.
+It will also use LaTeX 3 regular expressions to search for label commands.
+Thanks to that, cross-referencing to the math environments should work.
+It is a bit limited, for example subequations cannot work. There can be also
+issues in books, where equation numbers are based on chapters, but MathJax
+numbers them consecutively. In these cases, other mechanisms may be necessary.
+
\<defined commands\><<<
\ExplSyntaxOn
-\newcommand\VerbMath[1]{%
- \cs_if_exist:cTF{#1}{
- \RenewDocumentEnvironment{#1}{+!b}{%
- \NoFonts\expandafter\VerbMathToks\expandafter{\detokenize{##1}}{#1}\EndNoFonts%
+\cs_generate_variant:Nn \regex_extract_once:nnNTF {nV}
+\newcommand\VerbMath[2][]{%
+ \cs_if_exist:cTF{#2}{
+ \RenewDocumentEnvironment{#2}{+!b}{%
+ \NoFonts\expandafter\VerbMathToks\expandafter{\detokenize{##1}}{#2}\EndNoFonts%
+ \ifx\relax#1\relax\else%
+ \refstepcounter{#1}%
+ \regex_extract_once:nVNTF { label\s* \x{7B}([^\x{7D}]*)\x{7D}} {\l_tmpb_tl} \l_tmp_seq {\label{\seq_item:Nn\l_tmp_seq{2}}} {}%
+ \fi
}{}
}{}%
}
@@ -154,7 +166,7 @@ Require verbatim math environments.
\VerbMath{split}
\VerbMath{multline}
\VerbMath{multline*}
-\VerbMath{equation}
+\VerbMath[equation]{equation}
\VerbMath{equation*}
\VerbMath{math}
\VerbMath{displaymath}
@@ -204,3 +216,9 @@ Fixes for tables of contents.
\fixmathjaxtoc\\
\fixmathjaxtoc\exp
>>>
+
+\<configure mathjax-latex-4ht mhchem\><<<
+\def\ce#1{\texttt{\detokenize{\(\ce{#1}\)}}}
+>>>
+
+\endinput