texlive[61097] Master/texmf-dist: latex3 cmds for \VerbMath, tex4ht
commits+karl at tug.org
commits+karl at tug.org
Sat Nov 20 18:58:46 CET 2021
Revision: 61097
http://tug.org/svn/texlive?view=revision&revision=61097
Author: karl
Date: 2021-11-20 18:58:46 +0100 (Sat, 20 Nov 2021)
Log Message:
-----------
latex3 cmds for \VerbMath, tex4ht r1012
Revision Links:
--------------
http://tug.org/svn/texlive?view=revision&revision=1012
Modified Paths:
--------------
trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathjax.tex
trunk/Master/texmf-dist/tex/generic/tex4ht/mathjax-latex-4ht.4ht
Modified: trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog 2021-11-20 09:29:33 UTC (rev 61096)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog 2021-11-20 17:58:46 UTC (rev 61097)
@@ -1,3 +1,8 @@
+2021-11-19 Michal Hoftich <michal.h21 at gmail.com>
+
+ * tex4ht-mathjax.tex (mathjax-latex-4ht.4ht): use LaTeX 3 commands in
+ \VerbMath, this enables us to remove dependency on external packages.
+
2021-11-09 Michal Hoftich <michal.h21 at gmail.com>
* tex4ht-html4.tex (html4.4ht): added CSS declaration that enables table row
Modified: trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathjax.tex
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathjax.tex 2021-11-20 09:29:33 UTC (rev 61096)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathjax.tex 2021-11-20 17:58:46 UTC (rev 61097)
@@ -1,4 +1,4 @@
-% $Id: tex4ht-mathjax.tex 979 2021-09-14 17:59:36Z michal_h21 $
+% $Id: tex4ht-mathjax.tex 1012 2021-11-19 09:35:54Z michal_h21 $
% compile: latex tex4ht-mathjax
%
% Copyright 2018-2021 TeX Users Group
@@ -29,8 +29,10 @@
\endinput
>>>
+We don't require additional packages anymore, as everything necessary is included
+in LaTeX kernel now.
+% \RequirePackage{etoolbox,expl3,environ}
\<required packages\><<<
-\RequirePackage{etoolbox,expl3,environ}
>>>
The \verb|\alteqtoks| command saves the used command in HTML. It uses detokenize command
@@ -60,6 +62,8 @@
\regex_replace_all:nnN { \x{26} } { & } \l_tmpa_tl
\regex_replace_all:nnN { \x{3C} } { < } \l_tmpa_tl
\regex_replace_all:nnN { \x{3E} } { > } \l_tmpa_tl
+ % replace \par command with blank lines
+ \regex_replace_all:nnN { \x{5C}par } {\x{A}\x{A}} \l_tmpa_tl
\tl_set:Nx \l_tmpb_tl{ \l_tmpa_tl }
\HCode{\l_tmpb_tl}
}
@@ -90,13 +94,21 @@
#1
\end{#2}}%
}
+>>>
+
+The \verb|\VerbMath| command redefines environments to pass their content
+verbatim to the HTML output.
+
+\<defined commands\><<<
+\ExplSyntaxOn
\newcommand\VerbMath[1]{%
-\ifcsdef{#1}{%
- \RenewEnviron{#1}{%
- \NoFonts\expandafter\VerbMathToks\expandafter{\BODY}{#1}\EndNoFonts%
- }
-}{}%
+ \cs_if_exist:cTF{#1}{
+ \RenewDocumentEnvironment{#1}{+!b}{%
+ \NoFonts\expandafter\VerbMathToks\expandafter{##1}{#1}\EndNoFonts%
+ }{}
+ }{}%
}
+\ExplSyntaxOff
>>>
The \verb|\fixmathjaxtoc| command is used for patching commands which should
Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/mathjax-latex-4ht.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/mathjax-latex-4ht.4ht 2021-11-20 09:29:33 UTC (rev 61096)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/mathjax-latex-4ht.4ht 2021-11-20 17:58:46 UTC (rev 61097)
@@ -1,4 +1,4 @@
-% mathjax-latex-4ht.sty (2021-09-14-14:13), generated from tex4ht-mathjax.tex
+% mathjax-latex-4ht.sty (2021-11-20-09:56), generated from tex4ht-mathjax.tex
% Copyright 2018-2021 TeX Users Group
%
% This work may be distributed and/or modified under the
@@ -16,9 +16,8 @@
%
% If you modify this program, changing the
% version identification would be appreciated.
-\immediate\write-1{version 2021-09-14-14:13}
+\immediate\write-1{version 2021-11-20-09:56}
-\RequirePackage{etoolbox,expl3,environ}
\ExplSyntaxOn
\cs_new_protected:Npn \alteqtoks #1
@@ -28,6 +27,8 @@
\regex_replace_all:nnN { \x{26} } { & } \l_tmpa_tl
\regex_replace_all:nnN { \x{3C} } { < } \l_tmpa_tl
\regex_replace_all:nnN { \x{3E} } { > } \l_tmpa_tl
+ % replace \par command with blank lines
+ \regex_replace_all:nnN { \x{5C}par } {\x{A}\x{A}} \l_tmpa_tl
\tl_set:Nx \l_tmpb_tl{ \l_tmpa_tl }
\HCode{\l_tmpb_tl}
}
@@ -47,13 +48,15 @@
#1
\end{#2}}%
}
+\ExplSyntaxOn
\newcommand\VerbMath[1]{%
-\ifcsdef{#1}{%
- \RenewEnviron{#1}{%
- \NoFonts\expandafter\VerbMathToks\expandafter{\BODY}{#1}\EndNoFonts%
- }
-}{}%
+ \cs_if_exist:cTF{#1}{
+ \RenewDocumentEnvironment{#1}{+!b}{%
+ \NoFonts\expandafter\VerbMathToks\expandafter{##1}{#1}\EndNoFonts%
+ }{}
+ }{}%
}
+\ExplSyntaxOff
\def\fixmathjaxtoc#1{\Configure{writetoc}{\def#1{\detokenize{#1}}}}
\def\fixmathjaxsec#1{\def#1{\detokenize{#1}}}
More information about the tex-live-commits
mailing list.