diff options
author | Karl Berry <karl@freefriends.org> | 2024-08-23 20:59:29 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-08-23 20:59:29 +0000 |
commit | 7857e582ee9efad13031f083a1ba56805a60e9fb (patch) | |
tree | 458c1075c68e30d9ad3af1ccd79e4edee8994f26 /Master/texmf-dist | |
parent | 6115b28865b876cca60c04dc28281922ef5ca52f (diff) |
latex-lab-dev (23aug24)
git-svn-id: svn://tug.org/texlive/trunk@72093 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
31 files changed, 304 insertions, 51 deletions
diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/README.md b/Master/texmf-dist/doc/latex-dev/latex-lab/README.md index 656f38c83cd..116223aecbe 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/README.md +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/README.md @@ -1,6 +1,6 @@ # LaTeX laboratory -Release 2024-11-01 pre-release 2 +Release 2024-11-01 pre-release 3 ## Overview diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-code.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-code.pdf Binary files differindex bf70e0ab484..38ff9f597ef 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-code.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-code.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-doc.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-doc.pdf Binary files differindex 3c332f8d082..e27577d88b4 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-doc.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-doc.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/changes.txt b/Master/texmf-dist/doc/latex-dev/latex-lab/changes.txt index 4d81eb6373e..9b016419abb 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/changes.txt +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/changes.txt @@ -1,3 +1,10 @@ +2024-08-22 Joseph Wright <Joseph.Wright@latex-project.org> + * latex-lab-math.dtx: correct handling of empty math processing + +2024-08-21 Ulrike Fischer <Ulrike.Fischer@latex-project.org> + * latex-lab-math.dtx: correct luamml patches for array, + allow to use luamml without unicode-math + 2024-08-14 Ulrike Fischer <Ulrike.Fischer@latex-project.org> * latex-lab-math.dtx: add luamml support for automatic mathml generation diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-code.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-code.pdf Binary files differindex f1f110cd0ba..b2d74f849f3 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-code.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-code.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-doc.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-doc.pdf Binary files differindex 38fa0a46330..362954edba7 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-doc.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-doc.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-amsmath.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-amsmath.pdf Binary files differindex 96e0c83add3..6bb389ef9e4 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-amsmath.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-amsmath.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-bib.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-bib.pdf Binary files differindex e0c48c784ec..2643725efa7 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-bib.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-bib.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-block.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-block.pdf Binary files differindex 8c2d75c6046..3b31116fd82 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-block.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-block.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-firstaid.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-firstaid.pdf Binary files differindex b39537dc95f..ce2e69882a7 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-firstaid.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-firstaid.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-float.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-float.pdf Binary files differindex e391effd751..1ac490c00a0 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-float.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-float.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-footnotes.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-footnotes.pdf Binary files differindex ffe5d3bdb94..58309a62f56 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-footnotes.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-footnotes.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-graphic.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-graphic.pdf Binary files differindex 76b9bc48f80..359856eb77b 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-graphic.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-graphic.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-marginpar.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-marginpar.pdf Binary files differindex 45952781be0..ad936afd315 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-marginpar.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-marginpar.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-math.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-math.pdf Binary files differindex 73c5113c4be..63bbe46ed73 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-math.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-math.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathpkg.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathpkg.pdf Binary files differindex c5879e39fec..9b4e0ef1b9e 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathpkg.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathpkg.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathtools.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathtools.pdf Binary files differindex b9845cbbaee..7678082ac22 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathtools.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathtools.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-minipage.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-minipage.pdf Binary files differindex 28df1649041..6d68904c298 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-minipage.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-minipage.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-namespace.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-namespace.pdf Binary files differindex c8e088d8de3..3363ce19182 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-namespace.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-namespace.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-1.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-1.pdf Binary files differindex ac59f8cbb39..4a808d7f1b0 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-1.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-1.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-2.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-2.pdf Binary files differindex 656aa19673e..8618ee7debf 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-2.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-2.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-sec.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-sec.pdf Binary files differindex 6321129dcfc..c62c8dbeb16 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-sec.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-sec.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-table.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-table.pdf Binary files differindex ee36e14af79..c2bb7e7c2fa 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-table.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-table.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-testphase.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-testphase.pdf Binary files differindex 235a6f6f590..c9988c89afe 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-testphase.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-testphase.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-text.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-text.pdf Binary files differindex 97d9d05a6bb..8c4fc7780da 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-text.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-text.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-title.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-title.pdf Binary files differindex 58a5bfc3712..64dfa09d2c2 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-title.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-title.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-hyperref-changes.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-hyperref-changes.pdf Binary files differindex 9b02b16a376..caf6bd4b7b9 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-hyperref-changes.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-hyperref-changes.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-kernel-changes.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-kernel-changes.pdf Binary files differindex 99b15f9004a..7e19e8a9ebd 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-kernel-changes.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-kernel-changes.pdf diff --git a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc.pdf b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc.pdf Binary files differindex 8d4594d2d84..5f6e705a906 100644 --- a/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc.pdf +++ b/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc.pdf diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-math.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-math.dtx index 69fb600385e..c6e07d4832a 100644 --- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-math.dtx +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-math.dtx @@ -19,8 +19,8 @@ % for those people who are interested or want to report an issue. % % -\def\ltlabmathdate{2024-08-14} -\def\ltlabmathversion{0.6b} +\def\ltlabmathdate{2024-08-22} +\def\ltlabmathversion{0.6c} % %<*driver> \documentclass{l3doc} @@ -327,11 +327,15 @@ % \subsection{Automatic mathml creation with luamml}\label{sec:luamml} % % If lualatex is used, if the package \texttt{unicode-math} is used -% and if the package \texttt{luamml} is found\footnote{Until it is -% on CTAN and it must be installed from \url{https://github.com/zauguin/luamml}.} -% then it will automatically generate the file |\jobname-luamml-mathml.html| with mathml representations -% of all math formulas. +% and if the package \texttt{luamml} is found +% then it will automatically generate the file |\jobname-luamml-mathml.html| +% with mathml representations of all math formulas. % The generation of the file can be suppressed with |math/mathml/luamml=false|. +% If \texttt{unicode-math} is not used, +% the generation of the file can be forced +% with |math/mathml/luamml=true| or |math/mathml/luamml| but be aware that +% it is then probable that various symbols are mapped to the wrong unicode code +% points. % The package is still quite experimental and the output should be checked. % The |\jobname-luamml-mathml.html| file may be previewed in a browser although % you may need to add additional css or javascript declarations @@ -618,8 +622,11 @@ % \g__tag_math_mathml_AF_bool, % \l__tag_math_mathml_pane_bool, % \l__tag_math_alt_bool, -% \g__tag_math_luamml_bool, +% \g__tag_math_luamml_tl, % } +% The variable \cs{g__tag_math_luamml_tl} is initially 0 and +% the user key can set it to -1 or 1. This allows to distinguish +% the unset case from a value set by the user. % \begin{macrocode} \bool_new:N\l__tag_math_texsource_AF_bool \bool_new:N\l__tag_math_texsource_pane_bool @@ -627,8 +634,8 @@ \bool_new:N\g__tag_math_mathml_AF_bool \bool_new:N\l__tag_math_mathml_pane_bool \bool_new:N\l__tag_math_alt_bool -\bool_new:N\g__tag_math_luamml_bool -\bool_gset_true:N \g__tag_math_luamml_bool +\tl_new:N\g__tag_math_luamml_tl +\tl_gset:Nn\g__tag_math_luamml_tl {0} % \end{macrocode} % \end{variable} % @@ -784,23 +791,140 @@ \file_if_exist:nT { luamml.sty } { \RequirePackage { luamml } +% \end{macrocode} +% Temporary (!) fixes for endarray +% \begin{macrocode} + \AddToHook{package/array/after} + { + \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_set:Npn \@classz + { + \@classx + \@tempcnta \count@ + \prepnext@tok + \@addtopreamble { + \ifcase \@chnum + \hfil + \hskip 1sp + \d@llarbegin + \cs_if_eq:NNTF \d@llarbegin \begingroup { + \insert@column + \d@llarend + } { + \__luamml_array_init_col: + \insert@column + \luamml_flag_save:nn {} {mtd} + \d@llarend + \__luamml_array_finalize_col:w 0~ + } + \do@row@strut + \hfil + \or + \hskip 1sp + \d@llarbegin + \cs_if_eq:NNTF \d@llarbegin \begingroup { + \insert@column + \d@llarend + } { + \__luamml_array_init_col: + \insert@column + \luamml_flag_save:nn {} {mtd} + \d@llarend + \__luamml_array_finalize_col:w 1~ + } + \do@row@strut + \hfil + \or + \hfil + \hskip 1sp + \d@llarbegin + \cs_if_eq:NNTF \d@llarbegin \begingroup { + \insert@column + \d@llarend + } { + \__luamml_array_init_col: + \insert@column + \luamml_flag_save:nn {} {mtd} + \d@llarend + \__luamml_array_finalize_col:w 2~ + } + \do@row@strut + \or + \setbox \ar@mcellbox \vbox \@startpbox { \@nextchar } + \insert@pcolumn + \@endpbox + \ar@align@mcell + \do@row@strut + \or + \vtop \@startpbox { \@nextchar } + \insert@pcolumn + \@endpbox + \do@row@strut + \or + \vbox \@startpbox { \@nextchar } + \insert@pcolumn + \@endpbox + \do@row@strut + \fi + } + \prepnext@tok + } + } +% \end{macrocode} +% +% \begin{macrocode} \AddToHook{begindocument/end} { - \bool_if:NT \g__tag_math_luamml_bool + \str_case:on \g__tag_math_luamml_tl { - \@ifpackageloaded { unicode-math } - { \@@_luamml_activate_write: } - { \msg_warning:nn { tag }{ unicode-math-missing } } + { 1 } { + \@@_luamml_activate_write: + \msg_note:nnnn { tag } + { luamml-status }{ enabled }{ create } + } + {-1 } { + \msg_note:nnnn { tag } + { luamml-status }{ disabled }{ not~create } + } + { 0 } + { + \@ifpackageloaded { unicode-math } + { + \@@_luamml_activate_write: + \msg_note:nnnn { tag } + { luamml-status }{ enabled }{ create } + } + { \msg_warning:nn { tag }{ unicode-math-missing } } + } } } } } +\msg_new:nnn { tag }{ luamml-status } + { + luamml~has~been~#1~and~will~#2~an~MathML~file. + } + \msg_new:nnn { tag }{ unicode-math-missing } { The~package~unicode-math~is~missing\\ luamml~will~not~create~an~MathML~file.\\ - To~avoid~this~warning~load~unicode-math~or~disable~luamml\\ - with~\tl_to_str:n{\tagpdfsetup{math/mathml/luamml=false}} + To~avoid~this~warning~load~unicode-math~\\ + or~disable~luamml~with~\\ + \tl_to_str:n{\tagpdfsetup{math/mathml/luamml=false}}\\ + or~force~luamml~with~\\ + \tl_to_str:n{\tagpdfsetup{math/mathml/luamml=true}} } \cs_new_protected:Npn \@@_luamml_activate_write: { @@ -853,7 +977,10 @@ \keys_define:nn { __tag / setup } { - math/mathml/luamml .bool_gset:N = \g__tag_math_luamml_bool, + math/mathml/luamml .choice: , + math/mathml/luamml/true .code:n = {\tl_gset:Nn \g__tag_math_luamml_tl{1}}, + math/mathml/luamml/false .code:n = {\tl_gset:Nn \g__tag_math_luamml_tl{-1}}, + math/mathml/luamml .default:n = true, math/mathml/luamml .usage:n=preamble } % \end{macrocode} @@ -1508,6 +1635,7 @@ % % \begin{macro}{\@@_grab_dollar:w} % \begin{macro}{\@@_grab_dollar:n} +% \changes{v0.6c}{2024-08-22}{Correct handling of empty math segments} % Top-level function to handle grabbing of inline math mode delimited by % |$| tokens. We provide two different ways to do that: a token-by-token % one that can be used everywhere, and a fast delimited one that does not @@ -1523,28 +1651,30 @@ \cs_new_protected:Npn \@@_grab_dollar:n #1 { % \end{macrocode} -% To avoid further work with entirely empty math segments, we test before -% doing anything more. +% We need to do processing first as this picks up \enquote{fake} math mode: +% that information is needed below. % \begin{macrocode} - \tl_if_blank:nF {#1} - { - \@@_process:nn { math } {#1} % $ + \@@_process:nn { math } {#1} % \end{macrocode} % We do not want math tagging in fakemath or when measuring, % We also do not want math tagging if tagging has been suspended. % \begin{macrocode} - \bool_lazy_or:nnTF - {\legacy_if_p:n { measuring@ }} - { \l_@@_fakemath_bool } - { #1 $ } + \bool_lazy_any:nTF + { + {\legacy_if_p:n { measuring@ }} + { \l_@@_fakemath_bool } + { \tl_if_blank_p:n {#1} } + } + { + #1 $ % $ + } { \tag_socket_use:n {math/inline/begin} %end P-MC \tag_socket_use:nn {math/inline/formula/begin}{#1} - $ + $ % $ \tag_socket_use:n {math/inline/formula/end} \tag_socket_use:n {math/inline/end} % restart P-MC - } - } + } } % \end{macrocode} % \end{macro} @@ -1570,8 +1700,8 @@ \@@_process:nn { equation* } {#1} \socket_use:n {tagsupport/math/display/begin} \socket_use:nn{tagsupport/math/display/formula/begin}{#1} - $$ } + $$ } % \end{macrocode} % diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-math.ltx b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-math.ltx index 754b5e0898d..34ac71389da 100644 --- a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-math.ltx +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-math.ltx @@ -33,8 +33,8 @@ %% %% %% File: latex-lab-math.dtx -\def\ltlabmathdate{2024-08-14} -\def\ltlabmathversion{0.6b} +\def\ltlabmathdate{2024-08-22} +\def\ltlabmathversion{0.6c} \ProvidesFile{latex-lab-math.ltx} [\ltlabmathdate\space v\ltlabmathversion\space @@ -75,8 +75,8 @@ \bool_new:N\g__tag_math_mathml_AF_bool \bool_new:N\l__tag_math_mathml_pane_bool \bool_new:N\l__tag_math_alt_bool -\bool_new:N\g__tag_math_luamml_bool -\bool_gset_true:N \g__tag_math_luamml_bool +\tl_new:N\g__tag_math_luamml_tl +\tl_gset:Nn\g__tag_math_luamml_tl {0} \int_new:N\g__math_mathml_total_int \int_new:N\g__math_mathml_int \int_new:N\g__math_math_total_int @@ -154,23 +154,134 @@ \file_if_exist:nT { luamml.sty } { \RequirePackage { luamml } + \AddToHook{package/array/after} + { + \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_set:Npn \@classz + { + \@classx + \@tempcnta \count@ + \prepnext@tok + \@addtopreamble { + \ifcase \@chnum + \hfil + \hskip 1sp + \d@llarbegin + \cs_if_eq:NNTF \d@llarbegin \begingroup { + \insert@column + \d@llarend + } { + \__luamml_array_init_col: + \insert@column + \luamml_flag_save:nn {} {mtd} + \d@llarend + \__luamml_array_finalize_col:w 0~ + } + \do@row@strut + \hfil + \or + \hskip 1sp + \d@llarbegin + \cs_if_eq:NNTF \d@llarbegin \begingroup { + \insert@column + \d@llarend + } { + \__luamml_array_init_col: + \insert@column + \luamml_flag_save:nn {} {mtd} + \d@llarend + \__luamml_array_finalize_col:w 1~ + } + \do@row@strut + \hfil + \or + \hfil + \hskip 1sp + \d@llarbegin + \cs_if_eq:NNTF \d@llarbegin \begingroup { + \insert@column + \d@llarend + } { + \__luamml_array_init_col: + \insert@column + \luamml_flag_save:nn {} {mtd} + \d@llarend + \__luamml_array_finalize_col:w 2~ + } + \do@row@strut + \or + \setbox \ar@mcellbox \vbox \@startpbox { \@nextchar } + \insert@pcolumn + \@endpbox + \ar@align@mcell + \do@row@strut + \or + \vtop \@startpbox { \@nextchar } + \insert@pcolumn + \@endpbox + \do@row@strut + \or + \vbox \@startpbox { \@nextchar } + \insert@pcolumn + \@endpbox + \do@row@strut + \fi + } + \prepnext@tok + } + } \AddToHook{begindocument/end} { - \bool_if:NT \g__tag_math_luamml_bool + \str_case:on \g__tag_math_luamml_tl { - \@ifpackageloaded { unicode-math } - { \__math_luamml_activate_write: } - { \msg_warning:nn { tag }{ unicode-math-missing } } + { 1 } { + \__math_luamml_activate_write: + \msg_note:nnnn { tag } + { luamml-status }{ enabled }{ create } + } + {-1 } { + \msg_note:nnnn { tag } + { luamml-status }{ disabled }{ not~create } + } + { 0 } + { + \@ifpackageloaded { unicode-math } + { + \__math_luamml_activate_write: + \msg_note:nnnn { tag } + { luamml-status }{ enabled }{ create } + } + { \msg_warning:nn { tag }{ unicode-math-missing } } + } } } } } +\msg_new:nnn { tag }{ luamml-status } + { + luamml~has~been~#1~and~will~#2~an~MathML~file. + } + \msg_new:nnn { tag }{ unicode-math-missing } { The~package~unicode-math~is~missing\\ luamml~will~not~create~an~MathML~file.\\ - To~avoid~this~warning~load~unicode-math~or~disable~luamml\\ - with~\tl_to_str:n{\tagpdfsetup{math/mathml/luamml=false}} + To~avoid~this~warning~load~unicode-math~\\ + or~disable~luamml~with~\\ + \tl_to_str:n{\tagpdfsetup{math/mathml/luamml=false}}\\ + or~force~luamml~with~\\ + \tl_to_str:n{\tagpdfsetup{math/mathml/luamml=true}} } \cs_new_protected:Npn \__math_luamml_activate_write: { @@ -210,7 +321,10 @@ \keys_define:nn { __tag / setup } { - math/mathml/luamml .bool_gset:N = \g__tag_math_luamml_bool, + math/mathml/luamml .choice: , + math/mathml/luamml/true .code:n = {\tl_gset:Nn \g__tag_math_luamml_tl{1}}, + math/mathml/luamml/false .code:n = {\tl_gset:Nn \g__tag_math_luamml_tl{-1}}, + math/mathml/luamml .default:n = true, math/mathml/luamml .usage:n=preamble } \socket_new:nn {tagsupport/math/mathml/write}{0} @@ -611,21 +725,23 @@ \cs_new_protected:Npn \__math_grab_dollar:w { \__math_grab_dollar_delim:w } \cs_new_protected:Npn \__math_grab_dollar:n #1 { - \tl_if_blank:nF {#1} - { - \__math_process:nn { math } {#1} % $ - \bool_lazy_or:nnTF - {\legacy_if_p:n { measuring@ }} - { \l__math_fakemath_bool } - { #1 $ } + \__math_process:nn { math } {#1} + \bool_lazy_any:nTF + { + {\legacy_if_p:n { measuring@ }} + { \l__math_fakemath_bool } + { \tl_if_blank_p:n {#1} } + } + { + #1 $ % $ + } { \tag_socket_use:n {math/inline/begin} %end P-MC \tag_socket_use:nn {math/inline/formula/begin}{#1} - $ + $ % $ \tag_socket_use:n {math/inline/formula/end} \tag_socket_use:n {math/inline/end} % restart P-MC } - } } \cs_new_protected:Npn \__math_grab_dollar_delim:w #1 $ % $ { \__math_grab_dollar:n {#1} } @@ -637,8 +753,8 @@ \__math_process:nn { equation* } {#1} \socket_use:n {tagsupport/math/display/begin} \socket_use:nn{tagsupport/math/display/formula/begin}{#1} - $$ } + $$ } \cs_new_protected:Npn \__math_tag_dollardollar_display_end: { |