texlive[72714] Master/texmf-dist: luamml (30oct24)
commits+karl at tug.org
commits+karl at tug.org
Wed Oct 30 21:03:25 CET 2024
Revision: 72714
https://tug.org/svn/texlive?view=revision&revision=72714
Author: karl
Date: 2024-10-30 21:03:25 +0100 (Wed, 30 Oct 2024)
Log Message:
-----------
luamml (30oct24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/lualatex/luamml/luamml.pdf
trunk/Master/texmf-dist/source/lualatex/luamml/luamml.dtx
trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-demo.sty
trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-amsmath.sty
trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-amstext.sty
trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-array.sty
trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-kernel.sty
trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-lab-math.sty
trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-pdf-demo.sty
trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-pdf.sty
trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-structelemwriter.lua
trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-table.lua
trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-tex-annotate.lua
trunk/Master/texmf-dist/tex/lualatex/luamml/luamml.sty
Added Paths:
-----------
trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-mathtools.sty
Removed Paths:
-------------
trunk/Master/texmf-dist/doc/lualatex/luamml/test-mathml-2.txt
Modified: trunk/Master/texmf-dist/doc/lualatex/luamml/luamml.pdf
===================================================================
(Binary files differ)
Deleted: trunk/Master/texmf-dist/doc/lualatex/luamml/test-mathml-2.txt
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamml/test-mathml-2.txt 2024-10-30 20:03:09 UTC (rev 72713)
+++ trunk/Master/texmf-dist/doc/lualatex/luamml/test-mathml-2.txt 2024-10-30 20:03:25 UTC (rev 72714)
@@ -1,8 +0,0 @@
-<math xmlns:tex="http://typesetting.eu/2021/LuaMathML" xmlns="http://www.w3.org/1998/Math/MathML">
- <mo lspace="0" rspace="0.167em" tex:class="opnolimits">
- sin
- </mo>
- <mi>
- 𝑥
- </mi>
-</math>
Modified: trunk/Master/texmf-dist/source/lualatex/luamml/luamml.dtx
===================================================================
--- trunk/Master/texmf-dist/source/lualatex/luamml/luamml.dtx 2024-10-30 20:03:09 UTC (rev 72713)
+++ trunk/Master/texmf-dist/source/lualatex/luamml/luamml.dtx 2024-10-30 20:03:25 UTC (rev 72714)
@@ -114,11 +114,11 @@
% \begin{macrocode}
%<@@=luamml>
%<*luatex>
-\ProvidesExplPackage {luamml} {2024-08-14} {0.1.0}
+\ProvidesExplPackage {luamml} {2024-10-30} {0.2.0}
{Automatically generate presentational MathML from LuaTeX math expressions}
%</luatex>
%<*pdftex>
-\ProvidesExplPackage {luamml-pdf} {2024-08-14} {0.1.0}
+\ProvidesExplPackage {luamml-pdf} {2024-10-30} {0.2.0}
{MathML generation for L̶u̶a̶pdfLaTeX}
%</pdftex>
% \end{macrocode}
@@ -170,17 +170,21 @@
% The most important interface is for setting the flag which controls how the
% formulas should be converted.
%
-% \begin{macro}{\luamml_flag_process:}
+% \begin{macro}{\luamml_process:}
% Consider the current formula to be a complete, free-standing mathematical
% expression which should be converted to MathML. Additionally, the formula
% is also saved in the \texttt{start\_math} node as with
-% \cs{luamml_flag_save:}.
+% \cs{luamml_save:}.
% \begin{macrocode}
-\cs_new_protected:Npn \luamml_flag_process: {
+\cs_new_protected:Npn \luamml_process: {
\tl_set:Nn \l__luamml_label_tl {}
\int_set:Nn \l__luamml_flag_int { 3 }
}
% \end{macrocode}
+% Temporarly for compatibility
+% \begin{macrocode}
+\cs_set_eq:NN \luamml_flag_process: \luamml_process:
+% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\__luamml_maybe_structelem:}
@@ -194,6 +198,7 @@
} {2}
) +
}
+% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\__luamml_style_to_num:N}
@@ -215,15 +220,15 @@
% \end{macro}
%
%
-% \begin{macro}{\luamml_flag_save:n,
-% \luamml_flag_save:nN,
-% \luamml_flag_save:nn,
-% \luamml_flag_save:nNn}
+% \begin{macro}{\luamml_save:n,
+% \luamml_save:nN,
+% \luamml_save:nn,
+% \luamml_save:nNn}
% Convert the current formula but only save it's representation in the math
% node without emitting it as a complete formula. This is useful when the
-% expression forms part of a bigger formula and will be intergrated into it's
+% expression forms part of a bigger formula and will be integrated into it's
% MathML tables later by special code.
-% It optinally accepts three parameters: A label, one math style command
+% It optionally accepts three parameters: A label, one math style command
% (\cs{displaystyle}, \cs{textstyle}, etc.) which is the implicit math style
% (so the style which the surrounding code expects this style to have) and a
% name for the root element (defaults to \texttt{mrow}).
@@ -230,46 +235,61 @@
% If the root element name is \texttt{mrow}, it will get suppressed in some
% cases.
% \begin{macrocode}
-\cs_new_protected:Npn \luamml_flag_save:n #1 {
+\cs_new_protected:Npn \luamml_save:n #1 {
\tl_set:Nn \l__luamml_label_tl {#1}
\int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 1 }
}
-\cs_new_protected:Npn \luamml_flag_save:nN #1#2 {
+\cs_new_protected:Npn \luamml_save:nN #1#2 {
\tl_set:Nn \l__luamml_label_tl {#1}
\int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 17 + \__luamml_style_to_num:N #2 }
}
-\cs_new_protected:Npn \luamml_flag_save:nn #1 {
+\cs_new_protected:Npn \luamml_save:nn #1 {
\tl_set:Nn \l__luamml_label_tl {#1}
\int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 5 }
\tl_set:Nn \l__luamml_root_tl
}
-\cs_new_protected:Npn \luamml_flag_save:nNn #1#2 {
+\cs_new_protected:Npn \luamml_save:nNn #1#2 {
\tl_set:Nn \l__luamml_label_tl {#1}
\int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 21 + \__luamml_style_to_num:N #2 }
\tl_set:Nn \l__luamml_root_tl
}
% \end{macrocode}
+% Temporarly for compatibility
+% \begin{macrocode}
+\cs_set_eq:NN \luamml_flag_save:n \luamml_save:n
+\cs_set_eq:NN \luamml_flag_save:nN \luamml_save:nN
+\cs_set_eq:NN \luamml_flag_save:nn \luamml_save:nn
+\cs_set_eq:NN \luamml_flag_save:nNn \luamml_save:nNn
+% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\luamml_flag_ignore:}
+% \begin{macro}{\luamml_ignore:}
% Completely ignore the math mode material.
% \begin{macrocode}
-\cs_new_protected:Npn \luamml_flag_ignore: {
+\cs_new_protected:Npn \luamml_ignore: {
\int_set:Nn \l__luamml_flag_int { 0 }
}
% \end{macrocode}
+% Temporarly for compatibility
+% \begin{macrocode}
+\cs_set_eq:NN \luamml_flag_ignore: \luamml_ignore:
+% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\luamml_flag_structelem:}
-% Like \cs{luamml_flag_process:}, but additionally add PDF structure
+% \begin{macro}{\luamml_structelem:}
+% Like \cs{luamml_process:}, but additionally adds PDF structure
% elements. This only works in Lua\TeX\ and requires that the \pkg{tagpdf} package
% has been loaded \emph{before} \texttt{luamml}.
% \begin{macrocode}
%<*luatex>
-\cs_new_protected:Npn \luamml_flag_structelem: {
+\cs_new_protected:Npn \luamml_structelem: {
\tl_set:Nn \l__luamml_label_tl {}
\int_set:Nn \l__luamml_flag_int { 11 }
}
+% \end{macrocode}
+% Temporarly for compatibility
+% \begin{macrocode}
+\cs_set_eq:NN \luamml_flag_structelem: \luamml_structelem:
%</luatex>
% \end{macrocode}
% \end{macro}
@@ -282,7 +302,7 @@
% The value is fully expanded when the file is written.
%
% Only complete formulas get written into files (so formulas where
-% \cs{luamml_flag_process:} or \cs{luamml_flag_structelem:} are in effect).
+% \cs{luamml_process:} or \cs{luamml_structelem:} are in effect).
%
% Only implemented in Lua\TeX, in pdf\TeX\ the arguments for \texttt{pdfmml}
% determine the output location.
@@ -304,7 +324,7 @@
%
% By default, the flag is set to assume complete formulas.
% \begin{macrocode}
-\luamml_flag_process:
+\luamml_process:
% \end{macrocode}
%
% \subsection{Annotations}
@@ -321,7 +341,7 @@
% let Lua\TeX determine the number itself.
%
% Passing the first parameter explicitly is useful for any annotations which
-% should be compatible with fututre pdf\TeX versions of this functionality.
+% should be compatible with future pdf\TeX versions of this functionality.
% \begin{macrocode}
\cs_new_protected:Npn \luamml_annotate:nen #1#2#3 {
\__luamml_annotate_begin:
@@ -520,6 +540,7 @@
%<*luatex>
\__luamml_patch_package:n {amstext}
\__luamml_patch_package:n {amsmath}
+\__luamml_patch_package:n {mathtools}
\__luamml_patch_package:n {array}
%</luatex>
% \end{macrocode}
Modified: trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-demo.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-demo.sty 2024-10-30 20:03:09 UTC (rev 72713)
+++ trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-demo.sty 2024-10-30 20:03:25 UTC (rev 72714)
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesExplPackage{luamml-demo}{2024-08-14}{v0.1.0}{Reasonable default definitions for luamml}
+\ProvidesExplPackage{luamml-demo}{2024-10-30}{0.2.0}{Reasonable default definitions for luamml}
\sys_if_engine_luatex:F {
\msg_new:nnn {luamml-demo} {pdftex-option-ignored} {Option~`#1'~is~being~ignored~in~pdfTeX~mode.}
@@ -27,7 +27,7 @@
}
\DeclareOption{structelem}{
\bool_set_true:N \l__luamml_demo_structelem_bool
- \luamml_flag_structelem:
+ \luamml_structelem:
}
\DeclareOption{files}{
\int_new:N \g__luamml_demo_mathml_int
Modified: trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-amsmath.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-amsmath.sty 2024-10-30 20:03:09 UTC (rev 72713)
+++ trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-amsmath.sty 2024-10-30 20:03:25 UTC (rev 72714)
@@ -1,4 +1,4 @@
-\ProvidesExplPackage {luamml-patches-amsmath} {2024-08-14} {0.1.0}
+\ProvidesExplPackage {luamml-patches-amsmath} {2024-10-30} {0.2.0}
{Feel free to add a description here}
\lua_now:n { require'luamml-amsmath' }
@@ -42,7 +42,7 @@
\m at th
\displaystyle
{##}
- \luamml_flag_save:nNn {} \displaystyle {mtd}
+ \luamml_save:nNn {} \displaystyle {mtd}
$
\__luamml_amsmath_add_last_to_row:
\tabskip \z at skip
@@ -54,7 +54,7 @@
{}
##
}
- \luamml_flag_save:nNn {} \displaystyle {mtd}
+ \luamml_save:nNn {} \displaystyle {mtd}
$
\__luamml_amsmath_add_last_to_row:
\hfil
@@ -85,7 +85,7 @@
\m at th
\displaystyle
##
- \luamml_flag_save:nNn {} \displaystyle {mtd}
+ \luamml_save:nNn {} \displaystyle {mtd}
$
\__luamml_amsmath_add_last_to_row:
\hfil
@@ -122,7 +122,7 @@
\m at th
\displaystyle
{##}
- \luamml_flag_save:nNn {} \displaystyle {mtd}
+ \luamml_save:nNn {} \displaystyle {mtd}
$
}
\__luamml_amsmath_add_box_to_row:
@@ -153,7 +153,7 @@
\cs_set:Npn \gmeasure@ #1 {
\exp_last_unbraced:Nno
\use_ii_i:nn
- { \luamml_flag_ignore: }
+ { \luamml_ignore: }
{ \__luamml_amsmath_original_gmeasure:n {#1} }
}
@@ -178,9 +178,9 @@
\displaystyle
{##}
\ifmeasuring@
- \luamml_flag_ignore:
+ \luamml_ignore:
\else
- \luamml_flag_save:nNn {} \displaystyle {mtd}
+ \luamml_save:nNn {} \displaystyle {mtd}
\fi
$
}
@@ -202,9 +202,9 @@
##
}
\ifmeasuring@
- \luamml_flag_ignore:
+ \luamml_ignore:
\else
- \luamml_flag_save:nNn {} \displaystyle {mtd}
+ \luamml_save:nNn {} \displaystyle {mtd}
\fi
$
}
@@ -289,7 +289,7 @@
\cs_set:Npn \mmeasure@ #1 {
\exp_last_unbraced:Nno
\use_ii_i:nn
- { \luamml_flag_ignore: }
+ { \luamml_ignore: }
{ \__luamml_amsmath_original_mmeasure:n {#1} }
}
@@ -298,7 +298,7 @@
% Less luckily, \endmultline at math sometimes get overwritten for the last line.
% But that isn't a problem since we want special behavior there anyway.
\cs_set:Npn \endmultline at math {
- \luamml_flag_save:nNn {} \displaystyle {mtd}
+ \luamml_save:nNn {} \displaystyle {mtd}
$
\__luamml_amsmath_add_last_to_row:
}
@@ -305,7 +305,7 @@
\cs_set:Npn \rendmultline@ {
\iftag@
- \luamml_flag_save:nNn {} \displaystyle {mtd}
+ \luamml_save:nNn {} \displaystyle {mtd}
$
\__luamml_amsmath_add_last_to_row:
\let \endmultline at math \relax
@@ -370,7 +370,7 @@
\m at th
\scriptstyle
##
- \luamml_flag_save:nn {} {mtd} % No \scriptsize here since we want to add the mstyle nodes
+ \luamml_save:nn {} {mtd} % No \scriptsize here since we want to add the mstyle nodes
$
\__luamml_amsmath_add_last_to_row:
\hfil
@@ -381,7 +381,7 @@
\m at th
\scriptstyle
##
- \luamml_flag_save:nn {} {mtd} % No \scriptsize here since we want to add the mstyle nodes
+ \luamml_save:nn {} {mtd} % No \scriptsize here since we want to add the mstyle nodes
$
\__luamml_amsmath_add_last_to_row:
\hfil
@@ -404,7 +404,7 @@
\let \@ifnextchar \new at ifnextchar
\left \lbrace
\def \arraystretch {1.2}
- \array {@{}l@{\quad \luamml_flag_ignore:}l@{}}
+ \array {@{}l@{\quad \luamml_ignore:}l@{}}
}
Modified: trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-amstext.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-amstext.sty 2024-10-30 20:03:09 UTC (rev 72713)
+++ trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-amstext.sty 2024-10-30 20:03:25 UTC (rev 72714)
@@ -1,4 +1,4 @@
-\ProvidesExplPackage {luamml-patches-amstext} {2024-08-14} {0.1.0}
+\ProvidesExplPackage {luamml-patches-amstext} {2024-10-30} {0.2.0}
{Feel free to add a description here}
\int_new:N \g__luamml_amsmath_text_struct_int
Modified: trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-array.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-array.sty 2024-10-30 20:03:09 UTC (rev 72713)
+++ trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-array.sty 2024-10-30 20:03:25 UTC (rev 72714)
@@ -1,4 +1,4 @@
-\ProvidesExplPackage {luamml-patches-array} {2024-08-14} {0.1.0}
+\ProvidesExplPackage {luamml-patches-array} {2024-10-30} {0.2.0}
{Feel free to add a description here}
\lua_now:n { require'luamml-array' }
@@ -18,7 +18,7 @@
} {
\__luamml_array_init_col:
\insert at column
- \luamml_flag_save:nn {} {mtd}
+ \luamml_save:nn {} {mtd}
\d at llarend
\__luamml_array_finalize_col:w 0~
}
@@ -33,7 +33,7 @@
} {
\__luamml_array_init_col:
\insert at column
- \luamml_flag_save:nn {} {mtd}
+ \luamml_save:nn {} {mtd}
\d at llarend
\__luamml_array_finalize_col:w 1~
}
@@ -49,7 +49,7 @@
} {
\__luamml_array_init_col:
\insert at column
- \luamml_flag_save:nn {} {mtd}
+ \luamml_save:nn {} {mtd}
\d at llarend
\__luamml_array_finalize_col:w 2~
}
@@ -56,18 +56,18 @@
\do at row@strut
\or
\setbox \ar at mcellbox \vbox \@startpbox { \@nextchar }
- \insert at column
+ \insert at pcolumn
\@endpbox
\ar at align@mcell
\do at row@strut
\or
\vtop \@startpbox { \@nextchar }
- \insert at column
+ \insert at pcolumn
\@endpbox
\do at row@strut
\or
\vbox \@startpbox { \@nextchar }
- \insert at column
+ \insert at pcolumn
\@endpbox
\do at row@strut
\fi
@@ -75,12 +75,27 @@
\prepnext at tok
}
-\cs_set:Npn \endarray {
- \crcr
- \__luamml_array_save_array:
- \egroup
- \egroup
- \mode_if_math:T { \__luamml_array_finalize_array: }
- \@arrayright
- \gdef \@preamble {}
+\IfPackageAtLeastTF {array} {2023/12/11} {
+ \cs_set:Npn \endarray {
+ \tbl_crcr:n{endarray}
+ \__luamml_array_save_array:
+ \egroup
+ \UseTaggingSocket{tbl/finalize}
+ \tbl_restore_outer_cell_data:
+ \egroup
+ \mode_if_math:T { \__luamml_array_finalize_array: }
+ \@arrayright
+ \gdef \@preamble {}
+ }
+} {
+ \cs_new_eq:NN \insert at pcolumn \insert at column
+ \cs_set:Npn \endarray {
+ \crcr
+ \__luamml_array_save_array:
+ \egroup
+ \egroup
+ \mode_if_math:T { \__luamml_array_finalize_array: }
+ \@arrayright
+ \gdef \@preamble {}
+ }
}
Modified: trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-kernel.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-kernel.sty 2024-10-30 20:03:09 UTC (rev 72713)
+++ trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-kernel.sty 2024-10-30 20:03:25 UTC (rev 72714)
@@ -1,14 +1,34 @@
-\ProvidesExplPackage {luamml-patches-kernel} {2024-08-14} {0.1.0}
+\ProvidesExplPackage {luamml-patches-kernel} {2024-10-30} {0.2.0}
{Feel free to add a description here}
-\cs_new:Npn \__luamml_kernel_phantom:nnn #1#2#3 {
+\cs_set:Npn \mathsm at sh #1 #2 {
+ \setbox \z@ \hbox {
+ $
+ \m at th #1 {
+ #2
+ }
+ \luamml_save:nNn {mathsmash} #1 {mpadded}
+ \luamml_pdf_write:
+ $
+ }
+ \luamml_annotate:nen {2} {
+ nucleus = true,
+ core = consume_label('mathsmash', function(padded)
+ padded.height, padded.depth = 0, 0~
+ end),
+ } {
+ {}
+ \finsm at sh
+ }
+}
+
+\cs_set:Npn \mathph at nt #1 #2 {
\setbox \z@ = \hbox {
$
\m at th
- #2
- {#3}
- \luamml_flag_save:nNn {mathphant_#1} #2 {mphantom}
- \luamml_pdf_write:
+ #1
+ {#2}
+ \luamml_save:nNn {mathphant} #1 {mphantom}
$
}
\luamml_annotate:nen {1} {
@@ -20,20 +40,13 @@
\ifv@\else
height = 0, depth = 0,
\fi
- data.mathml.mathphant_#1,
+ consume_label'mathphant',
}
} {
\finph at nt
}
}
-\cs_generate_variant:Nn \__luamml_kernel_phantom:nnn {V}
-\int_new:N \g__luamml_kernel_phantom_int
-\cs_set:Npn \mathph at nt {
- \int_gincr:N \g__luamml_kernel_phantom_int
- \__luamml_kernel_phantom:Vnn \g__luamml_kernel_phantom_int
-}
-
\@ifpackageloaded {unicode-math} {} {
\cs_new:Npn \__luamml_kernel_define_character:Nnn #1#2#3 {
\cs_set:cpx { \cs_to_str:N #1 ~ } {
Modified: trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-lab-math.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-lab-math.sty 2024-10-30 20:03:09 UTC (rev 72713)
+++ trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-lab-math.sty 2024-10-30 20:03:25 UTC (rev 72714)
@@ -1,4 +1,4 @@
-\ProvidesExplPackage {luamml-patches-lab-math} {2024-08-14} {0.1.0}
+\ProvidesExplPackage {luamml-patches-lab-math} {2024-10-30} {0.2.0}
{Feel free to add a description here}
\AddToHook{begindocument} {
Added: trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-mathtools.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-mathtools.sty (rev 0)
+++ trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-mathtools.sty 2024-10-30 20:03:25 UTC (rev 72714)
@@ -0,0 +1,35 @@
+\ProvidesExplPackage {luamml-patches-mathtools} {2024-10-26} {0.2.0}
+ {Feel free to add a description here}
+
+\RequirePackage{luamml-patches-amsmath}
+% see https://github.com/latex3/tagging-project/issues/734
+\renewcommand*\MT_mult_internal:n [1]{
+ \MH_if_boolean:nF {outer_mult}{\alignedspace at left} %<-- requires amsmath 2016/11/05
+ \MT_next:
+ \bgroup
+ \Let@
+ \def\l_MT_multline_lastline_fint{0 }
+ \chardef\dspbrk at context\@ne \restore at math@cr
+ \MH_let:NwN \math at cr@@\MT_mult_mathcr_atat:w
+ \MH_let:NwN \shoveleft\MT_shoveleft:wn
+ \MH_let:NwN \shoveright\MT_shoveright:wn
+ \spread at equation
+ \MH_set_boolean_F:n {mult_firstline}
+ \MT_measure_mult:n {#1}
+ \MH_if_dim:w \l_MT_multwidth_dim<\l_MT_multline_measure_fdim
+ \MH_setlength:dn \l_MT_multwidth_dim{\l_MT_multline_measure_fdim}
+ \fi
+ \MH_set_boolean_T:n {mult_firstline}
+ \MH_if_num:w \l_MT_multline_lastline_fint=\@ne
+ \MH_let:NwN \math at cr@@ \MT_mult_firstandlast_mathcr:w
+ \MH_fi:
+ \ialign\bgroup
+ \hfil\strut@$\m at th\displaystyle{}##
+ \luamml_save:nNn {} \displaystyle {mtd}
+ $
+ \__luamml_amsmath_add_last_to_row:
+ \hfil
+ \crcr
+ \hfilneg
+ #1
+}
Property changes on: trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-mathtools.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-pdf-demo.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-pdf-demo.sty 2024-10-30 20:03:09 UTC (rev 72713)
+++ trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-pdf-demo.sty 2024-10-30 20:03:25 UTC (rev 72714)
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesExplPackage{luamml-pdf-demo}{2024-08-14}{v0.1.0}{Reasonable default definitions for luamml-pdf}
+\ProvidesExplPackage{luamml-pdf-demo}{2024-10-30}{0.2.0}{Reasonable default definitions for luamml-pdf}
\RequirePackage{luamml-pdf}% Loading luamml-pdf is pretty much the point
% \RequirePackage{amsmath,array}% May come back if the patches get ported
Modified: trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-pdf.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-pdf.sty 2024-10-30 20:03:09 UTC (rev 72713)
+++ trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-pdf.sty 2024-10-30 20:03:25 UTC (rev 72714)
@@ -31,7 +31,7 @@
%%
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
-\ProvidesExplPackage {luamml-pdf} {2024-08-14} {0.1.0}
+\ProvidesExplPackage {luamml-pdf} {2024-10-30} {0.2.0}
{MathML generation for L̶u̶a̶pdfLaTeX}
\int_new:N \l__luamml_flag_int
\int_new:N \l__luamml_pretty_int
@@ -42,10 +42,11 @@
\int_set:Nn \l__luamml_pretty_int { 1 }
-\cs_new_protected:Npn \luamml_flag_process: {
+\cs_new_protected:Npn \luamml_process: {
\tl_set:Nn \l__luamml_label_tl {}
\int_set:Nn \l__luamml_flag_int { 3 }
}
+\cs_set_eq:NN \luamml_flag_process: \luamml_process:
\cs_new:Npn \__luamml_maybe_structelem: {
(
8 * \int_mod:nn {
@@ -63,28 +64,33 @@
\Invalid_mathstyle
}
}
-\cs_new_protected:Npn \luamml_flag_save:n #1 {
+\cs_new_protected:Npn \luamml_save:n #1 {
\tl_set:Nn \l__luamml_label_tl {#1}
\int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 1 }
}
-\cs_new_protected:Npn \luamml_flag_save:nN #1#2 {
+\cs_new_protected:Npn \luamml_save:nN #1#2 {
\tl_set:Nn \l__luamml_label_tl {#1}
\int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 17 + \__luamml_style_to_num:N #2 }
}
-\cs_new_protected:Npn \luamml_flag_save:nn #1 {
+\cs_new_protected:Npn \luamml_save:nn #1 {
\tl_set:Nn \l__luamml_label_tl {#1}
\int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 5 }
\tl_set:Nn \l__luamml_root_tl
}
-\cs_new_protected:Npn \luamml_flag_save:nNn #1#2 {
+\cs_new_protected:Npn \luamml_save:nNn #1#2 {
\tl_set:Nn \l__luamml_label_tl {#1}
\int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 21 + \__luamml_style_to_num:N #2 }
\tl_set:Nn \l__luamml_root_tl
}
-\cs_new_protected:Npn \luamml_flag_ignore: {
+\cs_set_eq:NN \luamml_flag_save:n \luamml_save:n
+\cs_set_eq:NN \luamml_flag_save:nN \luamml_save:nN
+\cs_set_eq:NN \luamml_flag_save:nn \luamml_save:nn
+\cs_set_eq:NN \luamml_flag_save:nNn \luamml_save:nNn
+\cs_new_protected:Npn \luamml_ignore: {
\int_set:Nn \l__luamml_flag_int { 0 }
}
-\luamml_flag_process:
+\cs_set_eq:NN \luamml_flag_ignore: \luamml_ignore:
+\luamml_process:
\cs_if_exist:NTF \showstream {
\iow_new:N \l__luamml_pdf_stream
Modified: trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-structelemwriter.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-structelemwriter.lua 2024-10-30 20:03:09 UTC (rev 72713)
+++ trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-structelemwriter.lua 2024-10-30 20:03:25 UTC (rev 72714)
@@ -13,9 +13,27 @@
return str
end
+local ltx
+local function get_ltx()
+ if not ltx then
+ ltx = _ENV.ltx
+ if not ltx then
+ tex.error("LaTeX PDF support not loaded", {"Maybe try adding \\DocumentMetadata."})
+ ltx = {pdf = {object_id = function() return 0 end}}
+ end
+ end
+ return ltx
+end
+
local mathml_ns_obj
local function get_mathml_ns_obj()
- mathml_ns_obj = mathml_ns_obj or token.create'c__pdf_backend_object_tag/NS/mathml_int'.index
+ if not mathml_ns_obj then
+ mathml_ns_obj = get_ltx().pdf.object_id'tag/NS/mathml'
+ if not mathml_ns_obj then
+ tex.error("Failed to find MathML namespace", {"The PDF support does not know the mathml namespace"})
+ mathml_ns_obj = 0
+ end
+ end
return mathml_ns_obj
end
Modified: trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-table.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-table.lua 2024-10-30 20:03:09 UTC (rev 72713)
+++ trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-table.lua 2024-10-30 20:03:25 UTC (rev 72714)
@@ -58,7 +58,7 @@
local function store_tag(xml)
local mml_row = store_get_row()
- mml_row[0] = 'mlabeledtr'
+ xml.intent = ':equationlabel'
table.insert(mml_row, 1, xml)
last_tag = nil
end
Modified: trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-tex-annotate.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-tex-annotate.lua 2024-10-30 20:03:09 UTC (rev 72713)
+++ trunk/Master/texmf-dist/tex/lualatex/luamml/luamml-tex-annotate.lua 2024-10-30 20:03:25 UTC (rev 72714)
@@ -6,6 +6,15 @@
data = {
},
}
+do
+ local _ENV = mark_environment
+ function consume_label(label, fn)
+ local mathml = data.mathml[label]
+ data.mathml[label] = nil
+ if fn then fn(mathml) end
+ return mathml
+ end
+end
local function annotate()
local annotation, err = load( 'return {'
@@ -59,10 +68,10 @@
props = {}
properties[marked] = props
end
- if annotation.core then
+ if annotation.core ~= nil then
props.mathml_core = annotation.core
end
- if annotation.struct then
+ if annotation.struct ~= nil then
local saved = props.mathml_filter
local struct = annotation.struct
function props.mathml_filter(mml, core)
Modified: trunk/Master/texmf-dist/tex/lualatex/luamml/luamml.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luamml/luamml.sty 2024-10-30 20:03:09 UTC (rev 72713)
+++ trunk/Master/texmf-dist/tex/lualatex/luamml/luamml.sty 2024-10-30 20:03:25 UTC (rev 72714)
@@ -31,7 +31,7 @@
%%
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
-\ProvidesExplPackage {luamml} {2024-08-14} {0.1.0}
+\ProvidesExplPackage {luamml} {2024-10-30} {0.2.0}
{Automatically generate presentational MathML from LuaTeX math expressions}
\int_new:N \l__luamml_flag_int
\int_new:N \l__luamml_pretty_int
@@ -50,10 +50,11 @@
}
\__luamml_register_output_hook:N \__luamml_output_hook:n
-\cs_new_protected:Npn \luamml_flag_process: {
+\cs_new_protected:Npn \luamml_process: {
\tl_set:Nn \l__luamml_label_tl {}
\int_set:Nn \l__luamml_flag_int { 3 }
}
+\cs_set_eq:NN \luamml_flag_process: \luamml_process:
\cs_new:Npn \__luamml_maybe_structelem: {
(
8 * \int_mod:nn {
@@ -64,35 +65,41 @@
\cs_new:Npn \__luamml_style_to_num:N #1 {
32 * #1
}
-\cs_new_protected:Npn \luamml_flag_save:n #1 {
+\cs_new_protected:Npn \luamml_save:n #1 {
\tl_set:Nn \l__luamml_label_tl {#1}
\int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 1 }
}
-\cs_new_protected:Npn \luamml_flag_save:nN #1#2 {
+\cs_new_protected:Npn \luamml_save:nN #1#2 {
\tl_set:Nn \l__luamml_label_tl {#1}
\int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 17 + \__luamml_style_to_num:N #2 }
}
-\cs_new_protected:Npn \luamml_flag_save:nn #1 {
+\cs_new_protected:Npn \luamml_save:nn #1 {
\tl_set:Nn \l__luamml_label_tl {#1}
\int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 5 }
\tl_set:Nn \l__luamml_root_tl
}
-\cs_new_protected:Npn \luamml_flag_save:nNn #1#2 {
+\cs_new_protected:Npn \luamml_save:nNn #1#2 {
\tl_set:Nn \l__luamml_label_tl {#1}
\int_set:Nn \l__luamml_flag_int { \__luamml_maybe_structelem: 21 + \__luamml_style_to_num:N #2 }
\tl_set:Nn \l__luamml_root_tl
}
-\cs_new_protected:Npn \luamml_flag_ignore: {
+\cs_set_eq:NN \luamml_flag_save:n \luamml_save:n
+\cs_set_eq:NN \luamml_flag_save:nN \luamml_save:nN
+\cs_set_eq:NN \luamml_flag_save:nn \luamml_save:nn
+\cs_set_eq:NN \luamml_flag_save:nNn \luamml_save:nNn
+\cs_new_protected:Npn \luamml_ignore: {
\int_set:Nn \l__luamml_flag_int { 0 }
}
-\cs_new_protected:Npn \luamml_flag_structelem: {
+\cs_set_eq:NN \luamml_flag_ignore: \luamml_ignore:
+\cs_new_protected:Npn \luamml_structelem: {
\tl_set:Nn \l__luamml_label_tl {}
\int_set:Nn \l__luamml_flag_int { 11 }
}
+\cs_set_eq:NN \luamml_flag_structelem: \luamml_structelem:
\cs_new_protected:Npn \luamml_set_filename:n {
\tl_set:Nn \l__luamml_filename_tl
}
-\luamml_flag_process:
+\luamml_process:
\cs_new_protected:Npn \luamml_annotate:nen #1#2#3 {
\__luamml_annotate_begin:
#3
@@ -119,6 +126,7 @@
\RequirePackage { luamml-patches-kernel }
\__luamml_patch_package:n {amstext}
\__luamml_patch_package:n {amsmath}
+\__luamml_patch_package:n {mathtools}
\__luamml_patch_package:n {array}
\endinput
More information about the tex-live-commits
mailing list.