texlive[74503] branches/branch2024.final/Master/texmf-dist: luamml
commits+karl at tug.org
commits+karl at tug.org
Fri Mar 7 23:39:29 CET 2025
Revision: 74503
https://tug.org/svn/texlive?view=revision&revision=74503
Author: karl
Date: 2025-03-07 23:39:29 +0100 (Fri, 07 Mar 2025)
Log Message:
-----------
luamml (branch) (7mar25)
Modified Paths:
--------------
branches/branch2024.final/Master/texmf-dist/doc/lualatex/luamml/CHANGELOG.md
branches/branch2024.final/Master/texmf-dist/doc/lualatex/luamml/README.md
branches/branch2024.final/Master/texmf-dist/doc/lualatex/luamml/luamml.pdf
branches/branch2024.final/Master/texmf-dist/source/lualatex/luamml/luamml.dtx
branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-amsmath.lua
branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-demo.sty
branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-amsmath.sty
branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-amstext.sty
branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-kernel.sty
branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-lab-math.sty
branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-mathtools.sty
branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-pdf-demo.sty
branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-pdf.sty
branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml.sty
Modified: branches/branch2024.final/Master/texmf-dist/doc/lualatex/luamml/CHANGELOG.md
===================================================================
--- branches/branch2024.final/Master/texmf-dist/doc/lualatex/luamml/CHANGELOG.md 2025-03-07 22:39:16 UTC (rev 74502)
+++ branches/branch2024.final/Master/texmf-dist/doc/lualatex/luamml/CHANGELOG.md 2025-03-07 22:39:29 UTC (rev 74503)
@@ -7,6 +7,16 @@
## [Unreleased]
+ - Ulrike Fischer, 2025-03-06
+ * add class attribute to math environments
+ * correct columnalign (take label column into account)
+ * add intent :continued-row in split enviroment
+ * add intent :system-of-equations to environments
+ * temporary patch to \common at align@ending to store the environment name
+ * start some debugging functions (variable debugmtable)
+ * correct columnspacing
+ * add intent :pause-medium between columns
+
## 2025-02-21
- Ulrike Fischer, 2025-02-21
Modified: branches/branch2024.final/Master/texmf-dist/doc/lualatex/luamml/README.md
===================================================================
--- branches/branch2024.final/Master/texmf-dist/doc/lualatex/luamml/README.md 2025-03-07 22:39:16 UTC (rev 74502)
+++ branches/branch2024.final/Master/texmf-dist/doc/lualatex/luamml/README.md 2025-03-07 22:39:29 UTC (rev 74503)
@@ -9,6 +9,10 @@
Add `\usepackage[tracing]{luamml-demo}` to print MathML to the terminal or `\usepackage[files]{luamml-demo}` to generate separate files with MathML output.
Alternatively it can be used with latex-lab to automatically integrate with tagging infrastucture.
+## License
+LuaMML may be modified and distributed under the terms of the [LaTeX Project Public License](https://www.latex-project.org/lppl/), version 1.3c or greater.
+It is written by Marcel Krüger and the LaTeX Project Team.
+
<!-- Also see a [`tagpdf` experiment using this to tag PDF formulas](https://github.com/u-fischer/tagpdf/blob/develop/experiments/exp-mathml-lua.tex). -->
<!-- If you are very brave you can also try running `pdflatex test_pdf` and afterwards run `./pdfmml.lua test_pdf.lua` to get pdflatex formulas converted. -->
Modified: branches/branch2024.final/Master/texmf-dist/doc/lualatex/luamml/luamml.pdf
===================================================================
(Binary files differ)
Modified: branches/branch2024.final/Master/texmf-dist/source/lualatex/luamml/luamml.dtx
===================================================================
--- branches/branch2024.final/Master/texmf-dist/source/lualatex/luamml/luamml.dtx 2025-03-07 22:39:16 UTC (rev 74502)
+++ branches/branch2024.final/Master/texmf-dist/source/lualatex/luamml/luamml.dtx 2025-03-07 22:39:29 UTC (rev 74503)
@@ -133,11 +133,11 @@
% \begin{macrocode}
%<@@=luamml>
%<*luatex>
-\ProvidesExplPackage {luamml} {2025-02-21} {0.4.0}
+\ProvidesExplPackage {luamml} {2025-03-06} {0.5.0}
{Automatically generate presentational MathML from LuaTeX math expressions}
%</luatex>
%<*pdftex>
-\ProvidesExplPackage {luamml-pdf} {2025-02-21} {0.4.0}
+\ProvidesExplPackage {luamml-pdf} {2025-03-06} {0.5.0}
{MathML generation for L̶u̶a̶pdfLaTeX}
%</pdftex>
% \end{macrocode}
Modified: branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-amsmath.lua
===================================================================
--- branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-amsmath.lua 2025-03-07 22:39:16 UTC (rev 74502)
+++ branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-amsmath.lua 2025-03-07 22:39:29 UTC (rev 74503)
@@ -44,6 +44,48 @@
set_row_attribute('columnalign', token.scan_argument())
end
+-- This function is used to add a intent :continued-row to
+-- rows of a split environment.
+-- we assume that the table is a mtable with mrow with mtd.
+-- we check row 2..n. If the first cell has only one element and
+-- for this element 'tex:ignore' has been set, we assume a continued row and
+-- set the intent on the mrow.
+local function add_intent_continued_row (table)
+ for index,rowtable in ipairs(table) do
+ if table[index][1] and table[index][1][1] then -- just for safety ...
+ if index > 1 and #table[index][1]==1 and table[index][1][1]['tex:ignore'] then
+ table[index]['intent']=':continued-row'
+ end
+ end
+ end
+end
+
+-- This function add an intent =":pause-medium" on every second mtd in a table
+-- currently it is also on the first (after the label) but this could be changed
+-- used in __luamml_amsmath_finalize_table:n for
+-- 'align' or 'alignat' or 'flalign' or 'xalignat' or 'xxalignat'
+local function add_intent_pause (mmltable)
+ for mtrindex,mtrtable in ipairs(mmltable) do
+ for mtdindex,mtdtable in ipairs(mtrtable) do
+ if (mtdindex % 2 == 0) then
+ mtdtable['intent']=':pause-medium'
+ end
+ end
+ end
+end
+
+
+-- debug function for tables
+-- activate with \directlua{debugmtable=2} or \directlua{debugmtable='split'}
+local function debug_mtable (mtable,kind)
+ if debugmtable and (debugmtable==2) or (debugmtable==kind) then
+ texio.write_nl('==============')
+ texio.write_nl(kind)
+ texio.write_nl(table.serialize(mtable))
+ texio.write_nl('==============')
+ end
+end
+
do
local saved
funcid = luatexbase.new_luafunction'__luamml_amsmath_save_inner_table:n'
@@ -51,9 +93,14 @@
lua.get_functions_table()[funcid] = function()
-- TODO: Error handling etc
local kind = token.scan_argument()
+ kind = kind:gsub("*","")
local mml_table = get_table()
if not mml_table then return end
mml_table.displaystyle = true
+ mml_table.class=kind
+ if kind=="split" then
+ add_intent_continued_row (mml_table)
+ end
local columns = node.count(node.id'align_record', tex.lists.align_head)//2
mml_table.columnalign = kind == 'gathered' and 'center' or string.rep('right left', columns, ' ')
local spacing = {}
@@ -61,6 +108,7 @@
spacing[#spacing+1] = n.width == 0 and '0' or string.format('%.3fpt', n.width/65781.76)
end
mml_table.columnspacing = #spacing > 3 and table.concat(spacing, ' ', 2, #spacing-2) or nil
+ debug_mtable(mml_table,kind)
saved = mml_table
end
@@ -70,10 +118,12 @@
-- TODO: Error handling etc
local mml_table = get_table()
mml_table.align = 'axis'
+ mml_table.class='smallmatrix'
mml_table.columnalign = 'center'
mml_table.columnspacing = '0.278em'
mml_table.rowspacing = string.format('%.3fpt', tex.lineskip.width/65781.76)
saved = {[0] = 'mpadded', width = '+0.333em', lspace = '0.167em', mml_table}
+ debug_mtable(mml_table,kind)
saved = mml_table
end
@@ -97,11 +147,18 @@
lua.get_functions_table()[funcid] = function()
-- TODO: Error handling etc
local kind = token.scan_argument()
+ kind = kind:gsub("*","")
local mml_table = get_table()
if not mml_table then return end
mml_table.displaystyle = true
+ mml_table.class=kind
+ -- this should perhaps be configurable and extendable
+ if kind == 'align' or 'alignat' or 'flalign' or 'xalignat' or 'xxalignat' then
+ mml_table.intent=":system-of-equations"
+ add_intent_pause (mml_table)
+ end
local columns = node.count(node.id'align_record', tex.lists.align_head)//2
- mml_table.columnalign = kind == 'align' and string.rep('right left', columns, ' ') or nil
+ mml_table.columnalign = kind == 'align' and 'left '..string.rep('right left', columns, ' ') or nil
mml_table.width = kind == 'multline' and '100%' or nil
-- mml_table.side = kind == 'multline' and 'rightoverlap' or nil
local spacing = {}
@@ -108,7 +165,8 @@
for n in node.traverse_id(node.id'glue', tex.lists.align_head) do
spacing[#spacing+1] = n.width == 0 and '0' or '.8em'
end
- mml_table.columnspacing = #spacing > 3 and table.concat(spacing, ' ', 2, #spacing-2) or nil
+ mml_table.columnspacing = #spacing > 3 and "0 "..table.concat(spacing, ' ', 2, #spacing-2) or nil
+ debug_mtable(mml_table,kind)
save_result(mml_table, true)
end
Modified: branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-demo.sty
===================================================================
--- branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-demo.sty 2025-03-07 22:39:16 UTC (rev 74502)
+++ branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-demo.sty 2025-03-07 22:39:29 UTC (rev 74503)
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesExplPackage{luamml-demo}{2025-02-21}{0.4.0}{Reasonable default definitions for luamml}
+\ProvidesExplPackage{luamml-demo}{2025-03-06}{0.5.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.}
Modified: branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-amsmath.sty
===================================================================
--- branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-amsmath.sty 2025-03-07 22:39:16 UTC (rev 74502)
+++ branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-amsmath.sty 2025-03-07 22:39:29 UTC (rev 74503)
@@ -1,4 +1,4 @@
-\ProvidesExplPackage {luamml-patches-amsmath} {2025-02-21} {0.4.0}
+\ProvidesExplPackage {luamml-patches-amsmath} {2025-03-06} {0.5.0}
{Feel free to add a description here}
\lua_now:n { require'luamml-amsmath' }
@@ -7,6 +7,25 @@
% But they are almost identical to the original and only
% add luamml commands in appropriate places, so they would
% mostly disappear if there were enough hooks in amsmath.
+\IfPackageAtLeastTF{latex-lab-testphase-math}{2025-02-24}
+ {}
+ {
+ \def\common at align@ending {
+ \math at cr \black@\totwidth@
+ \UseExpandableTaggingSocket {math/luamml/mtable/finalize} {\@currenvir}
+ \egroup
+ \ifingather@
+ \restorealignstate@
+ \egroup
+ \nonumber
+ \ifnum0=`{\fi\iffalse}\fi
+ \else
+ $$%
+ \fi
+ \ignorespacesafterend
+ }
+ }
+
\IfPackageAtLeastTF{latex-lab-testphase-math}{2025-01-24}
{}
{
Modified: branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-amstext.sty
===================================================================
--- branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-amstext.sty 2025-03-07 22:39:16 UTC (rev 74502)
+++ branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-amstext.sty 2025-03-07 22:39:29 UTC (rev 74503)
@@ -1,4 +1,4 @@
-\ProvidesExplPackage {luamml-patches-amstext} {2025-02-21} {0.4.0}
+\ProvidesExplPackage {luamml-patches-amstext} {2025-03-06} {0.5.0}
{patches of amstext commands}
% This is the same definition as in latex-lab-amsmath. It can go with the
Modified: branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-kernel.sty
===================================================================
--- branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-kernel.sty 2025-03-07 22:39:16 UTC (rev 74502)
+++ branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-kernel.sty 2025-03-07 22:39:29 UTC (rev 74503)
@@ -1,4 +1,4 @@
-\ProvidesExplPackage {luamml-patches-kernel} {2025-02-21} {0.4.0}
+\ProvidesExplPackage {luamml-patches-kernel} {2025-03-06} {0.5.0}
{Feel free to add a description here}
Modified: branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-lab-math.sty
===================================================================
--- branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-lab-math.sty 2025-03-07 22:39:16 UTC (rev 74502)
+++ branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-lab-math.sty 2025-03-07 22:39:29 UTC (rev 74503)
@@ -1,4 +1,4 @@
-\ProvidesExplPackage {luamml-patches-lab-math} {2025-02-21} {0.4.0}
+\ProvidesExplPackage {luamml-patches-lab-math} {2025-03-06} {0.5.0}
{Feel free to add a description here}
% This definition is identical to the one in latex-lab-math.
Modified: branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-mathtools.sty
===================================================================
--- branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-mathtools.sty 2025-03-07 22:39:16 UTC (rev 74502)
+++ branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-patches-mathtools.sty 2025-03-07 22:39:29 UTC (rev 74503)
@@ -1,4 +1,4 @@
-\ProvidesExplPackage {luamml-patches-mathtools} {2025-02-21} {0.4.0}
+\ProvidesExplPackage {luamml-patches-mathtools} {2025-03-06} {0.5.0}
{Feel free to add a description here}
\IfPackageAtLeastTF{latex-lab-testphase-math}{2025-01-24}
{}
Modified: branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-pdf-demo.sty
===================================================================
--- branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-pdf-demo.sty 2025-03-07 22:39:16 UTC (rev 74502)
+++ branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-pdf-demo.sty 2025-03-07 22:39:29 UTC (rev 74503)
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesExplPackage{luamml-pdf-demo}{2025-02-21}{0.4.0}{Reasonable default definitions for luamml-pdf}
+\ProvidesExplPackage{luamml-pdf-demo}{2025-03-06}{0.5.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: branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-pdf.sty
===================================================================
--- branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-pdf.sty 2025-03-07 22:39:16 UTC (rev 74502)
+++ branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml-pdf.sty 2025-03-07 22:39:29 UTC (rev 74503)
@@ -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} {2025-02-21} {0.4.0}
+\ProvidesExplPackage {luamml-pdf} {2025-03-06} {0.5.0}
{MathML generation for L̶u̶a̶pdfLaTeX}
\int_new:N \l__luamml_flag_int
\int_new:N \l__luamml_pretty_int
Modified: branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml.sty
===================================================================
--- branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml.sty 2025-03-07 22:39:16 UTC (rev 74502)
+++ branches/branch2024.final/Master/texmf-dist/tex/lualatex/luamml/luamml.sty 2025-03-07 22:39:29 UTC (rev 74503)
@@ -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} {2025-02-21} {0.4.0}
+\ProvidesExplPackage {luamml} {2025-03-06} {0.5.0}
{Automatically generate presentational MathML from LuaTeX math expressions}
\int_new:N \l__luamml_flag_int
\int_new:N \l__luamml_pretty_int
More information about the tex-live-commits
mailing list.