texlive[73379] Master/texmf-dist: better aligned support, tex4ht
commits+karl at tug.org
commits+karl at tug.org
Thu Jan 9 00:09:13 CET 2025
Revision: 73379
https://tug.org/svn/texlive?view=revision&revision=73379
Author: karl
Date: 2025-01-09 00:09:13 +0100 (Thu, 09 Jan 2025)
Log Message:
-----------
better aligned support, tex4ht r1621-1623
Revision Links:
--------------
https://tug.org/svn/texlive?view=revision&revision=1621
Modified Paths:
--------------
trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex
trunk/Master/texmf-dist/tex/generic/tex4ht/amsmath.4ht
trunk/Master/texmf-dist/tex/generic/tex4ht/mathml.4ht
Modified: trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog 2025-01-08 21:19:18 UTC (rev 73378)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog 2025-01-08 23:09:13 UTC (rev 73379)
@@ -1,3 +1,10 @@
+2025-01-08 Michal Hoftich <michal.h21 at gmail.com>
+
+ * tex4ht-mathml.tex (mathml.4ht),
+ * tex4ht-4ht.tex (amsmath.4ht): fixed handling of optional arguments
+ and empty first columns in aligned, alignedat and gathered
+ environments. Thanks to Linas Stonys.
+
2025-01-05 Michal Hoftich <michal.h21 at gmail.com>
* tex4ht-mathml.tex (mathml.4ht): don't configure tilde accents in
Modified: trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex 2025-01-08 21:19:18 UTC (rev 73378)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex 2025-01-08 23:09:13 UTC (rev 73379)
@@ -1,4 +1,4 @@
-% $Id: tex4ht-4ht.tex 1618 2025-01-05 16:19:50Z karl $
+% $Id: tex4ht-4ht.tex 1622 2025-01-08 15:24:04Z michal_h21 $
% tex tex4ht-4ht or ht tex tex4ht-4ht
%
% Copyright 2009-2025 TeX Users Group
@@ -21916,28 +21916,61 @@
\RecallMkHalignConfig \restorecolumn@
\egroup \b:start at aligned}
\HLet\endaligned|=\:tempc
+\def\reg:aligned{\reg:start at aligned}
+\NewConfigure{aligned}{6}
+>>>
+
+This is the original code for the aligned environment. It had issues with empty
+first cell, resulting in compilaton error.
+
+\<aligned do not use\><<<
\def\:temp{%
\let\@testopt\alignsafe at testopt
- \futurelet\:temp\aligned:a}
-\def\aligned:a{\ifx [\:temp \expandafter\aligned:b
- \else \def\:temp{\aligned:b[c]}\expandafter\:temp \fi}
+ \aligned:a}
+ \providecommand\aligned:a[1][c]{\aligned:b[#1]}
\def\aligned:b[#1]{%
\al:gned{aligned}{#1}\m at ne}
\HLet\aligned|=\:temp
-\def\reg:aligned{\reg:start at aligned}
-\NewConfigure{aligned}{6}
>>>
+
+This report and fix comes from Linas Stonys:
+
\<equations of amsmath.sty\><<<
-\def\:temp{\futurelet\:temp\alignedat:a}
-\def\alignedat:a{\ifx [\:temp \expandafter\alignedat:b
- \else \def\:temp{\alignedat:b[c]}\expandafter\:temp \fi}
-\def\alignedat:b[#1]{%
+\def\Hlcr{z}
+%% \Hlcr macro stores math environment optional possitionig argument
+%% and can be used for custom setup. For example:
+%% \Configure{gathered}
+%% {\HCode{<\a:mathml mtable\space displaystyle="true"
+%% \mml:class="gathered"%
+%% \if t\Hlcr\space\a:mathml align="axis 1"\fi%
+%% \if b\Hlcr\space\a:mathml align="axis -1"\fi%
+%% >}}
+%% {}...
+
+\def\:temp#1{%
+ \def\Hlcr{#1}%
+ \let\@testopt\alignsafe at testopt
+ \expandafter\al:gned\expandafter{\@currenvir}{#1}}
+\HLet\start at aligned\:temp
+
+>>>
+
+
+\<equations of amsmath.sty\><<<
+\def\reg:alignedat{\reg:start at aligned}
+\NewConfigure{alignedat}{6}
+>>>
+
+This code is superseded by start at aligned code above.
+
+\<alignedat do not use\><<<
+\def\:temp{\alignedat:a}
+\providecommand\alignedat:a[1][c]{\alignedat:b[#1]}
+\def\alignedat:b[#1]#2{%
\let\@testopt\alignsafe at testopt
\al:gned{alignedat}{#1}\m at ne}
\HLet\alignedat|=\:temp
-\def\reg:alignedat{\reg:start at aligned}
-\NewConfigure{alignedat}{6}
>>>
% \def\:tempc{\crcr\EndMkHalign
@@ -21949,7 +21982,17 @@
\SubSection{Gathered}
%%%%%%%%%%%%%
+This code comes from Linas Stonys.
+
\<equations of amsmath.sty\><<<
+\def\gathered:a[#1]{\def\Hlcr{#1}\pic:MkHalign{gathered}[#1]}
+\def\:temp{%
+ \kernel at ifnextchar[{\gathered:a}{\gathered:a[c]}%
+ }
+\HLet\gathered\:temp
+>>>
+
+\<equations of amsmath.sty\><<<
\catcode`\#|=13 \catcode`\!|=6
\def\reg:gathered[!1]{%
\RIfM@\else
Modified: trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex 2025-01-08 21:19:18 UTC (rev 73378)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex 2025-01-08 23:09:13 UTC (rev 73379)
@@ -1,4 +1,4 @@
-% $Id: tex4ht-mathml.tex 1620 2025-01-05 21:36:18Z karl $$
+% $Id: tex4ht-mathml.tex 1623 2025-01-08 21:13:08Z michal_h21 $$
% compile 3 times: latex tex4ht-mathltx
% or xhlatex tex4ht-mathltx "html,3,sections+"
%
@@ -2419,7 +2419,7 @@
\<amsmath mathml\><<<
\Configure{gathered}
- {\HCode{<\a:mathml mtable\Hnewline \mml:class="gathered">}}
+ {\HCode{<\a:mathml mtable\Hnewline \mml:class="gathered" \mtable:align:attribute>}}
{\HCode{</\a:mathml mtable>}}
{\HCode{<\a:mathml mtr>}} {\HCode{</\a:mathml mtr>}}
{\HCode{\Hnewline<\a:mathml mtd>}} {\HCode{</\a:mathml mtd>}}
@@ -4402,8 +4402,14 @@
\<configure mathml amsmath\><<<
+% thanks to Linas Stonys for this code
+\def\mtable:align:attribute{%
+ \if t\Hlcr\space\a:mathml align="axis 1"\fi
+ \if b\Hlcr\space\a:mathml align="axis -1"\fi
+ }
+
\Configure{aligned}
- {\HCode{<\a:mathml mtable\Hnewline \mml:class="aligned">}}
+ {\HCode{<\a:mathml mtable\Hnewline \mml:class="aligned" \mtable:align:attribute>}}
{\HCode{</\a:mathml mtable>}}
{\HCode{<\a:mathml mtr\Hnewline>}} {\HCode{</\a:mathml mtr>}}
{\HCode{<\a:mathml mtd
@@ -4410,7 +4416,7 @@
\a:mathml columnalign="\ifodd\HCol right\else left\fi" >}}
{\HCode{</\a:mathml mtd>}}
\Configure{alignedat}
- {\HCode{<\a:mathml mtable\Hnewline \mml:class="alignedat">}}
+ {\HCode{<\a:mathml mtable\Hnewline \mml:class="alignedat" \mtable:align:attribute>}}
{\HCode{</\a:mathml mtable>}}
{\HCode{<\a:mathml mtr\Hnewline>}} {\HCode{</\a:mathml mtr>}}
{\HCode{<\a:mathml mtd
Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/amsmath.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/amsmath.4ht 2025-01-08 21:19:18 UTC (rev 73378)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/amsmath.4ht 2025-01-08 23:09:13 UTC (rev 73379)
@@ -1,6 +1,6 @@
-% amsmath.4ht (2024-09-24-10:22), generated from tex4ht-4ht.tex
+% amsmath.4ht (2025-01-08-13:38), generated from tex4ht-4ht.tex
% Copyright 1997-2009 Eitan M. Gurari
-% Copyright 2009-2024 TeX Users Group
+% Copyright 2009-2025 TeX Users Group
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
@@ -17,7 +17,7 @@
%
% If you modify this program, changing the
% version identification would be appreciated.
-\immediate\write-1{version 2024-09-24-10:22}
+\immediate\write-1{version 2025-01-08-13:38}
\HRestore\cases
\HRestore\matrix
@@ -312,25 +312,32 @@
\RecallMkHalignConfig \restorecolumn@
\egroup \b:start at aligned}
\HLet\endaligned\:tempc
-\def\:temp{%
- \let\@testopt\alignsafe at testopt
- \futurelet\:temp\aligned:a}
-\def\aligned:a{\ifx [\:temp \expandafter\aligned:b
- \else \def\:temp{\aligned:b[c]}\expandafter\:temp \fi}
-\def\aligned:b[#1]{%
- \al:gned{aligned}{#1}\m at ne}
-\HLet\aligned\:temp
\def\reg:aligned{\reg:start at aligned}
\NewConfigure{aligned}{6}
-\def\:temp{\futurelet\:temp\alignedat:a}
-\def\alignedat:a{\ifx [\:temp \expandafter\alignedat:b
- \else \def\:temp{\alignedat:b[c]}\expandafter\:temp \fi}
-\def\alignedat:b[#1]{%
- \let\@testopt\alignsafe at testopt
- \al:gned{alignedat}{#1}\m at ne}
-\HLet\alignedat\:temp
+\def\Hlcr{z}
+%% \Hlcr macro stores math environment optional possitionig argument
+%% and can be used for custom setup. For example:
+%% \Configure{gathered}
+%% {\HCode{<\a:mathml mtable\space displaystyle="true"
+%% \mml:class="gathered"%
+%% \if t\Hlcr\space\a:mathml align="axis 1"\fi%
+%% \if b\Hlcr\space\a:mathml align="axis -1"\fi%
+%% >}}
+%% {}...
+
+\def\:temp#1{%
+ \def\Hlcr{#1}%
+ \let\@testopt\alignsafe at testopt
+ \expandafter\al:gned\expandafter{\@currenvir}{#1}}
+\HLet\start at aligned\:temp
+
\def\reg:alignedat{\reg:start at aligned}
\NewConfigure{alignedat}{6}
+\def\gathered:a[#1]{\def\Hlcr{#1}\pic:MkHalign{gathered}[#1]}
+\def\:temp{%
+ \kernel at ifnextchar[{\gathered:a}{\gathered:a[c]}%
+ }
+\HLet\gathered\:temp
\catcode`\#13 \catcode`\!6
\def\reg:gathered[!1]{%
\RIfM@\else
Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/mathml.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/mathml.4ht 2025-01-08 21:19:18 UTC (rev 73378)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/mathml.4ht 2025-01-08 23:09:13 UTC (rev 73379)
@@ -1,4 +1,4 @@
-% mathml.4ht (2025-01-05-13:36), generated from tex4ht-mathml.tex
+% mathml.4ht (2025-01-08-13:38), generated from tex4ht-mathml.tex
% Copyright 2009-2025 TeX Users Group
% Copyright 1999-2009 Eitan M. Gurari
%
@@ -17,7 +17,7 @@
%
% If you modify this program, changing the
% version identification would be appreciated.
-\immediate\write-1{version 2025-01-05-13:36}
+\immediate\write-1{version 2025-01-08-13:38}
\exit:ifnot{Preamble,%
accents,%
@@ -1972,7 +1972,7 @@
\:tempc{xalignat*}{xalignat-star}
\:tempc{flalign*}{flalign-star}
\Configure{gathered}
- {\HCode{<\a:mathml mtable\Hnewline \mml:class="gathered">}}
+ {\HCode{<\a:mathml mtable\Hnewline \mml:class="gathered" \mtable:align:attribute>}}
{\HCode{</\a:mathml mtable>}}
{\HCode{<\a:mathml mtr>}} {\HCode{</\a:mathml mtr>}}
{\HCode{\Hnewline<\a:mathml mtd>}} {\HCode{</\a:mathml mtd>}}
@@ -2161,8 +2161,14 @@
\ifx \ilimits@\o:displaylimits:
\let\ilimits@\nolimits
\fi
+% thanks to Linas Stonys for this code
+\def\mtable:align:attribute{%
+ \if t\Hlcr\space\a:mathml align="axis 1"\fi
+ \if b\Hlcr\space\a:mathml align="axis -1"\fi
+ }
+
\Configure{aligned}
- {\HCode{<\a:mathml mtable\Hnewline \mml:class="aligned">}}
+ {\HCode{<\a:mathml mtable\Hnewline \mml:class="aligned" \mtable:align:attribute>}}
{\HCode{</\a:mathml mtable>}}
{\HCode{<\a:mathml mtr\Hnewline>}} {\HCode{</\a:mathml mtr>}}
{\HCode{<\a:mathml mtd
@@ -2169,7 +2175,7 @@
\a:mathml columnalign="\ifodd\HCol right\else left\fi" >}}
{\HCode{</\a:mathml mtd>}}
\Configure{alignedat}
- {\HCode{<\a:mathml mtable\Hnewline \mml:class="alignedat">}}
+ {\HCode{<\a:mathml mtable\Hnewline \mml:class="alignedat" \mtable:align:attribute>}}
{\HCode{</\a:mathml mtable>}}
{\HCode{<\a:mathml mtr\Hnewline>}} {\HCode{</\a:mathml mtr>}}
{\HCode{<\a:mathml mtd
More information about the tex-live-commits
mailing list.