Skip to content

Commit

Permalink
Extended math options for luamml (#1511)
Browse files Browse the repository at this point in the history
* start documentation for math options

* review math option, WIP

* move luamml loading, trim spacing

* start with examples

* add option for structelem

* correct test

* correct alt attribute if luamml is not used

* more docu

* rename plug

* adapt key for luamml writing

* more examples

* enable alt for ua-1, docu, typo

* update test

* update test (alt + attribute change)

* more doku and a bit support for ignore flag

* clean up examples

* add jobname to title, tlg

* note about tests

* change version, add changes.txt

* test with newest luamml

* add version test

* add test files

* comments from review
  • Loading branch information
u-fischer authored Oct 29, 2024
1 parent b1e172c commit c10a4a3
Show file tree
Hide file tree
Showing 55 changed files with 3,710 additions and 712 deletions.
5 changes: 5 additions & 0 deletions required/latex-lab/changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2024-10-25 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-math.dtx: reorganized luamml and mathml options
to support also structure elements and extended the documentation. Corrected
handling of alt-texts. Added examples for the various options.

2024-10-16 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-firstaid.dtx: correct amsthm firstaid (tagging/733),
remove now unneeded code for cleveref.
Expand Down
10 changes: 10 additions & 0 deletions required/latex-lab/config-math-tagging-examples.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- Tests for math tagging examples

stdengine = "luatex"
checkengines = {"luatex"}
checksearch = true
testfiledir = "math-tagging-examples"

checkruns = 2

recordstatus=true
1,209 changes: 740 additions & 469 deletions required/latex-lab/latex-lab-math.dtx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
% template for math reading.
\DocumentMetadata
{
uncompress,testphase={phase-III,title,math},
pdfversion=1.7,
pdfstandard=ua-1
%pdfversion=2.0,
%pdfstandard=ua-2
}


\documentclass{article}
\makeatletter
\ExplSyntaxOn
\tl_put_right:Nn\cdp@list{\cdp@elt {TU}{lmr}{m}{n}}
\ExplSyntaxOff
\makeatother

\usepackage{unicode-math}

\title{Test math tagging \jobname}

% global setups
% rolemap mathml to Span default false (probably senseless)
%\tagpdfsetup{role/mathml-tags}

% suppress loading of luamml
%\tagpdfsetup{math/mathml/luamml/load=false} %

% suppress writing of luamml-mathml
%\tagpdfsetup{math/mathml/luamml/write=false} %

% suppress mathml-AF reading
%\tagpdfsetup{math/mathml/sources=} %

% enable structure elements
%\tagpdfsetup{math/mathml/structelem} %

\begin{document}
% local settings. Can also be in the preamble but used here for clarity

% alt text, default currently false if not ua-1
%\tagpdfsetup{math/alt/use = true}

% suppress tex source AF
% \tagpdfsetup{math/tex/AF=false}

% suppress attaching of mathml-AF (local setting)
% \tagpdfsetup{math/mathml/AF=false}

inline $E=mc^2$

display
\[a^2+b^2=c^2\]

\end{document}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
***************
Compilation 1 of test file completed with exit status 0
Compilation 2 of test file completed with exit status 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
% template for math reading.

\DocumentMetadata
{
uncompress,testphase={phase-III,title,math},
pdfversion=1.7,
pdfstandard=ua-1
%pdfversion=2.0,
%pdfstandard=ua-2
}

\documentclass{article}
\makeatletter
\ExplSyntaxOn
\tl_put_right:Nn\cdp@list{\cdp@elt {TU}{lmr}{m}{n}}
\ExplSyntaxOff
\makeatother

\usepackage{unicode-math}

\title{Test math tagging \jobname}

% global setups
% rolemap mathml to Span default false (probably senseless)
\tagpdfsetup{role/mathml-tags}

% suppress loading of luamml
%\tagpdfsetup{math/mathml/luamml/load=false} %

% suppress writing of luamml-mathml
%\tagpdfsetup{math/mathml/luamml/write=false} %

% suppress mathml-AF inclusion
%\tagpdfsetup{math/mathml/sources=} %

% enable structure elements
\tagpdfsetup{math/mathml/structelem} %

\begin{document}

% local settings. Can also be in the preamble but used here for clarity

% alt text, default currently false if not ua-1
% \tagpdfsetup{math/alt/use = true}

% suppress tex source AF
% \tagpdfsetup{math/tex/AF=false}

% suppress attaching of mathml-AF (local setting)
% \tagpdfsetup{math/mathml/AF=false}

inline $E=mc^2$

display
\[a^2+b^2=c^2\]

\end{document}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
***************
Compilation 1 of test file completed with exit status 0
Compilation 2 of test file completed with exit status 0
56 changes: 56 additions & 0 deletions required/latex-lab/math-tagging-examples/math-17-alt-noluamml.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
% template for math reading.
\DocumentMetadata
{
uncompress,testphase={phase-III,title,math},
pdfversion=1.7,
pdfstandard=ua-1
%pdfversion=2.0,
%pdfstandard=ua-2
}


\documentclass{article}
\makeatletter
\ExplSyntaxOn
\tl_put_right:Nn\cdp@list{\cdp@elt {TU}{lmr}{m}{n}}
\ExplSyntaxOff
\makeatother

\usepackage{unicode-math}

\title{Test math tagging \jobname}

% global setups
% rolemap mathml to Span default false (probably senseless)
\tagpdfsetup{role/mathml-tags}

% suppress loading of luamml
\tagpdfsetup{math/mathml/luamml/load=false} %

% suppress writing of luamml-mathml
%\tagpdfsetup{math/mathml/luamml/write=false} %

% suppress mathml-AF reading
\tagpdfsetup{math/mathml/sources=} %

% enable structure elements
%\tagpdfsetup{math/mathml/structelem} %

\begin{document}
% local settings. Can also be in the preamble but used here for clarity

% alt text, default currently false if not ua-1
%\tagpdfsetup{math/alt/use = true}

% suppress tex source AF
\tagpdfsetup{math/tex/AF=false}

% suppress attaching of mathml-AF (local setting)
% \tagpdfsetup{math/mathml/AF=false}

inline $E=mc^2$

display
\[a^2+b^2=c^2\]

\end{document}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
***************
Compilation 1 of test file completed with exit status 0
Compilation 2 of test file completed with exit status 0
56 changes: 56 additions & 0 deletions required/latex-lab/math-tagging-examples/math-17-default.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
% template for math reading.

\DocumentMetadata
{
uncompress,testphase={phase-III,title,math},
pdfversion=1.7,
pdfstandard=ua-1
%pdfversion=2.0,
%pdfstandard=ua-2
}

\documentclass{article}
\makeatletter
\ExplSyntaxOn
\tl_put_right:Nn\cdp@list{\cdp@elt {TU}{lmr}{m}{n}}
\ExplSyntaxOff
\makeatother

\usepackage{unicode-math}

\title{Test math tagging \jobname}

% global setups
% rolemap mathml to Span default false (probably senseless)
%\tagpdfsetup{role/mathml-tags}

% suppress loading of luamml
%\tagpdfsetup{math/mathml/luamml/load=false} %

% suppress writing of luamml-mathml
%\tagpdfsetup{math/mathml/luamml/write=false} %

% suppress mathml-AF reading
%\tagpdfsetup{math/mathml/sources=} %

% enable structure elements
%\tagpdfsetup{math/mathml/structelem} %

\begin{document}
% local settings. Can also be in the preamble but used here for clarity

% alt text, default currently false if not ua-1
% \tagpdfsetup{math/alt/use = true}

% suppress tex source AF
% \tagpdfsetup{math/tex/AF=false}

% suppress attaching of mathml-AF (local setting)
% \tagpdfsetup{math/mathml/AF=false}

inline $E=mc^2$

display
\[a^2+b^2=c^2\]

\end{document}
3 changes: 3 additions & 0 deletions required/latex-lab/math-tagging-examples/math-17-default.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
***************
Compilation 1 of test file completed with exit status 0
Compilation 2 of test file completed with exit status 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
% template for math reading.

\DocumentMetadata
{
uncompress,testphase={phase-III,title,math},
%pdfversion=1.7,
%pdfstandard=ua-1
pdfversion=2.0,
pdfstandard=ua-2
}

\documentclass{article}
\makeatletter
\ExplSyntaxOn
\tl_put_right:Nn\cdp@list{\cdp@elt {TU}{lmr}{m}{n}}
\ExplSyntaxOff
\makeatother

\usepackage{unicode-math}

\title{Test math tagging \jobname}

% global setups
% rolemap mathml to Span default false (probably senseless)
%\tagpdfsetup{role/mathml-tags}

% suppress loading of luamml
%\tagpdfsetup{math/mathml/luamml/load=false} %

% suppress writing of luamml-mathml
%\tagpdfsetup{math/mathml/luamml/write=false} %

% suppress mathml-AF inclusion
%\tagpdfsetup{math/mathml/sources=} %

% enable structure elements
\tagpdfsetup{math/mathml/structelem} %

\begin{document}

% local settings. Can also be in the preamble but used here for clarity

% alt text, default currently false if not ua-1
\tagpdfsetup{math/alt/use = true}

% suppress tex source AF
% \tagpdfsetup{math/tex/AF=false}

% suppress attaching of mathml-AF (local setting)
% \tagpdfsetup{math/mathml/AF=false}

inline $E=mc^2$

display
\[a^2+b^2=c^2\]

\end{document}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
***************
Compilation 1 of test file completed with exit status 0
Compilation 2 of test file completed with exit status 0
57 changes: 57 additions & 0 deletions required/latex-lab/math-tagging-examples/math-20-alt-noluamml.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
% template for math reading.

\DocumentMetadata
{
uncompress,testphase={phase-III,title,math},
%pdfversion=1.7,
%pdfstandard=ua-1
pdfversion=2.0,
pdfstandard=ua-2
}


\documentclass{article}
\makeatletter
\ExplSyntaxOn
\tl_put_right:Nn\cdp@list{\cdp@elt {TU}{lmr}{m}{n}}
\ExplSyntaxOff
\makeatother

\usepackage{unicode-math}

\title{Test math tagging \jobname}

% global setups
% rolemap mathml to Span default false (probably senseless)
%\tagpdfsetup{role/mathml-tags}

% suppress loading of luamml
\tagpdfsetup{math/mathml/luamml/load=false} %

% suppress writing of luamml-mathml
%\tagpdfsetup{math/mathml/luamml/write=false} %

% suppress mathml-AF reading
\tagpdfsetup{math/mathml/sources=} %

% enable structure elements
%\tagpdfsetup{math/mathml/structelem} %

\begin{document}
% local settings. Can also be in the preamble but used here for clarity

% alt text, default currently false if not ua-1
\tagpdfsetup{math/alt/use = true}

% suppress tex source AF
\tagpdfsetup{math/tex/AF=false}

% suppress attaching of mathml-AF (local setting)
% \tagpdfsetup{math/mathml/AF=false}

inline $E=mc^2$

display
\[a^2+b^2=c^2\]

\end{document}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
***************
Compilation 1 of test file completed with exit status 0
Compilation 2 of test file completed with exit status 0
Loading

0 comments on commit c10a4a3

Please sign in to comment.