Skip to content

Commit

Permalink
Move luamml patches into latex-lab (#1666)
Browse files Browse the repository at this point in the history
* update tagpdf/luamml to dev versions

* add luamml with tagging sockets

* add math tagging sockets

* add luamml sockets

* trim spaces

* add math tagging sockets, WIP

* correct explsyntaxoff

* remove confusing outdated comment

* correct expandable sockets

* add luamml sockets to array

* add testfiles

* add date

* update tagpdf

* update testfiles

* correct socket declaration

* correctly predeclare luamml socket.

* update luatex testfiles

* luamml support, enable default plug for tagging sockets with arguments

* update luamml

* add luamml socket to mbox

* add testfiles

* add support for makebox too

* rename sockets

* luamml support for text command

* track group level for nested math handling when writing mathml

* correct socket name

* update tagpdf, luamml

* add unicode-math fixes for sqrt and fract

* update luamml

* handle root with degree

* update tagpdf

* update testfile

* correct entry

* use \@mathlevel to identify nested math

* update test

* add math/setup keys, WIP

* update and extend mathtagging tests

* luamml socket for mtable

* add luamml hook to finalize mtable

* update luamml in texmf tree

* correct command

* update luamml, activate plug

* update dates

* update luamml

* add testfile for phantom issue

* try to handle nested phantom

* keep mphantom

* suppress tagging of \phantom in text mode

* avoid side effects from mathml-file

* redefine \ph@nt with luatex

* testfiles

* luamml sockets for math phantom

* update date

* correct definition

* add tagging support to \mathph@nt

* update luamml

* suppress tagging in nested phantom

* update testfiles

* update luamml

* redefine mathpalette in luatex

* remove redefinition of \ph@nt

* handle smash

* correct text

* update luamml

* define command later (in case luamml-pdf is loaded).

* use generic luamml save sockets

* update luamml

* move array patch into array.sty

* update testfile

* update testfile

* move to latest in testfiles

* more luamml sockets

* update luamml

* move gather, maketag@@@ into amsmath file

* adapt testfile to better label handling

* moving gathered luamml patch

* more luamml sockets

* add sockets for inner tables

* move aligned to latex-lab

* move smallmatrix patch

* move gather, add luamml_ignore to measuring@true

* repair gather*

* load amsmath code after amsmath

* remove unneeded package hook

* remove subpart code from latex-lab-math

* another testfile

* move \math@cr@@@align

* testfile updates after dropping of subpart code

* update testfiles

* block testfiles

* update luamml

* get rid of empty structures

* update luamml

* handle labels in alignment

* add testfiles for labelled align

* update testfiles

* move multline code, WIP

* left is not right

* replace deprected command

* finish moving multline

* move luamml cases  patchÂ

* move mathtool patch

* handle empty tags, WIP

* handle notag and starred aligments

* remove now unneeded definitions of \math@cr@@@gather and \restore@math@cr

* move amsmath definitions to amsmath file

* move rest of amsmath patches to amsmath file

* update luamml

* move bBigg@ definition

* add MathCollectTrue/False and documentation

* missing commentchar

* update luamml

* docu improvement

* handle varlim commands

* update luamml

* update pdfmanagement to 0.96p

* update testfiles to new pdfmanagement

* add -S to workflow

* next bunch of testfiles

* update testfiles (pdfmanagement change)

* update some testfiles

* update to tagpdf 0.99m

* add phoneme to latex

* set default pdfversion to 2.0

* document phoneme addition

* first round of testfiles (PDF 2.0)

* more minipage tests

* sh for testfile updates

* typos

* updates tests, pdf 2.0

* move tabular patch

* update.sh

* update testfiles

* missed one testfile

* misplaces key.

* missing seeds.

* git commit -m"move array luamml sockets into \array"

* from review (spelling)

* remove duplicated socket assignments

* use transparent as default for 2-argument tagging sockets

* move main math sockets into lttagging

* spelling

* unify spaces

* first support for tagging of split environment

* corrections from review, trim spaces

* update math tagging examples

* corrections from review

* rename math/setup value structelem to mathml-SE

* update testfiles
  • Loading branch information
u-fischer authored Feb 20, 2025
1 parent 044baae commit c40a018
Show file tree
Hide file tree
Showing 547 changed files with 62,507 additions and 30,663 deletions.
9 changes: 8 additions & 1 deletion base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ to completeness or accuracy and it contains some references to files that are
not part of the distribution.
================================================================================

2025-02-17 Ulrike Fischer <[email protected]>
* lttagging.dtx: add sockets for luamml support.
* lttagging.dtx: provide \MathCollectTrue, \MathCollectFalse

2025-02-14 Frank Mittelbach <[email protected]>

* ltoutput.dtx:
Expand All @@ -21,19 +25,20 @@ not part of the distribution.
* ltoutenc.dtx
Log only text command/symbol redeclarations (gh/1242)


2025-02-03 Frank Mittelbach <[email protected]>

* lthooks.dtx:
Document more prominently that using a hook with \UseHook or similar
commands requires that the hook to be declared first (gh/1519)


2025-02-01 Jonathan P. Spratte

* ltcmd.dtx (subsection{User functions}):
Generalise \ProcessList by using \tl_map_tokens:nn instead of
\tl_map_function:nN.


2025-01-31 Frank Mittelbach <[email protected]>

* latexrelease.dtx (subsection{Ignoring \texttt{\string_new} errors when rolling back}):
Expand Down Expand Up @@ -62,6 +67,7 @@ not part of the distribution.
Allow * to denote the current counter (as used by \label) in counter
related commands, \alph*, \stepcounter*, etc. (gh/1632)


2025-01-21 Frank Mittelbach <[email protected]>

* ltoutput.dtx (subsection{Floats}):
Expand Down Expand Up @@ -153,6 +159,7 @@ not part of the distribution.
* ltxref.dtx (subsection{Cross Referencing})
Replace \@tempa with \reserved@a in \Ref (gh/1579)


2024-12-03 Yukai Chou <[email protected]>
* ltmarks.dtx (subsection{Allocating new mark classes}):
Fix inconsistent local/global assignment (gh/1574)
Expand Down
12 changes: 12 additions & 0 deletions base/doc/ltnews41.tex
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,18 @@ \section{News from Tagged PDF project}

\emph{to write}

\subsection{Setting up math tagging}

With the \LuaTeX{} engine there are now various options for accessible math described in full details in latex-lab-math.pdf. To simplify the setup a new
key \texttt{math/setup} can be used that accepts a comma list with the values \texttt{mathml-SE} (add MathML structure element), \texttt{mathml-AF}
(attach MathML associated file) or \texttt{tex-AF} (attach the TeX source).


\subsection{Promoting PDF 2.0}

PDF 2.0 is a requirement for accessible PDF containing math as the MathML name spaces isn't supported by earlier PDF versions. \LaTeX{} will therefore set
PDF 2.0 as default version if \cs{DocumentMetadata} is used. A different PDF version can be set with the \texttt{pdfversion} key.

\subsection{Fixing the spacing after display math}

When \LaTeX{} produces an accessible (tagged) PDF it has to add
Expand Down
238 changes: 235 additions & 3 deletions base/lttagging.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@
% Usually, these sockets have (beside the default plug defined for every socket)
% one additional plug defined and directly assigned. This plug is used when
% tagging is active.
% There may be more plugs, e.g., tagging with special debugging or special behaviour
% There may be more plugs, e.g., tagging with special debugging or special behavior
% depending on the class or PDF version etc., but right now it is usually just on or off.
%
% When tagging is suspended they all have the same predefined behaviour:
% When tagging is suspended they all have the same predefined behavior:
% The sockets with zero arguments do nothing. The sockets with one argument
% gobble their argument. The sockets with two arguments
% will drop their first argument and pass the second unchanged.
Expand All @@ -152,7 +152,14 @@
% \cs{UseTaggingSocket} because they do not have to determine how
% many arguments the socket takes when disabling it.
%
%
% \DescribeMacro\MathCollectTrue
% \DescribeMacro\MathCollectFalse
% The tagging of math has to collect/grab the math first. This is not wanted
% for all uses of \verb+$+. These command allow to control the behavior of the
% math shift token. Without the math tagging code they do nothing. Their behavior
% with the math tagging code is documented in latex-lab-math.pdf
%
%
% \MaybeStop{}
%
%
Expand Down Expand Up @@ -230,6 +237,16 @@
%
% \end{macro}
%
% \subsection{Math collection}
% The documentation is in latex-lab-math.
%
% \begin{macro}{\MathCollectTrue,\MathCollectFalse}
% \begin{macrocode}
\cs_new_protected:Npn\MathCollectTrue{}
\cs_new_protected:Npn\MathCollectFalse{}
% \end{macrocode}
% \end{macro}
%
% \subsection{Tagging sockets}
% This collects tagging sockets that should be generally available
% so that they can also be used even if the tagging code is not loaded.
Expand Down Expand Up @@ -621,7 +638,222 @@
% \end{macrocode}
% \end{socketdecl}
%
% \subsection{Tagging support for math}
%
% \subsubsection{General sockets}
%
% The following sockets are the main math sockets.
%
% \changes{v1.0n}{2025/02/19}{Moved math sockets into lttagging}
% \begin{macrocode}
\NewSocket{tagsupport/math/inline/begin}{0}
\NewSocket{tagsupport/math/inline/end}{0}
\NewSocket{tagsupport/math/inline/formula/begin}{2}
\NewSocket{tagsupport/math/inline/formula/end}{0}
\NewSocket{tagsupport/math/display/begin}{0}
\NewSocket{tagsupport/math/display/end}{0}
\NewSocket{tagsupport/math/display/formula/begin}{2}
\NewSocket{tagsupport/math/display/formula/end}{0}
\NewSocket{tagsupport/math/display/tag/begin}{0}
\NewSocket{tagsupport/math/display/tag/end}{0}
% \end{macrocode}
% Assign transparent socket to the sockets with two arguments:
% \begin{macrocode}
\NewSocketPlug{tagsupport/math/inline/formula/begin}{transparent}{#2}
\AssignSocketPlug{tagsupport/math/inline/formula/begin}{transparent}
\NewSocketPlug{tagsupport/math/display/formula/begin}{transparent}{#2}
\AssignSocketPlug{tagsupport/math/display/formula/begin}{transparent}
% \end{macrocode}
%
% \subsubsection{Sockets specific for luamml}
% \paragraph{Save sockets}
% These sockets are wrappers around the \cs{luamml_save:...} commands.
% They take an argument which should contain the argument of the save command.
%
% \begin{socketdecl}{tagsupport/math/luamml/save/nn}
% The argument should contain the two arguments of the command.
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/save/nn}{1}
\AssignSocketPlug{tagsupport/math/luamml/save/nn}{noop}
% \end{macrocode}
% \end{socketdecl}
%
% \begin{socketdecl}{tagsupport/math/luamml/save/nNn}
% The argument should contain the three arguments of the command.
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/save/nNn}{1}
\AssignSocketPlug{tagsupport/math/luamml/save/nNn}{noop}
% \end{macrocode}
% \end{socketdecl}
%
% \paragraph{Socket to annotate}
%
% \begin{socketdecl}{tagsupport/math/luamml/annotate/false}
% These socket can be used for content that should be annotated
% with \texttt{core=false}
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/annotate/false}{2}
\NewSocketPlug{tagsupport/math/luamml/annotate/false}{transparent}{#2}
\AssignSocketPlug{tagsupport/math/luamml/annotate/false}{transparent}
% \end{macrocode}
% \end{socketdecl}
%
% \paragraph{Array sockets} These sockets will be used in \pkg{array} to
% add luamml support to the array environment.
%
% \begin{socketdecl}{tagsupport/math/luamml/array/save}
%
% This socket will be used in \cs{endarray}. The plug is set by luamml.
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/array/save}{0}
% \end{macrocode}
% \end{socketdecl}
%
% \begin{socketdecl}{tagsupport/math/luamml/array/finalize}
%
% This socket will be used in \cs{endarray}. The plug is set by luamml.
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/array/finalize}{0}
% \end{macrocode}
% \end{socketdecl}
%
% \begin{socketdecl}{tagsupport/math/luamml/array/initcol}
% This socket will be used in \cs{@classz}. The plug is set by luamml.
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/array/initcol}{0}
% \end{macrocode}
% \end{socketdecl}
%
%
% \begin{socketdecl}{tagsupport/math/luamml/array/finalizecol}
% This socket will be used in \cs{@classz}. The plug is set by luamml.
% The argument sets the type of the column.
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/array/finalizecol}{1}
\AssignSocketPlug{tagsupport/math/luamml/array/finalizecol}{noop}
% \end{macrocode}
% \end{socketdecl}
%
% \paragraph{Alignment environments}
% Multiline environments like \texttt{align}, \texttt{multline} or \texttt{gather}
% are tagged as \texttt{mtable}.
%
% \begin{socketdecl}{tagsupport/math/luamml/mtable/finalizecol}
% This sockets is used at the end of alignment cells and adds them to
% the row. The argument passes a type like \texttt{last} or \texttt{box}.
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/mtable/finalizecol}{1}
\AssignSocketPlug{tagsupport/math/luamml/mtable/finalizecol}{noop}
% \end{macrocode}
% \end{socketdecl}
%
%
% \begin{socketdecl}{tagsupport/math/luamml/mtable/finalize}
% This sockets is used at the end of alignment environment to finalize the
% mtable code. It should be used normally with \cs{UseExpandableTaggingSocket}.
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/mtable/finalize}{1}
\AssignSocketPlug{tagsupport/math/luamml/mtable/finalize}{noop}
% \end{macrocode}
% \end{socketdecl}
%
% \begin{socketdecl}{tagsupport/math/luamml/mtable/aligncol}
% This sockets is used in multline to add attributes
% describing the alignment to the left and right.
% It takes an argument, the alignment.
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/mtable/aligncol}{1}
\AssignSocketPlug{tagsupport/math/luamml/mtable/aligncol}{noop}
% \end{macrocode}
% \end{socketdecl}

%
% \begin{socketdecl}{tagsupport/math/luamml/mtable/innertable/save}
% This socket is used in \cs{endaligned} to save the table. It takes no argument.
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/mtable/innertable/save}{0}
% \end{macrocode}
% \end{socketdecl}
%
% \begin{socketdecl}{tagsupport/math/luamml/mtable/smallmatrix/save}
% This socket is used in \cs{endsmallmatrix} to save the table. It takes no argument.
% TODO: Check if this socket and the innertable socket can/should be merged into a more
% generic version.
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/mtable/smallmatrix/save}{0}
% \end{macrocode}
% \end{socketdecl}
%
% \begin{socketdecl}{tagsupport/math/luamml/mtable/innertable/finalize}
% This socket is used e.g. in \cs{endsmallmatrix} and \cs{gathered} to finalize the table.
% It takes no argument.
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/mtable/innertable/finalize}{0}
% \end{macrocode}
% \end{socketdecl}
%
% \begin{socketdecl}{tagsupport/math/luamml/mtable/tag/save}
% This socket is used to save a tag for later use.
% has been save before.
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/mtable/tag/save}{0}
% \end{macrocode}
% \end{socketdecl}

% \begin{socketdecl}{tagsupport/math/luamml/mtable/tag/set}
% This socket should be used when a tag is placed. It inserts a tag that
% has been save before.
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/mtable/tag/set}{0}
% \end{macrocode}
% \end{socketdecl}
%
% \paragraph{mbox socket}
%
% \begin{socketdecl}{tagsupport/math/luamml/hbox}
% This socket is used around \cs{hbox}
% inside an \cs{mbox}, \cs{makebox} and \cs{text} and annotates
% the content if the \cs{hbox} is used inside math.
% The real plug is set by luamml but a default plug is defined
% here so that the socket can also be used if luamml is not used.
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/hbox}{2}
\NewSocketPlug{tagsupport/math/luamml/hbox}{transparent}{#2}
\AssignSocketPlug{tagsupport/math/luamml/hbox}{transparent}
% \end{macrocode}
% \end{socketdecl}
%
%
% \paragraph{math phantom sockets}
% \changes{1.0m}{2025-01-27}{add sockets for math phantom commands}
% \begin{socketdecl}{tagsupport/math/luamml/finph@nt}
% This socket handles the annotation of \cs{finph@nt}
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/finph@nt}{2}
\NewSocketPlug{tagsupport/math/luamml/finph@nt}{transparent}{#2}
\AssignSocketPlug{tagsupport/math/luamml/finph@nt}{transparent}
% \end{macrocode}
% \end{socketdecl}
%
% \begin{socketdecl}{tagsupport/math/luamml/finph@nt}
% This socket handles the annotation of \cs{finsm@sh}
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/finsm@sh}{2}
\NewSocketPlug{tagsupport/math/luamml/finsm@sh}{transparent}{#2}
\AssignSocketPlug{tagsupport/math/luamml/finsm@sh}{transparent}
% \end{macrocode}
% \end{socketdecl}
% \paragraph{Artifact root sign}
%
% \begin{socketdecl}{tagsupport/math/luamml/artifact}
% Unicode characters like a root sign should be marked as artifacts
% to avoid duplication, e.g., in derivation if mathml
% structure elements are used that imply the meaning.
%
% \begin{macrocode}
\NewSocket{tagsupport/math/luamml/artifact}{0}
% \end{macrocode}
% \end{socketdecl}
%
% \section{For lttab.dtx parked here for now}
%
Expand Down
16 changes: 16 additions & 0 deletions required/latex-lab/changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
2025-02-20 Ulrike Fischer <[email protected]>
* documentmetadata-support.dtx: set PDF 2.0 as default
* latex-lab-text.dtx: add phoneme instruction to LaTeX.
* documentmetadata-support.dtx: replace deprecated \keys_set_filter:nnn
* latex-lab-math.dtx: removed the subpart code. It will probably never be used.
* latex-lab-math.dtx: move amsmath-patches int latex-lab-amsmath, and insert
luamml patches.
* latex-lab-math.dtx: redefine \mathpalette in luatex.
* latex-lab-math.dtx: Add math/setup key.
* latex-lab-text.dtx: suppress tagging in \phantom in text mode, adapt for mathmode.
* latex-lab-unicode-math.dtx: tag roots and fraction rules as artifact is
mathml structure elements are used.
* use \@math@level to identify nested math
* added latex-lab-unicode-math.dtx/ltx for unicode-math fixes
* redefine \bBigg@ if unicode-math is used.

2025-02-14 Frank Mittelbach <[email protected]>

* latex-lab-new-or-1.dtx:
Expand Down
15 changes: 9 additions & 6 deletions required/latex-lab/documentmetadata-support.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
% for those people who are interested or want to report an issue.
%
% \begin{macrocode}
\def\documentmetadatasupportversion{1.0k}
\def\documentmetadatasupportdate{2024-12-23}
\def\documentmetadatasupportversion{1.0m}
\def\documentmetadatasupportdate{2025-02-17}
% \end{macrocode}
%
%
Expand Down Expand Up @@ -370,10 +370,13 @@
\file_input:n {l3backend-testphase-\c_sys_backend_str.def}
\ExplSyntaxOff\makeatother
% \end{macrocode}
%
% Process the init keys and setup the generic driver.
% \changes{v1.0m}{2025/02/17}{Set PDF 2.0 as default}
% \begin{macrocode}
\pdf_version_gset:n { 2.0 }
% \end{macrocode}
% Process the non-init keys and setup the generic driver.
% \begin{macrocode}
\keys_set_filter:nnn { document / metadata } { init } { #1 }
\keys_set_exclude_groups:nnn { document / metadata } { init } { #1 }
\bool_if:NT \g_@@_active_bool
{
\PassOptionsToPackage{customdriver=hgeneric-testphase}{hyperref}
Expand Down Expand Up @@ -412,7 +415,7 @@
% \begin{macrocode}
\cs_set_protected:Npn \DocumentMetadata ##1
{
\keys_set_filter:nnn { document / metadata } { init } { ##1 }
\keys_set_exclude_groups:nnn { document / metadata } { init } { ##1 }
\str_remove_all:cn {[email protected]}{customdriver=hgeneric-testphase}
\bool_if:NT \g__pdfmanagement_active_bool
{
Expand Down
Loading

0 comments on commit c40a018

Please sign in to comment.