summaryrefslogtreecommitdiff
path: root/macros/latex-dev/required/latex-lab
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex-dev/required/latex-lab')
-rw-r--r--macros/latex-dev/required/latex-lab/README.md2
-rw-r--r--macros/latex-dev/required/latex-lab/blocks-code.pdfbin871980 -> 875416 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/blocks-doc.pdfbin486159 -> 486033 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/changes.txt76
-rw-r--r--macros/latex-dev/required/latex-lab/documentmetadata-support-code.pdfbin533350 -> 539538 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/documentmetadata-support-doc.pdfbin420563 -> 421072 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/documentmetadata-support.dtx34
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-amsmath.dtx6
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-amsmath.pdfbin382077 -> 382340 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-bib.dtx10
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-bib.pdfbin383259 -> 383673 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-block.dtx94
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-block.pdfbin871980 -> 875416 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-firstaid.dtx69
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-firstaid.pdfbin300730 -> 367986 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-float.dtx4
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-float.pdfbin426854 -> 427005 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-footnotes.dtx28
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-footnotes.pdfbin819323 -> 820982 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-graphic.dtx10
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-graphic.pdfbin517900 -> 517929 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-marginpar.dtx35
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-marginpar.pdfbin389702 -> 414425 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-math.dtx588
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-math.pdfbin740466 -> 777735 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-mathpkg.pdfbin355801 -> 355928 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-mathtools.dtx4
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-mathtools.pdfbin382077 -> 372090 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-minipage.dtx51
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-minipage.pdfbin280811 -> 282245 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-namespace.dtx21
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-namespace.pdfbin234649 -> 235962 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-new-or-1.pdfbin389721 -> 389721 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-new-or-2.pdfbin632196 -> 632196 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-sec.dtx8
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-sec.pdfbin527096 -> 527408 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-table.dtx474
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-table.pdfbin556861 -> 572645 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-testphase.dtx2
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-testphase.pdfbin298048 -> 298111 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-text.pdfbin307812 -> 307812 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-title.pdfbin348117 -> 348117 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-toc-hyperref-changes.pdfbin296124 -> 296124 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-toc-kernel-changes.dtx91
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-toc-kernel-changes.pdfbin361081 -> 376511 bytes
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-toc.dtx93
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-toc.pdfbin396814 -> 410540 bytes
47 files changed, 1390 insertions, 310 deletions
diff --git a/macros/latex-dev/required/latex-lab/README.md b/macros/latex-dev/required/latex-lab/README.md
index 8663b7e4ad..116223aecb 100644
--- a/macros/latex-dev/required/latex-lab/README.md
+++ b/macros/latex-dev/required/latex-lab/README.md
@@ -1,6 +1,6 @@
# LaTeX laboratory
-Release 2024-06-01 pre-release 2
+Release 2024-11-01 pre-release 3
## Overview
diff --git a/macros/latex-dev/required/latex-lab/blocks-code.pdf b/macros/latex-dev/required/latex-lab/blocks-code.pdf
index 958db3a440..38ff9f597e 100644
--- a/macros/latex-dev/required/latex-lab/blocks-code.pdf
+++ b/macros/latex-dev/required/latex-lab/blocks-code.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/blocks-doc.pdf b/macros/latex-dev/required/latex-lab/blocks-doc.pdf
index d34cb17fa3..e27577d88b 100644
--- a/macros/latex-dev/required/latex-lab/blocks-doc.pdf
+++ b/macros/latex-dev/required/latex-lab/blocks-doc.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/changes.txt b/macros/latex-dev/required/latex-lab/changes.txt
index cc5bb2d4f0..9b016419ab 100644
--- a/macros/latex-dev/required/latex-lab/changes.txt
+++ b/macros/latex-dev/required/latex-lab/changes.txt
@@ -1,3 +1,69 @@
+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
+
+2024-08-12 Joseph Wright <Joseph.Wright@latex-project.org>
+ * latex-lab-math.dtx: add support for math in tabulars
+
+2024-08-11 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
+ * latex-lab-firstaid.dtx: amsproc support, discussion in PR #517
+
+2024-08-11 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
+ * latex-lab-block.dtx: preset verbatim para-instance, issue #119
+
+2024-08-10 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
+ * latex-lab-block.dtx, latex-lab-table.dtx: reset flattened level in para/restore, issue #544
+
+2024-08-08 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
+ * latex-lab-minipage.dtx, latex-lab-table.dtx: improve support for minipage in tables.
+ handle issue #37
+
+2024-08-06 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
+ * latex-lab-table.dtx: add support for header-columns
+ * latex-lab-table.dtx: add support for multirows
+ * latex-lab-table.dtx: handle issue #432
+ * latex-lab-marginpar.dtx: handle issue #444
+
+2024-07-11 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
+ * latex-lab-footnote.dtx: restore paragraph defaults at the begin of the footnote
+ tagging-project#262
+
+2024-07-13 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * latex-lab-table.dtx (subsection{Tagging support sockets}):
+ add plugs for tbl/leaders/begin and /end
+ (subsection{Misc stuff}): drop unused socket
+
+2024-07-11 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
+ * latex-lab-toc.dtx, latex-lab-toc-kernel-changes: switch from configuration points
+ to sockets.
+
+2024-05-25 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
+ * latex-lab-table.dtx: disable table headers in presentation tables.
+
+2024-05-25 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
+ * latex-lab-firstaid.dtx: add firstaid for booktabs cmidrules,
+ see tagging-issue 69.
+
+2024-04-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
+ * documentmetadata-support.dtx: change handling of default language.
+ The code now tries to detect languages set by babel/polyglossia.
+
+2024-04-16 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
+ * latex-lab-math.dtx: use tagging socket to disable math-writing if tagging
+ is suspended
+
+2024-03-24 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * latex-lab-namespace.xlsx:
+ File added (draft) replacing tagnames-commands.md
+
2024-03-23 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* documentmetadata-support.dtx: keys for A4-E and A4-F
@@ -47,15 +113,15 @@
them too. Of course, none of this is very robust. By the end of the
day well need updating to the new standard solution.
-2024-02-23 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
- * latex-lab-amsmath.dtx, latex-lab-mathpkg.dtx: handle \pbm and poormans \bm
+2024-02-23 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
+ * latex-lab-amsmath.dtx, latex-lab-mathpkg.dtx: handle \pbm and poormans \bm
(luatex only)
-2024-02-23 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
+2024-02-23 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* update tagpdf and pdfmanagement
-2024-02-16 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
- * latex-lab-graphic.dtx: move end structure behind \fi, tagging-project#64
+2024-02-16 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
+ * latex-lab-graphic.dtx: move end structure behind \fi, tagging-project#64
2024-02-12 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-block.dtx: left align description labels.
diff --git a/macros/latex-dev/required/latex-lab/documentmetadata-support-code.pdf b/macros/latex-dev/required/latex-lab/documentmetadata-support-code.pdf
index 8699dd4426..b2d74f849f 100644
--- a/macros/latex-dev/required/latex-lab/documentmetadata-support-code.pdf
+++ b/macros/latex-dev/required/latex-lab/documentmetadata-support-code.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/documentmetadata-support-doc.pdf b/macros/latex-dev/required/latex-lab/documentmetadata-support-doc.pdf
index 89d9c58314..362954edba 100644
--- a/macros/latex-dev/required/latex-lab/documentmetadata-support-doc.pdf
+++ b/macros/latex-dev/required/latex-lab/documentmetadata-support-doc.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/documentmetadata-support.dtx b/macros/latex-dev/required/latex-lab/documentmetadata-support.dtx
index 54483ec4c9..a629d9c551 100644
--- a/macros/latex-dev/required/latex-lab/documentmetadata-support.dtx
+++ b/macros/latex-dev/required/latex-lab/documentmetadata-support.dtx
@@ -350,14 +350,35 @@
\file_input:n {l3backend-testphase-\c_sys_backend_str.def}
\ExplSyntaxOff\makeatother
% \end{macrocode}
-% Set the default language (this requires that the backend has been loaded),
-% process the rest of the keys,
-% and setup the generic driver.
+%
+% Process the init keys and setup the generic driver.
% \begin{macrocode}
- \keys_set_filter:nnn { document / metadata } { init } { lang=en-US, #1 }
+ \keys_set_filter:nnn { document / metadata } { init } { #1 }
\bool_if:NT \g_@@_active_bool
{
\PassOptionsToPackage{customdriver=hgeneric-testphase}{hyperref}
+% \end{macrocode}
+% Finally we setup the language default.
+% This is done after the begindocument hook so that it can pick up settings
+% from babel. If the Catalog dictionary already contains a lang value we do nothing,
+% otherwise we use the value stored in \cs{BCPdata}, either the main language
+% (if its exists) or the fall back language.
+% Note: if babel is loaded without a language this gives the language \texttt{und}.
+% \begin{macrocode}
+ \g@addto@macro\@kernel@after@begindocument
+ {
+ \pdfdict_get:nnN {g__pdf_Core/Catalog}{Lang}\l_@@_tmpa_tl
+ \quark_if_no_value:NT\l_@@_tmpa_tl
+ {
+ \tl_if_empty:eTF { \BCPdata{main.language} }
+ { \tl_set:Ne \l_@@_tmpb_tl { \BCPdata{language} } }
+ { \tl_set:Ne \l_@@_tmpb_tl { \BCPdata{main.language} } }
+ \msg_warning:nne { meta } { lang-missing }{ \l_@@_tmpb_tl }
+ \exp_last_unbraced:Ne
+ \AddToDocumentProperties{[document]{lang}{\l_@@_tmpb_tl}}
+ \pdfmanagement_add:nne {Catalog} {Lang}{(\l_@@_tmpb_tl)}
+ }
+ }
}
% \end{macrocode}
% \cs{pdfmanagement_add:nnn} has collected values in this hook.
@@ -556,6 +577,11 @@
{
LaTeX-lab~package~'#1'~not~found.
}
+\msg_new:nnn { meta } { lang-missing }
+ {
+ The~language~has~not~been~set~in~\token_to_str:N
+ \DocumentMetadata.\\Setting~it~to~'#1'~as~fallback.
+ }
% \end{macrocode}
%
% \begin{macrocode}
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-amsmath.dtx b/macros/latex-dev/required/latex-lab/latex-lab-amsmath.dtx
index 57e27067cb..1b6302bb33 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-amsmath.dtx
+++ b/macros/latex-dev/required/latex-lab/latex-lab-amsmath.dtx
@@ -66,7 +66,7 @@
% \subsection{File declaration}
% \begin{macrocode}
\ProvidesFile{latex-lab-amsmath.ltx}
- [2024-02-12 v0.1b amsmath adaptions]
+ [2024-07-05 v0.1b amsmath adaptions]
% \end{macrocode}
% \subsection{Tagpdf support}
% To make the code independent from tagging being loaded and active
@@ -200,8 +200,8 @@
% \end{macrocode}
%
% \subsection{\cs{pmb}}
-% \cs{pmb} prints is argument three times. For tagging we must mark
-% two of occurences as artifact.
+% \cs{pmb} prints its argument three times. For tagging we must mark
+% two of occurrences as artifact.
% For luatex the attributes in the box must be reset, for this
% we switch to expl3-boxes.
% \begin{macrocode}
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-amsmath.pdf b/macros/latex-dev/required/latex-lab/latex-lab-amsmath.pdf
index 3b652dd264..6bb389ef9e 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-amsmath.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-amsmath.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-bib.dtx b/macros/latex-dev/required/latex-lab/latex-lab-bib.dtx
index e8ee192a7b..9d336aba20 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-bib.dtx
+++ b/macros/latex-dev/required/latex-lab/latex-lab-bib.dtx
@@ -16,7 +16,7 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabbibdate{2024-02-12}
+\def\ltlabbibdate{2024-07-05}
\def\ltlabbibversion{0.81b}
%<*driver>
\documentclass{l3doc}
@@ -128,7 +128,7 @@
%
% \begin{function}{\@extra@binfo,\@extra@b@citeb}
%
-% These are taken from hyperref, they are for chapterbib compability (and also
+% These are taken from hyperref, they are for chapterbib compatibility (and also
% signal to chapterbib not to change the citation commands)
% \end{function}
%
@@ -157,7 +157,7 @@
% \end{macrocode}
% \begin{macro}{\@extra@binfo,\@extra@b@citeb}
-% These are taken from hyperref, they are for chapterbib compability (and also
+% These are taken from hyperref, they are for chapterbib compatibility (and also
% signal to chapterbib not to change the citation commands)
% \begin{macrocode}
\providecommand*\@extra@binfo{}%
@@ -270,7 +270,7 @@
% \end{macrocode}
% Now we add the tagging structure.
% TODO: with the next tagpdf version it should no longer be
-% needed to exand the ref key.
+% needed to expand the ref key.
% \begin{macrocode}
\AddToHookWithArguments{bibcite/before}
{
@@ -305,7 +305,7 @@
% We need in part different code for both systems:
% with biblatex we have to take care that only the first
% structure sets a label, and if
-% hyperref is not loaded (or deactived) we will need additional code
+% hyperref is not loaded (or deactivated) we will need additional code
% but this currently doesn't exist.
% We assume that no document loads both package -- that will probably break.
% \begin{macrocode}
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-bib.pdf b/macros/latex-dev/required/latex-lab/latex-lab-bib.pdf
index 94cc528e47..2643725efa 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-bib.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-bib.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-block.dtx b/macros/latex-dev/required/latex-lab/latex-lab-block.dtx
index 7d08b270d2..23c590419e 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-block.dtx
+++ b/macros/latex-dev/required/latex-lab/latex-lab-block.dtx
@@ -9,8 +9,8 @@
%
% https://www.latex-project.org/lppl.txt
%
-\def\ltlabblockdate{2024-03-23}
-\def\ltlabblockversion{0.8n}
+\def\ltlabblockdate{2024-08-11}
+\def\ltlabblockversion{0.8p}
%<*driver>
\documentclass[kernel]{l3doc}
\usepackage{amstext}
@@ -341,7 +341,7 @@
%
% The idea of a \key{heading} key needs some further
% thoughts. Maybe instead the object type should accept a second
-% argument and receive input for such a headding from the document
+% argument and receive input for such a heading from the document
% level instead.
%
% The names of the keys need further thoughts and some
@@ -474,7 +474,7 @@
% \>\>\> The paragraph text before the display element \ldots\\
% \>\> \struct{/text}\\
% \>\> \struct{display element structure}\\
-% \>\>\> Content of the display structure possiblly involving inner \struct{text-unit} tags\\
+% \>\>\> Content of the display structure possibly involving inner \struct{text-unit} tags\\
% \>\> \struct{/display element structure}\\
% \>\> \struct{text}\\
% \>\>\> \ldots{} continuing the outer paragraph text\\
@@ -722,7 +722,7 @@
blockenv implementation]
% \end{macrocode}
%
-% Generell kernel changes, also loaded by the sec and toc code.
+% General kernel changes, also loaded by the sec and toc code.
% \begin{macrocode}
\RequirePackage{latex-lab-kernel-changes}
% \end{macrocode}
@@ -795,7 +795,52 @@
% The flag itself should be set globally not locally.\fmi{verify
% that this claim is actually correct!}
% \begin{macrocode}
-\def\@endpetrue {\global\let\if@endpe\iftrue}
+\def\@endpetrue {%
+ \global\let\if@endpe\iftrue
+% if called inside a group propagate to the outside
+ \ifnum\currentgrouplevel>\z@
+ \aftergroup\propagate@doendpe
+ \fi
+}
+% \end{macrocode}
+%
+% If \cs{if@endpe} is still true run \cs{@doendpe}
+% that in turn runs another \cs{@endpetrue} (besides other things),
+% thus propagating further, if necessary
+% However, if the endpe situation got resolved nothing further happens
+% \begin{macrocode}
+\def\propagate@doendpe{%
+ \if@endpe
+ \@@_debug_typeout:n{run~ (another)~ @doendpe~ at~
+ group~ level~ \the\currentgrouplevel}%
+ \@doendpe
+ \else
+ \@@_debug_typeout:n{do~ not~ run~ (another)~ @doendpe}%
+ \fi
+}
+% \end{macrocode}
+%
+% With the above approach we do not need the propagation in
+% \cs{end...} any longer
+% (since this is now handled by
+% \cs{aftergroup}\cs{propagate@doendpe}) so
+% here a simple \cs{endgroup} is enough. This replaces the
+% definition in ...:
+% \begin{macrocode}
+\@namedef{end }#1{%
+ \romannumeral
+ \IfHookEmptyTF{env/#1/end}%
+ {\expandafter\z@}%
+ {\z@\UseHook{env/#1/end}}%
+ \csname end#1\endcsname\@checkend{#1}%
+% \expandafter\endgroup\if@endpe\@doendpe\fi
+ \endgroup
+ \UseHook{env/#1/after}%
+ \if@ignore\@ignorefalse\ignorespaces\fi
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
\def\@endpefalse{\global\let\if@endpe\iffalse}
% \end{macrocode}
% \end{macro}
@@ -1569,7 +1614,7 @@
% \end{macrocode}
% We need to know later if we have nested blockenvs inside
% a flattened environment. Whenever we start a new blockenv we
-% increment \cs{\l_@@_flattened_level_int} if it is already
+% increment \cs{l__tag_block_flattened_level_int} if it is already
% different from zero. If it is zero we increment it if flattening
% is requested.
% Thus a value of \texttt{0} means no flattening requested so far
@@ -1578,14 +1623,14 @@
% is surrounded by a \texttt{text-unit} tag, while for any value above
% \texttt{1} we have to omit the \texttt{text-unit}.
% \begin{macrocode}
- \int_compare:nNnTF \l_@@_flattened_level_int > 0
+ \int_compare:nNnTF \l__tag_block_flattened_level_int > 0
{
- \int_incr:N \l_@@_flattened_level_int
+ \int_incr:N \l__tag_block_flattened_level_int
}
{
\bool_if:NT \l__tag_para_flattened_bool
{
- \int_incr:N \l_@@_flattened_level_int
+ \int_incr:N \l__tag_block_flattened_level_int
}
}
%
@@ -1681,11 +1726,15 @@
% \end{template}
%
%
-% \begin{macro}{\l_@@_flattened_level_int}
+% \begin{macro}{\l__tag_block_flattened_level_int}
% Count the levels of nested blockenvs starting with the first that
-% is \enquote{flattened}.
+% is \enquote{flattened}. The counter is defined in lttagging.dtx,
+% but until the next release 11/24 we set it up here too
% \begin{macrocode}
-\int_new:N \l_@@_flattened_level_int
+\int_if_exist:NF \l__tag_block_flattened_level_int
+ {
+ \int_new:N \l__tag_block_flattened_level_int
+ }
% \end{macrocode}
% \end{macro}
%
@@ -1814,9 +1863,13 @@
% and should not inherit the setting from the outer environment.
% \begin{macrocode}
\socket_new_plug:nnn{tagsupport/block-endpe}{on}
- { \legacy_if_gset_true:n { @endpe } }
+% \end{macrocode}
+% We can't use \cs{legacy_if_gset_true:n} because this is now doing
+% more than setting the legacy switch
+% \begin{macrocode}
+ { \@endpetrue }
\socket_new_plug:nnn{tagsupport/block-endpe}{off}
- { \legacy_if_gset_false:n { @endpe } }
+ { \@endpefalse }
% \end{macrocode}
%
% \begin{macrocode}
@@ -1981,7 +2034,7 @@
% \cs{parskip} and some other housekeeping, unless this block is inside a list and the list
% \cs{item} has not yet placed. In that case the vertical
% space and penalty us suppressed. This
-% is controled through the legacy switches \texttt{@noparitem},
+% is controlled through the legacy switches \texttt{@noparitem},
% \texttt{minipage}, and \texttt{@nobreak}.
% \begin{macrocode}
\legacy_if:nTF { @noparitem }
@@ -2520,7 +2573,7 @@
%
% \begin{macro}{\item}
% Here we already have all the building blocks. Complain in math
-% mode. Distingusih between first item (do necessary tagging) and
+% mode. Distinguish between first item (do necessary tagging) and
% later items \cs{@@_inter_item:} to
% cleanly close what's before, then call \cs{@@_item_instance:n} (which
% calls \cs{UseInstance}\{item\}\marg{instance}) to prepare the
@@ -2751,7 +2804,7 @@
\socket_assign_plug:nn{tagsupport/block-endpe}{on}
% \end{macrocode}
%
-% Handle the tag name and attribute classess using the key values
+% Handle the tag name and attribute classes using the key values
% from the current list instance.
% \begin{macrocode}
\tl_if_empty:NTF \l_@@_tag_name_tl
@@ -2994,6 +3047,7 @@
block-instance = verbatimblock ,
inner-instance = ,
final-code = \legacyverbatimsetup ,
+ para-instance = justify
}
% \end{macrocode}
% \end{instance}
@@ -3173,7 +3227,7 @@
% block quoteblock-4,
% block quoteblock-5,
% block quoteblock-6 }
-% Default layout is to indent equaly from both side.
+% Default layout is to indent equally from both sides.
% \begin{macrocode}
\DeclareInstance{block}{quoteblock-1}{display}
{ rightmargin = \KeyValue{leftmargin} }
@@ -3468,7 +3522,7 @@
% then have to avoid adding another \texttt{text-unit}.
% \begin{macrocode}
{
- \int_compare:nNnT \l_@@_flattened_level_int < 2
+ \int_compare:nNnT \l__tag_block_flattened_level_int < 2
{
\__tag_gincr_para_main_begin_int:
\tag_struct_begin:n
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-block.pdf b/macros/latex-dev/required/latex-lab/latex-lab-block.pdf
index 806562c30a..3b31116fd8 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-block.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-block.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-firstaid.dtx b/macros/latex-dev/required/latex-lab/latex-lab-firstaid.dtx
index ba4addadd2..9a94863d7a 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-firstaid.dtx
+++ b/macros/latex-dev/required/latex-lab/latex-lab-firstaid.dtx
@@ -16,8 +16,8 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabfirstaiddate{2024-03-18}
-\def\ltlabfirstaidversion{0.85c}
+\def\ltlabfirstaiddate{2024-08-11}
+\def\ltlabfirstaidversion{0.85e}
%<*driver>
\documentclass{l3doc}
\EnableCrossrefs
@@ -65,8 +65,34 @@
\ltlabfirstaiddate\space v\ltlabfirstaiddate\space
Temporary patches to external packages needed for the tagging project]
% \end{macrocode}
+% \begin{macro}{\FirstAidNeededT}
+% This is a very simple help to ensure that we only apply first aid
+% to an unmodified package or class. It only works in the case the
+% file has already been loaded and the csname \cs{ver@\#1.\#2} got
+% defined (holding the current date, version, and short description
+% info). We then compare its content to a frozen string and make
+% the modification \verb=#3= only if both agree. If they differ we
+% assume that the package/class in question got updated by its
+% maintainer.
+% \begin{macrocode}
+\ExplSyntaxOn
+\providecommand\FirstAidNeededT[3]{
+ \exp_args:Ncx\str_if_eq:onF{ver@#1.#2}{#3}
+ { \typeout{==>~ First~ Aid~ for~ #1.#2~ no~ longer~ applied!^^J
+ \@spaces Expected:^^J
+ \@spaces\@spaces #3^^J
+ \@spaces but~ found:^^J
+ \@spaces\@spaces \use:c{ver@#1.#2}^^J
+ \@spaces so~ I'm~ assuming~ it~ got~ fixed.
+ } }
+ \exp_args:Ncx\str_if_eq:onT{ver@#1.#2}{#3}
+}
+\ExplSyntaxOff
+% \end{macrocode}
+% \end{macro}
+
% \subsection{ams classes}
-% The amsart and amsbook classes do not use \cs{@author} to store the author list
+% The amsart, amsbook and amsproc classes do not use \cs{@author} to store the author list
% but a command \cs{authors}. To be able to nevertheless use the authors in the
% xmp-metadata we map \cs{@author} to this new command.
%
@@ -75,6 +101,8 @@
{\def\@author{\authors}}
\AddToHook{class/amsbook/after}
{\def\@author{\authors}}
+\AddToHook{class/amsproc/after}
+ {\def\@author{\authors}}
% \end{macrocode}
%
%
@@ -254,6 +282,41 @@
}
% \end{macrocode}
%
+% \subsection{booktabs}
+% In some cases booktabs inserts a
+% \cs{multispan} into the table (through the commands \cs{@cmidruleb}
+% and \cs{@cmidrulea} and this then errors
+% with the tagging code.
+% This affects both tabular and longtable
+% (but longtable more as booktabs handles lines in longtable differently).
+% See also issue \url{https://github.com/latex3/tagging-project/issues/69}
+%
+%
+\ExplSyntaxOn
+\AddToHook{package/booktabs/after}
+ {
+ \def\@cmidrulea{
+ \multispan\@cmidla
+ &\multispan\@cmidlb
+ \unskip\hskip\cmrkern@l
+ {
+ \tag_mc_begin:n{artifact}
+ \CT@arc@\leaders\hrule \@height\@thisrulewidth\hfill\kern\z@}
+ \hskip\cmrkern@r
+ \tag_mc_end: \int_gdecr:N \g__tbl_row_int
+ \cr}
+
+ \def\@cmidruleb{%
+ \multispan\@cmidlb
+ \unskip\hskip \cmrkern@l%
+ {
+ \tag_mc_begin:n{artifact}
+ \CT@arc@\leaders\hrule \@height\@thisrulewidth\hfill\kern\z@}
+ \hskip\cmrkern@r
+ \tag_mc_end: \int_gdecr:N \g__tbl_row_int
+ \cr}
+ }
+\ExplSyntaxOff
%
% \begin{macrocode}
%</package>
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-firstaid.pdf b/macros/latex-dev/required/latex-lab/latex-lab-firstaid.pdf
index a9789040a1..ce2e69882a 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-firstaid.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-firstaid.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-float.dtx b/macros/latex-dev/required/latex-lab/latex-lab-float.dtx
index a817133713..25ae805cfd 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-float.dtx
+++ b/macros/latex-dev/required/latex-lab/latex-lab-float.dtx
@@ -16,7 +16,7 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabfloatdate{2024-03-23}
+\def\ltlabfloatdate{2024-07-05}
\def\ltlabfloatversion{0.81e}
%<*driver>
\documentclass{l3doc}
@@ -64,7 +64,7 @@
%
% A special type, called a H-float, (provided by the float package)
% is always placed in the main text stream and does not
-% necessarly preserve the order with normal floats of the same type: It is basically
+% necessarily preserve the order with normal floats of the same type: It is basically
% a minipage with a caption.
%
% Floats typically contain a figure (or a table, etc.) and a caption,
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-float.pdf b/macros/latex-dev/required/latex-lab/latex-lab-float.pdf
index 7940618082..1ac490c00a 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-float.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-float.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-footnotes.dtx b/macros/latex-dev/required/latex-lab/latex-lab-footnotes.dtx
index a3d044ab87..039d8554f4 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-footnotes.dtx
+++ b/macros/latex-dev/required/latex-lab/latex-lab-footnotes.dtx
@@ -17,8 +17,8 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabfootnotedate{2024-03-12}
-\def\ltlabfootnoteversion{0.8d}
+\def\ltlabfootnotedate{2024-07-27}
+\def\ltlabfootnoteversion{0.8e}
%<*driver>
\documentclass{l3doc}
@@ -636,7 +636,7 @@
% number to setup the reference and the link.
%
% The structure related to the \cs{footref} is added to the end of the \texttt{/Ref} array of the note and so the
-% \texttt{/Ref} array doesn't necessarly reflect the order of the marks in the document. It would probably
+% \texttt{/Ref} array doesn't necessarily reflect the order of the marks in the document. It would probably
% be possible to change this, but it is not clear if it actually matters and so it worth the additional coding
% and processing.
%
@@ -1150,6 +1150,21 @@
%
%
% \begin{macro}{\fnote_footnotetext:n}
+% We temporarily test for the tagging socket until it is in the next release:
+% \begin{macrocode}
+\str_if_exist:cF { l__socket_tagsupport/para/restore_plug_str }
+ {
+ \NewSocket{tagsupport/para/restore}{0}
+ \NewSocketPlug{tagsupport/para/restore}{default}
+ {
+ \tl_set:Nn \l__tag_para_main_tag_tl {text-unit}
+ \tl_set_eq:NN \l__tag_para_tag_tl\l__tag_para_tag_default_tl
+ \bool_set_false:N\l__tag_para_flattened_bool
+ }
+ \AssignSocketPlug{tagsupport/para/restore}{default}
+ }
+% \end{macrocode}
+%
% \begin{macrocode}
\cs_new_protected:Npn \fnote_footnotetext:n #1 {
\@@_debug_footnotetext:
@@ -1191,6 +1206,7 @@
\floatingpenalty \@MM
\hsize\columnwidth
\@parboxrestore
+ \UseTaggingSocket{para/restore}
\parindent 1em % typical default used in \@makefntext moved up here
\def\@currentcounter{footnote}
\protected@edef \@currentlabel { \p@footnote \@thefnmark }
@@ -1673,7 +1689,7 @@
%
% \subsubsection{\pkg{memoir}}
% The \pkg{memoir} class redefines various internal commands to inject its
-% hooks and addtional code. The following reinstates the kernel command and
+% hooks and additional code. The following reinstates the kernel command and
% so probably breaks various options of \pkg{memoir}, but without the
% changes it errors anyway. The \pkg{footmisc} package should be used to change
% for example to para footnotes.
@@ -2446,7 +2462,7 @@
% This can use the default interface, except that a negative value for
% \footnotemargin makes little sense, so we test for this and warn if
-% necessary. But -\maxdimen is ok again, so would need to be a litte bit more elaborate.
+% necessary. But -\maxdimen is ok again, so would need to be a little bit more elaborate.
%
%\AddToHook{fntext/para}{
@@ -2483,7 +2499,7 @@
\leavevmode
% \end{macrocode}
% Typesetting the mark twice means that one can't have any material
-% inside that gets unhappy in that case. Tha shouldn't be a
+% inside that gets unhappy in that case. That shouldn't be a
% problem, but perhaps we have to come up with a more elaborate
% solution in the end.
% \begin{macrocode}
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-footnotes.pdf b/macros/latex-dev/required/latex-lab/latex-lab-footnotes.pdf
index 2c1ca4f76d..58309a62f5 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-footnotes.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-footnotes.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-graphic.dtx b/macros/latex-dev/required/latex-lab/latex-lab-graphic.dtx
index 5ea4a2db9c..a596366aa7 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-graphic.dtx
+++ b/macros/latex-dev/required/latex-lab/latex-lab-graphic.dtx
@@ -15,7 +15,7 @@
% https://github.com/latex3/latex2e/required/latex-lab
%
% for those people who are interested or want to report an issue.
-\def\ltlabgraphicdate{2024-03-13}
+\def\ltlabgraphicdate{2024-07-05}
\def\ltlabgraphicversion{0.80d}
%
%<*driver>
@@ -78,7 +78,7 @@
% The value of a \texttt{BBox} is an array of four numbers that gives the
% coordinates of the left, bottom, right, and top edges
% of the structure element’s bounding box. That is the rectangle that completely encloses
-% its \emph{visible} content so not necessarly the TeX bounding box:
+% its \emph{visible} content so not necessarily the TeX bounding box:
% if \texttt{viewport} or \texttt{trim} is used and the
% graphic is not clipped, the visible content can be larger.
%
@@ -146,8 +146,8 @@
% \item[\texttt{artifact}] When used the graphic will be tagged as artifact. This doesn't
% require a \texttt{BBox} and so works also in some of the not yet supported cases described
% above.
-% \item[\texttt{false}] When used tagging will be stopped completly. It is then the
-% responsability of the surrounding code to add appropriate tagging commands.
+% \item[\texttt{false}] When used tagging will be stopped completely. It is then the
+% responsibility of the surrounding code to add appropriate tagging commands.
% \item[\meta{name}] Other values will be used as tag names in the structure. If the tag is not
% known as a structure tag you will get an warning from tagpdf. The default name is currently
% \texttt{Figure}
@@ -291,7 +291,7 @@
% ,\l_@@_graphic_trim_uy_fp
% }
% A bunch of fp-variables (we don't use tl-vars,
-% to avoid to have to take care about minus signs everwhere)
+% to avoid to have to take care about minus signs everywhere)
% \begin{macrocode}
\fp_new:N\l_@@_graphic_sin_fp
\fp_new:N\l_@@_graphic_cos_fp
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-graphic.pdf b/macros/latex-dev/required/latex-lab/latex-lab-graphic.pdf
index 7cb2babc4b..359856eb77 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-graphic.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-graphic.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-marginpar.dtx b/macros/latex-dev/required/latex-lab/latex-lab-marginpar.dtx
index ca79d8a67f..a57ebaab80 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-marginpar.dtx
+++ b/macros/latex-dev/required/latex-lab/latex-lab-marginpar.dtx
@@ -18,8 +18,8 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabmarginpardate{2024-02-12}
-\def\ltlabmarginparversion{0.85b}
+\def\ltlabmarginpardate{2024-08-06}
+\def\ltlabmarginparversion{0.85c}
%<*driver>
\documentclass[kernel]{l3doc}
@@ -72,7 +72,7 @@
% They can be tagged either as artifacts (if they are merely distracting decoration),
% as small headings before the paragraph, or as |Aside|. Unlike the PDF 1.7 fallback |Note|
% the structure |Aside| is not allowed inside |P|,
-% so if |Aside| is used, it must be placed before or after the current |P| in the surounding |text-unit|,
+% so if |Aside| is used, it must be placed before or after the current |P| in the surrounding |text-unit|,
% or it must split the |P|. Splitting is probably not so good as
% |\marginpar| is often used somewhere in the middle of sentence.
% The best default is probably to use |Aside|, find the parent |text-unit| and add it there.
@@ -153,13 +153,38 @@
\socket_new:nn {tagsupport/marginpar/end}{0}
% \end{macrocode}
% \end{socketdecl}
+%
+% \begin{macro}{\@@_get_marginpar_parent:N,\@@_get_marginpar_parent_aux:nn}
+% In a paragraph we must retrieve
+% the structure number of the surrounding Part structure
+% TODO: if this is needed in more places this should
+% go into tagpdf.
+% \begin{macrocode}
+\cs_new_protected:Npn\@@_get_marginpar_parent_aux:nn #1 #2
+ {
+ \str_if_eq:eeT{\use_ii:nn #1}{Part}{\seq_put_right:Nn\l_@@_tmpa_seq {#2}}
+ }
+\cs_new_protected:Npn \@@_get_marginpar_parent:N #1
+ {
+ \seq_clear:N\l_@@_tmpa_seq
+ \seq_map_pairwise_function:NNN
+ \g_@@_struct_tag_stack_seq
+ \g_@@_struct_stack_seq
+ \@@_get_marginpar_parent_aux:nn
+ \seq_put_right:Nn\l_@@_tmpa_seq {2}
+ \seq_get_left:NN \l_@@_tmpa_seq #1
+ }
+\cs_generate_variant:Nn \tag_struct_begin:n {e}
+% \end{macrocode}
+% \end{macro}
% \begin{plugdecl}{tagsupport/marginpar/begin,tagsupport/marginpar/end}
% \begin{macrocode}
\socket_new_plug:nnn {tagsupport/marginpar/begin}{default}
{
\if_mode_horizontal:
- \tag_mc_end:
- \tag_struct_begin:n{tag=Aside,parent=\g__tag_para_main_struct_tl}%
+ \tag_mc_end:
+ \@@_get_marginpar_parent:N \l_@@_tmpa_tl
+ \tag_struct_begin:e{tag=Aside,parent=\l_@@_tmpa_tl}%
\else:
\tag_struct_begin:n{tag=Aside}%
\fi:
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-marginpar.pdf b/macros/latex-dev/required/latex-lab/latex-lab-marginpar.pdf
index a80fe64faa..ad936afd31 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-marginpar.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-marginpar.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-math.dtx b/macros/latex-dev/required/latex-lab/latex-lab-math.dtx
index 4fabde3d11..c6e07d4832 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-math.dtx
+++ b/macros/latex-dev/required/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-02-09}
-\def\ltlabmathversion{0.5i}
+\def\ltlabmathdate{2024-08-22}
+\def\ltlabmathversion{0.6c}
%
%<*driver>
\documentclass{l3doc}
@@ -247,8 +247,15 @@
% It can be suppressed by an option with
% \texttt{math/tex/AF=false}, see below.
%
-% The MathML is attached if a file |\jobname-mathml.html| is found and
-% if it contains a suitable MathML snippet for the current formula.
+% The MathML is attached if the files |\jobname-mathml.html| and/or
+% |\jobname-luamml-mathml.html| are found
+% and if they contains a suitable MathML snippet for the current formula.
+% If the files contain more than one suitable snippet (as identified by the hash)
+% the first one is used.
+% |\jobname-luamml-mathml.html| is automatically generated (see below section~\ref{sec:luamml})
+% and read after |\jobname-mathml.html|. This means that |\jobname-mathml.html| can contain
+% improved versions of a formula.
+%
% The MathML processing can be suppressed globally by emptying the list of
% mathml files with |math/mathml/sources=|. Locally for a formula |math/mathml/AF=false|
% can be used.
@@ -306,7 +313,7 @@
%
% As mentioned above the MathML-AF can be suppressed for the equations in a group with
% |math/mathml/AF=false|, or
-% completly by setting |math/mathml/sources=| in the preamble.
+% completely by setting |math/mathml/sources=| in the preamble.
%
% Files embedded in a PDF can be listed in the attachments panel of a PDF viewer.
% This is probably not so useful for lots of small files (but one could create
@@ -316,6 +323,27 @@
% |viewer/pane/mathsource=true| (anywhere in the document) and |viewer/pane/mathml=false| (in the
% preamble, before the external file is read).
%
+%
+% \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
+% 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
+% to enable browser support for all mathml constructs.
+% The file is then used in subsequent compilations and works also with
+% pdflatex.
+%
+%
% \subsection{Options}
%
%
@@ -538,6 +566,7 @@
% \begin{macrocode}
\tl_new:N \l_@@_tmpa_tl
\skip_new:N \l_@@_tmpa_skip
+\str_new:N \l_@@_tmpa_str
% \end{macrocode}
% \end{variable}
%
@@ -592,8 +621,12 @@
% \l__tag_math_mathml_AF_bool,
% \g__tag_math_mathml_AF_bool,
% \l__tag_math_mathml_pane_bool,
-% \l__tag_math_alt_bool
+% \l__tag_math_alt_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
@@ -601,6 +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
+\tl_new:N\g__tag_math_luamml_tl
+\tl_gset:Nn\g__tag_math_luamml_tl {0}
% \end{macrocode}
% \end{variable}
%
@@ -631,9 +666,11 @@
%
% \begin{variable}{\l__tag_math_mathml_files_clist}
% A sequence to store the file list for the mathml.
+% If luatex is detected with also check the luamml file.
% \begin{macrocode}
\clist_new:N\l__tag_math_mathml_files_clist
-\clist_put_right:Ne\l__tag_math_mathml_files_clist {\c_sys_jobname_str-mathml}
+\clist_put_right:Ne\l__tag_math_mathml_files_clist
+ {\c_sys_jobname_str-mathml,\c_sys_jobname_str-luamml-mathml}
% \end{macrocode}
% \end{variable}
@@ -654,15 +691,15 @@
% a simple Desc key, take care that it is a valid string!
% \begin{macrocode}
\pdfdict_put:nne {l_pdffile/Filespec} {Desc}{(mathml-#1)}
- \pdffile_embed_stream:nnN {#4}{mathml-#1.xml}\l_tmpa_tl
+ \pdffile_embed_stream:nnN {#4}{mathml-#1.xml}\l_@@_tmpa_tl
% \end{macrocode}
% not strictly necessary but makes the files visible in the file attachment
% page
% \begin{macrocode}
\bool_if:NT \l__tag_math_mathml_pane_bool
- {\pdfmanagement_add:nne {Catalog/Names}{EmbeddedFiles}{\l_tmpa_tl}}
+ {\pdfmanagement_add:nne {Catalog/Names}{EmbeddedFiles}{\l_@@_tmpa_tl}}
\tl_new:c{g_@@_mathml_#3_tl}
- \tl_gset_eq:cN{g_@@_mathml_#3_tl}\l_tmpa_tl
+ \tl_gset_eq:cN{g_@@_mathml_#3_tl}\l_@@_tmpa_tl
}
}
% \end{macrocode}
@@ -685,8 +722,268 @@
\@@_AF_mml:nnnn{#1}{#2}{#3}{#4}
}
% \end{macrocode}
+%
+% As with luatex we write two files we define a few constants for
+% the shared texts.
+%
+% \begin{macro}
+% {\c_@@_mathml_write_init_tl,\l_@@_mathml_write_before_tl,
+% \c_@@_mathml_write_after_tl,\c_@@_mathml_write_final_tl}
+% \begin{macrocode}
+\tl_const:Nn \c_@@_mathml_write_init_tl
+ {
+ <!DOCTYPE~html>
+ \iow_newline:
+ <html>
+ \iow_newline:
+ }
+\tl_new:N \l_@@_mathml_write_before_tl
+\tl_const:Nn \c_@@_mathml_write_after_tl
+ {
+ \iow_newline:
+ </div>
+ \iow_newline:
+ }
+\tl_const:Nn \c_@@_mathml_write_final_tl
+ {
+ </html>
+ }
+% \end{macrocode}
+% \end{macro}
+% \begin{socketdecl}{tagsupport/math/mathml/write/prepare}
+% To prepare the hash and the starting command we use a socket, so
+% that both the dummy and luamml can make use of it.
+% \begin{macrocode}
+\socket_new:nn {tagsupport/math/mathml/write/prepare}{0}
+% \end{macrocode}
+% \end{socketdecl}
+%
+% \begin{plugdecl}{On}
+% \begin{macrocode}
+\socket_new_plug:nnn{tagsupport/math/mathml/write/prepare}{On}
+ {
+ \str_set:NV\l_@@_tmpa_str\l_@@_content_AF_source_tl
+ \str_replace_all:Nnn\l_@@_tmpa_str{&}{&amp;}
+ \str_replace_all:Nnn\l_@@_tmpa_str{<}{&lt;}
+ \tl_set:Nn \l_@@_mathml_write_before_tl
+ {
+ <div>
+ \iow_newline:
+ <h2>\c_backslash_str mml\c_space_tl \int_use:N \g_@@_math_total_int </h2>
+ \iow_newline:
+ <p>\l_@@_tmpa_str</p>
+ \iow_newline:
+ <p>\l_@@_content_hash_tl </p>
+ \iow_newline:
+ }
+ }
+% \end{macrocode}
+% \end{plugdecl}
+%
+% With luatex we automatically generate mathml with luamml if the package
+% can be loaded and unicode-math is detected.
+% We start the process in the begindocument/end hook
+% so that the reading from a previous compilation can happen before!
+% \begin{macrocode}
+\sys_if_engine_luatex:T
+ {
+ \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}
+ {
+ \str_case:on \g__tag_math_luamml_tl
+ {
+ { 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}}\\
+ or~force~luamml~with~\\
+ \tl_to_str:n{\tagpdfsetup{math/mathml/luamml=true}}
+ }
+\cs_new_protected:Npn \@@_luamml_activate_write:
+ {
+% \end{macrocode}
+% to avoid that nothing is written in the first run, we must activate the sockets:
+% \begin{macrocode}
+ \bool_gset_true:N\g__tag_math_mathml_AF_bool
+ \AssignSocketPlug{tagsupport/math/struct/begin}{test-mathml}
+ \AssignSocketPlug{tagsupport/math/struct/end}{test-mathml}
+ \AssignSocketPlug{tagsupport/math/substruct/begin}{single}
+ \AssignSocketPlug{tagsupport/math/substruct/end}{single}
+ \int_set:Nn \l__luamml_pretty_int { 5 }
+ \RegisterFamilyMapping\symsymbols{oms}
+ \RegisterFamilyMapping\symletters{oml}
+ \AssignSocketPlug{tagsupport/math/mathml/write/prepare}{On}
+ \iow_new:N \g_@@_luamml_iow
+ \iow_open:Nn \g_@@_luamml_iow {\c_sys_jobname_str-luamml-mathml.html}
+ \iow_now:Ne \g_@@_luamml_iow { \c_@@_mathml_write_init_tl }
+ \cs_new:Npn \@@_luamml_output_hook:n ##1
+ {
+ \tl_if_empty:NF \l_@@_mathml_write_before_tl
+ {
+ \iow_now:Ne \g_@@_luamml_iow
+ {
+ \l_@@_mathml_write_before_tl
+ ##1
+ \c_@@_mathml_write_after_tl
+ }
+ }
+ }
+ \__luamml_register_output_hook:N \@@_luamml_output_hook:n
+% \end{macrocode}
+% this starts the process and set flag to 3,
+% not really needed, as it is the default but set here for clarity:
+% \begin{macrocode}
+ \luamml_flag_process:
+% \end{macrocode}
+% At the end of the document we must finish and close the file:
+% \begin{macrocode}
+ \AddToHook{enddocument/afterlastpage}
+ {
+ \iow_now:Ne \g_@@_luamml_iow
+ { \c_@@_mathml_write_final_tl }
+ \iow_close:N \g_@@_luamml_iow
+ }
+ }
+% \end{macrocode}
+% And now a key to deactivate luamml
+% \begin{macrocode}
+
+\keys_define:nn { __tag / setup }
+ {
+ 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}
% \begin{socketdecl}{tagsupport/math/mathml/write}
% This writes a html-dummy with the hash and the math content.
% This should be optional, so it uses a socket that can be disabled
@@ -700,24 +997,11 @@
% \begin{macrocode}
\socket_new_plug:nnn{tagsupport/math/mathml/write}{On}
{
- \str_set:NV\l_@@_tmpa_str\l_@@_content_AF_source_tl
- \str_replace_all:Nnn\l_@@_tmpa_str{&}{&amp;}
- \str_replace_all:Nnn\l_@@_tmpa_str{<}{&lt;}
\iow_now:Ne \g_@@_writedummy_iow
{
- \iow_newline:
- <div>
- \iow_newline:
- <h2>\c_backslash_str mml\c_space_tl \int_use:N \g_@@_math_total_int </h2>
- \iow_newline:
- <p>\l_@@_tmpa_str</p>
- \iow_newline:
- <p>\l_@@_content_hash_tl </p>
- \iow_newline:
+ \l_@@_mathml_write_before_tl
<math></math>
- \iow_newline:
- </div>
- \iow_newline:
+ \c_@@_mathml_write_after_tl
}
}
% \end{macrocode}
@@ -739,14 +1023,14 @@
}
\iow_now:Ne \g_@@_writedummy_iow
{
- <!DOCTYPE~html>
- \iow_newline:
- <html>
+ \c_@@_mathml_write_init_tl
}
+ \AssignSocketPlug {tagsupport/math/mathml/write/prepare}{On}
\AssignSocketPlug {tagsupport/math/mathml/write}{On}
\AddToHook{enddocument/afterlastpage}
{
- \iow_now:Nn \g_@@_writedummy_iow {</html>}
+ \iow_now:Ne \g_@@_writedummy_iow
+ { \c_@@_mathml_write_final_tl }
\iow_close:N \g_@@_writedummy_iow
}
}
@@ -900,7 +1184,7 @@
% \end{macrocode}
% \end{plugdecl}
%
-% We probably will want to test different tagging receipes.
+% We probably will want to test different tagging recipes.
% \begin{plugdecl}{default}
% \begin{macrocode}
\socket_new_plug:nnn
@@ -1184,6 +1468,7 @@
{
\typeout{WARNING:~mathml~missing~for~hash~\l_@@_content_hash_tl}
}
+ \socket_use:n {tagsupport/math/mathml/write/prepare}
\socket_use:n {tagsupport/math/mathml/write} % write hash if request
\bool_if:NTF\l__tag_math_texsource_AF_bool
{ \tl_set_eq:NN \l_@@_content_AF_source_tmpa_tl \l_@@_content_AF_source_tl }
@@ -1349,47 +1634,60 @@
% \subsection{Content grabbing}
%
% \begin{macro}{\@@_grab_dollar:w}
-% Grab up to a single |$|, for inline math mode, suppressing
-% any processing if the token is \tn{m@th} found in the content.
-%
-% \fmi{what's that test doing?}
-%
-% \car{It is some kind of fix, to avoid the remote
-% possibility that the math is empty, making the code
-% produce an unwanted \texttt{\$\$}.}
-%
-%\car{cf.~the code for this in \cs{@ensuredmath}}
-%
-%\car{It is harmless but unnecessary in the dollardollar grabbing below.}
-%
+% \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
+% work anywhere that the end |$| token may be hidden, most obviously in
+% tabulars. The function here is therefore set up as a variable starting
+% point.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_dollar:w { \@@_grab_dollar_delim:w }
+% \end{macrocode}
+% After grabbing inline math material, there is again common processing
+% independent of mechanism of collection.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_grab_dollar:w % $
- #1 $
+\cs_new_protected:Npn \@@_grab_dollar:n #1
{
% \end{macrocode}
-% \fmi{what's that test doing?}
+% 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
{
- \socket_use:n {tagsupport/math/inline/begin} %end P-MC
- \socket_use:nn{tagsupport/math/inline/formula/begin}{#1}
- $
- \socket_use:n {tagsupport/math/inline/formula/end}
- \socket_use:n {tagsupport/math/inline/end} % restart P-MC
- }
- }
+ {\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}
+% \end{macro}
+%
+% \begin{macro}{\@@_grab_dollar_delim:w}
+% Grab up to a single |$|, for inline math mode, suppressing
+% any processing if the token is \tn{m@th} found in the content.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_dollar_delim:w #1 $ % $
+ { \@@_grab_dollar:n {#1} }
+% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\@@_grab_dollardollar:w}
% And for the classical \TeX{} display structure.
@@ -1402,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}
%
@@ -1462,6 +1760,170 @@
% \end{macrocode}
% \end{macro}
%
+% \subsection{Token-by-token inline grabbing}
+%
+% Grabbing inline math token-by-token is more involved. The mechanism here
+% is essentially a simplified version of that originally seen in
+% \pkg{collcell} and refined in \pkg{siunitx}. We make use of the fact that
+% in math mode spaces are ignored, so we have to deal with only \texttt{N}-type
+% tokens and groups. Furthermore, there is no need to look inside groups, so
+% the only special cases are a small selection of \texttt{N}-type tokens.
+%
+% \begin{variable}{\l_@@_grabbed_tl}
+% For collection of the material piecewise.
+% \begin{macrocode}
+\tl_new:N \l_@@_grabbed_tl
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_grab_env_int}
+% Needed to count up the number of nested environments encountered.
+% \begin{macrocode}
+\int_new:N \l_@@_grab_env_int
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\@@_grab_dollar_loop:}
+% \begin{macro}{\@@_grab_loop:}
+% The lead-off here establishes a group: we need that as we will have to
+% be careful in the way \tn{cr} is handled and ensure this is only
+% manipulated whilst grabbing. The main loop is then started.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_dollar_loop:
+ {
+ \group_begin:
+ \tl_clear:N \l_@@_grabbed_tl
+ \@@_grab_loop:
+ }
+\cs_new_protected:Npn \@@_grab_loop:
+ {
+ \peek_remove_spaces:n
+ {
+ \peek_meaning:NTF \c_group_begin_token
+ { \@@_grab_loop_group:n }
+ { \@@_grab_loop_token:N }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_grab_loop_group:n}
+% \begin{macro}{\@@_grab_loop_store:n}
+% Handling of grabbed groups is pretty easy.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_loop_group:n #1
+ { \@@_grab_loop_store:n { {#1} } }
+\cs_new_protected:Npn \@@_grab_loop_store:n #1
+ {
+ \tl_put_right:Nn \l_@@_grabbed_tl {#1}
+ \@@_grab_loop:
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_grab_loop_token:N}
+% \begin{macro}
+% {
+% \@@_grab_loop_$: ,
+% \@@_grab_loop_\\: ,
+% \@@_grab_loop_\begin: ,
+% \@@_grab_loop_\begin : ,
+% \@@_grab_loop_\end: ,
+% \@@_grab_loop_\ignorespaces: ,
+% \@@_grab_loop_\unskip: ,
+% \@@_grab_loop_\textonly@unskip:
+% }
+% Filter out the special cases: for performance reasons, use a hash table
+% approach rather than a loop (\emph{cf.}~\pkg{collcell}). The need to cover
+% \verb*|begin | is that at the start of a cell, \TeX{} will expand \cs{begin}
+% but the \LaTeX{} robust mechanism will mean this yields \verb*|begin |.
+% If\cs{begin} were protected, that would not be needed.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_loop_token:N #1
+ {
+ \cs_if_exist_use:cF
+ { @@_grab_loop_ \token_to_str:N #1 : }
+ { \@@_grab_loop_store:n {#1} }
+ }
+\cs_new_protected:cpn { @@_grab_loop_ \token_to_str:N $ : }
+ { \@@_grab_loop_end: }
+\cs_new_protected:cpn { @@_grab_loop_ \token_to_str:N \\ : }
+ {
+ \int_compare:nNnTF \l_@@_grab_env_int = 0
+ { \@@_grab_loop_newline: }
+ { \@@_grab_loop_store:n { \\ } }
+ }
+% \end{macrocode}
+% In contrast to \pkg{collcell}, nesting is tracked by counting
+% \cs{begin}/\cs{end} pairs: this is needed in case there is a tabular-like
+% construct containing |\\| inside a cell. As a result, the end-of-tabular
+% can be detected without checking the name argument: if \cs{end} is
+% encountered at nesting level~0, we've hit the end of a cell. In that case,
+% end the row and leave the environment to clean up.
+% \begin{macrocode}
+\cs_new_protected:cpn { @@_grab_loop_ \token_to_str:N \begin : }
+ {
+ \int_incr:N \l_@@_grab_env_int
+ \@@_grab_loop_store:n { \begin }
+ }
+\cs_new_eq:cc { @@_grab_loop_ \token_to_str:N \begin \c_space_tl : }
+ { @@_grab_loop_ \token_to_str:N \begin : }
+\cs_new_protected:cpn { @@_grab_loop_ \token_to_str:N \end : }
+ {
+ \int_compare:nNnTF \l_@@_grab_env_int = 0
+ {
+ \@@_grab_loop_newline:
+ \end
+ }
+ {
+ \int_decr:N \l_@@_grab_env_int
+ \@@_grab_loop_store:n { \end }
+ }
+ }
+\tl_map_inline:nn { \ignorespaces \unskip \textonly@unskip }
+ {
+ \cs_new_protected:cpn { @@_grab_loop_ \token_to_str:N #1 : }
+ { \@@_grab_loop: }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@_grab_loop_newline:}
+% To allow collection of tokens in the part of the \tn{halign} template after
+% |#|, we need \TeX{} to see the primitive with the loop token in the right
+% place. That is done by re-defining \tn{cr} at present. Ideally there would
+% be a socket in the definition of \texttt{tabular}, etc., to handle this:
+% there is also the need to examine in interaction with \pkg{longtable}, which
+% also redefines \tn{cr}.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_loop_newline:
+ {
+ \if_false: { \fi:
+ \cs_set_protected:Npn \cr
+ {
+ \@@_grab_loop:
+ \tex_cr:D
+ }
+ \if_false: } \fi:
+ \\
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_grab_loop_end:}
+% Clean up and pass on.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_grab_loop_end:
+ {
+ \exp_args:NNV \group_end:
+ \@@_grab_dollar:n \l_@@_grabbed_tl
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Marking math environments}
%
% A general mechanism for math mode environments that do not grab their
@@ -1860,6 +2322,10 @@
\bool_set_false:N \l_@@_collected_bool
\col@sep\tabcolsep \let\d@llarbegin\begingroup
\let\d@llarend\endgroup
+% \end{macrocode}
+% A proper switching mechanism is needed: for the present, do directly.
+% \begin{macrocode}
+ \cs_set_protected:Npn \@@_grab_dollar:w { \@@_grab_dollar_loop: }
\@tabarray}
}
% \end{macrocode}
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-math.pdf b/macros/latex-dev/required/latex-lab/latex-lab-math.pdf
index f9b74b0553..63bbe46ed7 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-math.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-math.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-mathpkg.pdf b/macros/latex-dev/required/latex-lab/latex-lab-mathpkg.pdf
index fb9a09adc9..9b4e0ef1b9 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-mathpkg.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-mathpkg.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-mathtools.dtx b/macros/latex-dev/required/latex-lab/latex-lab-mathtools.dtx
index aa27cbf01d..79eee7aab7 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-mathtools.dtx
+++ b/macros/latex-dev/required/latex-lab/latex-lab-mathtools.dtx
@@ -23,7 +23,7 @@
\EnableCrossrefs
\CodelineIndex
\begin{document}
- \DocInput{latex-lab-amsmath.dtx}
+ \DocInput{latex-lab-mathtools.dtx}
\end{document}
%</driver>
%
@@ -66,7 +66,7 @@
% \subsection{File declaration}
% \begin{macrocode}
\ProvidesFile{latex-lab-mathtools.ltx}
- [2023-01-05 v0.1a mathtools adaptions]
+ [2024-07-13 v0.1a mathtools adaptions]
% \end{macrocode}
% \subsection{Tagpdf support}
% To make the code independent from tagging being loaded and active
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-mathtools.pdf b/macros/latex-dev/required/latex-lab/latex-lab-mathtools.pdf
index 0f6d85c344..7678082ac2 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-mathtools.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-mathtools.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-minipage.dtx b/macros/latex-dev/required/latex-lab/latex-lab-minipage.dtx
index ffbe5357e7..f5a324fa5e 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-minipage.dtx
+++ b/macros/latex-dev/required/latex-lab/latex-lab-minipage.dtx
@@ -18,8 +18,8 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabminipagedate{2023-10-30}
-\def\ltlabminipageversion{0.81c}
+\def\ltlabminipagedate{2024-08-08}
+\def\ltlabminipageversion{0.81d}
%<*driver>
\documentclass{l3doc}
\EnableCrossrefs
@@ -120,12 +120,18 @@
% \end{macrocode}
% insert the socket
% \begin{macrocode}
- \socket_use:n{tagsupport/minipage/before}% new
+ \UseTaggingSocket{minipage/before}% new
\setbox\@tempboxa\vbox\bgroup
\color@begingroup
\hsize\@tempdima
\textwidth\hsize \columnwidth\hsize
\@parboxrestore
+% \end{macrocode}
+% minipages are perhaps used in environments where the tagging of paragraphs
+% has been altered. So we try to restore this. TODO: this should
+% perhaps be done in \cs{@parboxrestore} directly.
+% \begin{macrocode}
+ \UseTaggingSocket{para/restore}
\def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
\socket_assign_plug:nn{fntext/process}{mp}%
\let\@listdepth\@mplistdepth \@mplistdepth\z@
@@ -153,7 +159,7 @@
\tag_stop:n{minipage}
\expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}%
\tag_start:n{minipage}
- \socket_use:n{tagsupport/minipage/after} %new end ...
+ \UseTaggingSocket{minipage/after} %new end ...
}
% \end{macrocode}
%
@@ -164,8 +170,15 @@
\leavevmode
\@pboxswfalse
\setlength\@tempdima{#4}%
- \socket_use:n{tagsupport/parbox/before}
- \@begin@tempboxa\vbox{\hsize\@tempdima\@parboxrestore#5\@@par}%
+ \UseTaggingSocket{parbox/before}
+ \@begin@tempboxa\vbox{\hsize\@tempdima\@parboxrestore
+% \end{macrocode}
+% parbox are perhaps used in environments where the tagging of paragraphs
+% has been altered. So we try to restore this. TODO: this should
+% perhaps be done in \cs{@parboxrestore} directly.
+% \begin{macrocode}
+ \UseTaggingSocket{para/restore}
+ #5\@@par}%
\ifx\relax#2\else
\setlength\@tempdimb{#2}%
\edef\@parboxto{to\the\@tempdimb}%
@@ -179,7 +192,7 @@
\csname bm@#3\endcsname}%
\if@pboxsw \m@th$\fi
\@end@tempboxa%
- \socket_use:n{tagsupport/parbox/after}
+ \UseTaggingSocket{parbox/after}
}
% \end{macrocode}
%
@@ -191,9 +204,11 @@
\socket_new_plug:nnn{tagsupport/minipage/before}{tag/dflt}
{
% \end{macrocode}
-% As there was a \cs{leavevmode} before that is a P/text open that we have to close.
+% As there was a \cs{leavevmode} before that is a P/text open that we have to close
+% if para tagging is active:
% \begin{macrocode}
- \tag_mc_end_push:\tag_struct_end:
+ \tag_mc_end_push:
+ \bool_if:NT \l__tag_para_bool {\tag_struct_end:}
% \end{macrocode}
% TODO: the P can be further up, we need a proper method to test and handle this.
% \begin{macrocode}
@@ -203,13 +218,25 @@
% similar for the other sockets:
% \begin{macrocode}
\socket_new_plug:nnn{tagsupport/minipage/after}{tag/dflt}
- {\tag_struct_end:\tag_struct_begin:n{tag=\l__tag_para_tag_tl}\tag_mc_begin_pop:n{}}
+ {
+ \tag_struct_end:
+ \bool_if:NT \l__tag_para_bool {\tag_struct_begin:n{tag=\l__tag_para_tag_tl}}
+ \tag_mc_begin_pop:n{}
+ }
\socket_new_plug:nnn{tagsupport/parbox/before}{tag/dflt}
- {\tag_mc_end_push:\tag_struct_end:\tag_struct_begin:n{tag=\l__ltboxes_tag_tl}}
+ {
+ \tag_mc_end_push:
+ \bool_if:NT \l__tag_para_bool {\tag_struct_end:}
+ \tag_struct_begin:n{tag=\l__ltboxes_tag_tl}
+ }
\socket_new_plug:nnn{tagsupport/parbox/after}{tag/dflt}
- {\tag_struct_end:\tag_struct_begin:n{tag=\l__tag_para_tag_tl}\tag_mc_begin_pop:n{}}
+ {
+ \tag_struct_end:
+ \bool_if:NT \l__tag_para_bool {\tag_struct_begin:n{tag=\l__tag_para_tag_tl}}
+ \tag_mc_begin_pop:n{}
+ }
% \end{macrocode}
% Activate the default tagging plug
% \begin{macrocode}
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-minipage.pdf b/macros/latex-dev/required/latex-lab/latex-lab-minipage.pdf
index eda0551b7a..6d68904c29 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-minipage.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-minipage.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-namespace.dtx b/macros/latex-dev/required/latex-lab/latex-lab-namespace.dtx
index a6087abe57..d76dd8d489 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-namespace.dtx
+++ b/macros/latex-dev/required/latex-lab/latex-lab-namespace.dtx
@@ -26,7 +26,7 @@
% \fi
% \title{Prototype reimplementation of \LaTeXe{}'s role mapping}
% \author{\LaTeX{} Project, initial implementation Ulrike Fischer}
-% \date{v0.8 2023-09-04}
+% \date{v0.8b 2024-07-05}
%
% \maketitle
%
@@ -37,7 +37,7 @@
% \section{Introduction}
%
% This short file collects tag names from the \LaTeX{} namespace and their role mapping used
-% in the latex-lab files. The names and the roles are not necessarly the final ones!
+% in the latex-lab files. The names and the roles are not necessarily the final ones!
%
% Later settings of the same tag overwrite previous settings.
% The syntax of a line is a list of three strings ending with commas:
@@ -62,18 +62,33 @@
% \begin{macrocode}
title, Title, pdf2,
part, Title, pdf2,
+% \end{macrocode}
+% Headings differ in article and book class. This here is for article:
+% \begin{macrocode}
section, H1, pdf2,
subsection, H2, pdf2,
subsubsection,H3, pdf2,
paragraph, H4, pdf2,
subparagraph, H5, pdf2,
+% \end{macrocode}
+% And this here is used in book:
+% \begin{macrocode}
+%chapter, H1, pdf2,
+%section, H2, pdf2,
+%subsection, H3, pdf2,
+%subsubsection, H4, pdf2,
+%paragraph, H5, pdf2,
+%subparagraph, H6, pdf2,
+% \end{macrocode}
+%
+% \begin{macrocode}
list, L, pdf2,
itemize, L, pdf2,
enumerate, L, pdf2,
description, L, pdf2,
quote, BlockQuote,pdf,
quotation, BlockQuote,pdf,
-verbatim, Div, pdf2,
+verbatim, Div, pdf2, % overwritten by block
item, LI, pdf2,
itemlabel, Lbl, pdf2,
itembody, LBody, pdf2,
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-namespace.pdf b/macros/latex-dev/required/latex-lab/latex-lab-namespace.pdf
index 113688d669..3363ce1918 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-namespace.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-namespace.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-new-or-1.pdf b/macros/latex-dev/required/latex-lab/latex-lab-new-or-1.pdf
index c2cd53f8e5..4a808d7f1b 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-new-or-1.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-new-or-1.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-new-or-2.pdf b/macros/latex-dev/required/latex-lab/latex-lab-new-or-2.pdf
index b0c53e859b..8618ee7deb 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-new-or-2.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-new-or-2.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-sec.dtx b/macros/latex-dev/required/latex-lab/latex-lab-sec.dtx
index f3786c2ddb..231ed1a864 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-sec.dtx
+++ b/macros/latex-dev/required/latex-lab/latex-lab-sec.dtx
@@ -16,7 +16,7 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabsecdate{2024-02-12}
+\def\ltlabsecdate{2024-07-05}
\def\ltlabsecversion{0.84c}
%<*driver>
\documentclass[kernel]{l3doc}
@@ -121,7 +121,7 @@
% commands must be at the right grouping level.
% \end{itemize}
%
-% \subsection{Funktions and keys}
+% \subsection{Functions and keys}
%
% \begin{function}{\tag_tool:n,\tagtool}
%
@@ -138,7 +138,7 @@
% to allow e.g. to put an epigraph or similar in front.
%
% \item The number in \cs{part} and \cs{chapter} is currently not correctly
-% tagged as a \texttt{Lbl} as this requires to redefine the internal (class dependant)
+% tagged as a \texttt{Lbl} as this requires to redefine the internal (class dependent)
% commands too.
%
% \end{itemize}
@@ -376,7 +376,7 @@
\tag_struct_begin:n{tag=part,title=#1}
% \end{macrocode}
% We remap here the text-unit from the paragraph to NonStruct.
-% It would be better to suppress it completly as with the other
+% It would be better to suppress it completely as with the other
% sectioning commands, but this would require to redefine \cs{@spart}
% and \cs{@part}, as there is the grouping, and these commands are
% all slightly different in the standard classes. So this is delayed
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-sec.pdf b/macros/latex-dev/required/latex-lab/latex-lab-sec.pdf
index cdf61e2b1e..c62c8dbeb1 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-sec.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-sec.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-table.dtx b/macros/latex-dev/required/latex-lab/latex-lab-table.dtx
index 5352df9550..be0c05a4e1 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-table.dtx
+++ b/macros/latex-dev/required/latex-lab/latex-lab-table.dtx
@@ -16,8 +16,8 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabtbldate{2024-02-07}
-\def\ltlabtblversion{0.85k}
+\def\ltlabtbldate{2024-08-10}
+\def\ltlabtblversion{0.85m}
%<*driver>
\documentclass{l3doc}
\EnableCrossrefs
@@ -100,6 +100,7 @@
% support for the tagging of tables. A list of the known limitations
% is shown below.
%
+% \subsection{Loading}
% The module is not loaded automatically (i.e., not yet integrated
% into any \texttt{phase-XX}) and by itself it doesn't activate
% tagging. For experimenting with table tagging it is therefore best
@@ -113,7 +114,26 @@
% It will then automatically tag all table environments it already supports with
% the exception of tables in the header and footer of the page (where tagging is disabled).
% Such tables can be nested.
+%
+% Inside cells the automatic tagging of paragraphs is disabled with the exception of
+% p/m/b-type cells.
%
+% Rows do not need to contain a full number of \&, missing cells are automatically
+% added with an empty TD-structure.
+%
+% You should not insert meaningful text with \verb+!{...}+ or \verb+@{...}+ or \cs{noalign}
+% between the rows or columns of the table.
+% With pdflatex such text will be unmarked, with lualatex it will be marked as artifact.
+% Either case means that it will be currently ignored in the
+% structure.\footnote{While it is theoretically possible
+% to collect such text and move it into a structure it would require manual markup
+% from the author to clarify where this text belongs too.}
+%
+% As mentioned below the \pkg{colortbl} doesn't work fully with the tagging,
+% but when it does, colors inside the table are currently ignored. If such a color
+% has a semantic meaning (like \enquote{important value}) this meaning will be lost.
+%
+% \subsection{Untagged and presentation tables}
% If a table should not be tagged as table, for example because it is merely used
% as a layout to ensure that the content is properly aligned
% or because it is a not yet (fully) supported table structure,
@@ -121,47 +141,52 @@
% \verb|\tagpdfsetup{table/tagging=false}| or with \verb|\tagpdfsetup{table/tagging=presentation}|%
% \footnote{The key has been renamed. The old name `table-tagging` still works but is
% deprecated. The value \texttt{presentation} refers to the ARIA role \enquote{presentation}.}
-% The first option disables the table tagging code and he content of the tabular
+% The first option disables the table tagging code and the content of the tabular
% is then treated more or less like running text. This works ok for simple tables using
% only hmode-cells (l/c/r) with normal text content, but fails if the table uses vmode-cells
% (p/m/b). In such cases the second option works better: it keeps the tagging code active
-% but changes the tag names to \texttt{Div} and the grouping structure \texttt{NonStruct}.
-%
-% Inside cells the automatic tagging of paragraphs is disabled with the exception of
-% p/m/b-type cells.
-%
-% Rows do not need to contain a full number of \&, missing cells are automatically
-% added with an empty TD-structure.
+% but changes the tag names to \texttt{Div} and the grouping structure \texttt{NonStruct}. It also
+% (re)sets the \texttt{table/header-rows} key to empty.
+% The key should currently only be used in a group as there is no key (yet) to reset to the default
+% tag names.
%
+% \subsection{Header rows and columns}
% There is some basic support\footnote{This is not meant to be the
% final interface, though.} for headers. With\footnote{The old key name \texttt{table-header-rows} still
% works but is deprecated.}
% \begin{quote}
% \verb|\tagpdfsetup{table/header-rows={|\meta{list of row numbers}\verb|}|
+% \verb|\tagpdfsetup{table/header-columns={|\meta{list of column numbers}\verb|}|
% \end{quote}
% you can
-% declare which (absolute) row numbers should be tagged as header rows.
-% It applies to all tables until it is changed to a different list of row numbers or undone by setting
-% the key to \meta{empty}.
-% A row number can be
-% negative, then the counting starts from the end of the table. There is no support
-% for header columns yet. In a \env{longtable} the code will currently use the \cs{endhead} or
+% declare which (absolute) row and column numbers should be tagged as header rows and header columns.
+% It applies to all tables until it is changed to a different list of row or
+% columns numbers or undone by setting
+% the keys to \meta{empty}.
+% A row or column number can be
+% negative, then the counting starts from the end of the table.
+% In a \env{longtable} the code will currently use the \cs{endhead} or
% \cs{endfirsthead} rows as header if one of these commands has been
% used and in that case the code
% ignores a \texttt{table/header-rows} setting.
%
-% You should not insert meaningful text with \verb+!{...}+ or \verb+@{...}+ or \cs{noalign}
-% between the rows or columns of the table.
-% With pdflatex such text will be unmarked, with lualatex it will be marked as artifact.
-% Either case means that it will be currently ignored in the
-% structure.\footnote{While it is theoretically possible
-% to collect such text and move it into a structure it would require manual markup
-% from the author to clarify where this text belongs too.}
+% \subsection{Spanning of cells}
%
-% As mentioned below the \pkg{colortbl} doesn't yet work properly with the tagging,
-% but once it does, then colors inside the table will probably be
-% simply ignored (at least initially). If such a color
-% has a semantic meaning (like \enquote{important value}) this meaning will be lost.
+% \cs{multicolumn} is supported out of the box and will create a structure with a
+% suitable \texttt{ColSpan} attribute\footnote{The code uses actually an attribute \emph{class}.
+% The validator PAC doesn't handle this correctly currently and complains about a missing attribute.}
+%
+% For cells spanning rows some preliminary support exists\footnote{The interface is bound to change!}:
+% If you add
+% \begin{quote}
+% \verb|\tagpdfsetup{table/multirow={|\meta{number of rows}\verb|}|
+% \end{quote}
+% to a cell the code will add the suitable \texttt{RowSpan} attribute and suppress the tagging of affected
+% cells in the following rows. This will also work if the current cell is a \cs{multicolumn}, then
+% the cell will span both rows and columns. It is the duty of the author to
+% ensure that all cells below and covered by a \texttt{RowSpan} are empty!
+% The code neither checks that nor does
+% it tries to suppress content.
%
% Feedback and problems with the code can be reported at
% \url{https://github.com/latex3/tagging-project} either in form of
@@ -180,19 +205,19 @@
% \item the \env{array} environment is assumed to be part of math and tagging as a table is disabled for
% it.
%
-% \item Row spans are not yet supported (and the \pkg{multirow} package is untested).
+% \item Row spans can only be added manually (the \pkg{multirow} package is untested).
%
-% \item The \pkg{colortbl} package breaks tagging if there are nested tables. It also breaks
-% the filling up of incomplete rows.
+% \item The \pkg{colortbl} package breaks tagging if there are nested tables.
%
% \item The \pkg{tabularray} package use a completed different
% method to create tables and will not be supported by this code.
%
% \item The \pkg{nicematrix} package is currently incompatible.
%
-% \item Most other packages related to tables in \LaTeX{} are not yet tested,
+% \item Most other packages related to tables in \LaTeX{} are not fully tested,
% that includes packages that change rules like \pkg{booktabs}, \pkg{hhline},
-% \pkg{arydshln}, \pkg{hvdashln}.
+% \pkg{arydshln}, \pkg{hvdashln}. Some problems have been resolved, either
+% in the packages or through a firstaid which can be loaded the \verb+testphase=firstaid+.
%
% \item \env{longtable} currently only works with lualatex.
% With other engines it breaks as its output
@@ -205,9 +230,9 @@
% the tagging of the table must be deactivated with \verb|\tagpdfsetup{table/tagging=false}|
% or \verb|\tagpdfsetup{table/tagging=presentation}|.
%
-% \item Only simple header rows are currently supported. Columns and complex headers with
+% \item Only simple header rows and columns are currently supported. Complex headers with
% subheaders will be handled later as that needs some syntax changes. Tables
-% with more than one header row are probably not pdf/UA as the headers array in
+% with more than one header row or column are probably not pdf/UA as the headers array in
% the cells is missing.
%
% \item A \pkg{longtable} \cs{caption} is currently simply formatted as a multicolumn and
@@ -256,9 +281,6 @@
%
% \item Longtable captions should be properly supported.
%
-% \item Handle p-cells better. para-tagging should probably be enabled,
-% but Part can't be a child of TD, so this should probably be changed to Div here.
-% Also there is a stray MC somewhere.
%
% \item More packages must be tested.
% \end{itemize}
@@ -289,8 +311,8 @@
% ,\l_@@_cellattribute_tl
% ,\l_@@_rowattribute_tl
% ,\l_@@_tmpa_clist
-% ,\l_@@_tmpa_seq
% ,\l_@@_tmpa_tl
+% ,\l_@@_tmpa_str
% }
% This is for the celltag, e.g. TD or TH:
% \begin{macrocode}
@@ -316,10 +338,16 @@
\tl_new:N \l_@@_rowattribute_tl
\tl_set:Nn \l_@@_rowattribute_tl {}
% \end{macrocode}
+% Variable to store cell info like which cell must be skipped when tagging multirows.
+% \begin{macrocode}
+\prop_new:N\g_@@_untagged_cells_prop
+\prop_new:N\l_@@_saved_untagged_cells_prop
+% \end{macrocode}
% Temp variables
% \begin{macrocode}
\clist_new:N \l_@@_tmpa_clist
\tl_new:N \l_@@_tmpa_tl
+\str_new:N \l_@@_tmpa_str
% \end{macrocode}
% \end{macro}
%
@@ -327,7 +355,41 @@
%
%
% This are the standard plugs for tagging of cells and rows.
-%
+%
+% The following two sockets are defined in lttagging, but we check
+% for their existence until the release 11/2024.
+% \begin{macrocode}
+\str_if_exist:cF { l__socket_tagsupport/tbl/init/celldata_plug_str }
+ {
+ \NewSocket{tagsupport/tbl/init/celldata}{0}
+ \NewSocket{tagsupport/tbl/restore/celldata}{0}
+ }
+% \end{macrocode}
+% \begin{plugdecl}{default}
+% This socket is used inside \cs{tbl_init_cell_data_for_table} for the
+% case that this a nested table in a cell.
+% \begin{macrocode}
+\NewSocketPlug{tagsupport/tbl/init/celldata}{default}
+ {
+ \prop_set_eq:NN\l_@@_saved_untagged_cells_prop \g_@@_untagged_cells_prop
+ \prop_gclear:N \g_@@_untagged_cells_prop
+ }
+\AssignSocketPlug{tagsupport/tbl/init/celldata}{default}
+% \end{macrocode}
+% \end{plugdecl}
+
+% \begin{plugdecl}{default}
+% This socket is used inside \cs{tbl_restore_outer_cell_data:} and restores
+% values when a nested table is ended.
+% \begin{macrocode}
+\NewSocketPlug{tagsupport/tbl/restore/celldata}{default}
+ {
+ \prop_gset_eq:NN\g_@@_untagged_cells_prop \l_@@_saved_untagged_cells_prop
+ }
+\AssignSocketPlug{tagsupport/tbl/restore/celldata}{default}
+% \end{macrocode}
+% \end{plugdecl}
+%
% \begin{plugdecl}{TD}
% \begin{macrocode}
\NewSocketPlug{tagsupport/tbl/cell/begin}{TD}
@@ -337,21 +399,44 @@
% always even if the noop plug is in force this needs a different solution.
% \begin{macrocode}
\@@_show_curr_cell_data:
- \tag_struct_begin:n
+% \end{macrocode}
+% We test if the cell should be tagged at all.
+% \begin{macrocode}
+ \@@_if_tag_cell:nnT {\g_@@_row_int } { \g_@@_col_int }
{
- tag =\l_@@_celltag_tl,
- attribute-class =\l_@@_cellattribute_tl
- }
- \seq_gput_right:Ne \g_@@_struct_cur_seq { \tag_get:n {struct_num} }
+% \end{macrocode}
+% this sets row headers
+% \begin{macrocode}
+ \clist_if_in:NVT \l_@@_header_columns_clist\g_@@_col_int
+ {
+ \tl_set:Nn \l_@@_celltag_tl {TH}
+ \tl_set:Ne \l_@@_cellattribute_tl {\l_@@_cellattribute_tl,TH-row}
+ }
+% \end{macrocode}
+% Here we handle negative value for row headers:
+% \begin{macrocode}
+ \tl_set:Ne \l_@@_tmpa_tl {\int_eval:n { \g_@@_col_int - 1 - \g_@@_table_cols_tl }}
+ \clist_if_in:NoT \l_@@_header_columns_clist { \l_@@_tmpa_tl }
+ {
+ \tl_set:Nn \l_@@_celltag_tl {TH}
+ \tl_set:Ne \l_@@_cellattribute_tl {\l_@@_cellattribute_tl,TH-row}
+ }
+ \tag_struct_begin:n
+ {
+ tag =\l_@@_celltag_tl,
+ attribute-class ={\l_@@_cellattribute_tl}
+ }
+ \seq_gput_right:Ne \g_@@_struct_cur_seq { \tag_get:n {struct_num} }
% \end{macrocode}
% we store the cells of multicolumns as negative number. This allow to skip them
% or to use them as needed.
% \begin{macrocode}
- \int_step_inline:nn { \g_@@_span_tl - 1 }
- {
- \seq_gput_right:Ne \g_@@_struct_cur_seq { -\tag_get:n {struct_num} }
- }
- \tag_mc_begin:n{}
+ \int_step_inline:nn { \g_@@_span_tl - 1 }
+ {
+ \seq_gput_right:Ne \g_@@_struct_cur_seq { -\tag_get:n {struct_num} }
+ }
+ \tag_mc_begin:n{}
+ }
}
% \end{macrocode}
% \end{plugdecl}
@@ -360,8 +445,11 @@
% \begin{macrocode}
\NewSocketPlug{tagsupport/tbl/cell/end}{TD}
{
- \tag_mc_end:
- \tag_struct_end:
+ \@@_if_tag_cell:nnT {\g__tbl_row_int } { \g__tbl_col_int }
+ {
+ \tag_mc_end:
+ \tag_struct_end:
+ }
}
% \end{macrocode}
% \end{plugdecl}
@@ -373,18 +461,26 @@
\NewSocketPlug{tagsupport/tbl/pcell/begin}{TDpbox}
{
\@@_show_curr_cell_data:
- \tag_struct_begin:n
- {
- tag =\l__tbl_pcelltag_tl,
- attribute-class =\l__tbl_cellattribute_tl
- }
- \seq_gput_right:Ne \g__tbl_struct_cur_seq { \tag_get:n {struct_num} }
- \int_step_inline:nn { \g__tbl_span_tl - 1 }
+ \@@_if_tag_cell:nnT {\g__tbl_row_int } { \g__tbl_col_int }
{
- \seq_gput_right:Ne \g__tbl_struct_cur_seq { -\tag_get:n {struct_num} }
- }
- \tagpdfparaOn
- \tl_set:Nn \l__tag_para_main_tag_tl {Div}
+ \clist_if_in:NVT \l_@@_header_columns_clist\g_@@_col_int
+ {
+ \tl_set:Nn \l_@@_celltag_tl {TH}
+ \tl_set:Ne \l_@@_cellattribute_tl {\l_@@_cellattribute_tl,TH-row}
+ }
+ \tag_struct_begin:n
+ {
+ tag =\l_@@_pcelltag_tl,
+ attribute-class ={\l_@@_cellattribute_tl}
+ }
+ \seq_gput_right:Ne \g_@@_struct_cur_seq { \tag_get:n {struct_num} }
+ \int_step_inline:nn { \g_@@_span_tl - 1 }
+ {
+ \seq_gput_right:Ne \g_@@_struct_cur_seq { -\tag_get:n {struct_num} }
+ }
+ \tagpdfparaOn
+ \tl_set:Nn \l__tag_para_main_tag_tl {Div}
+ }
}
% \end{macrocode}
% \end{plugdecl}
@@ -393,7 +489,12 @@
% \begin{macrocode}
\NewSocketPlug{tagsupport/tbl/pcell/end}{TDpbox}
{
- \tag_struct_end:
+ \@@_if_tag_cell:nnT {\g_@@_row_int } { \g_@@_col_int }
+ {
+ \tag_struct_end:
+ \legacy_if:nT {@endpe}{\par}
+ \mode_if_vertical:T{ \tagpdfparaOff }
+ }
}
% \end{macrocode}
% \end{plugdecl}
@@ -429,7 +530,7 @@
{
\@@_trace:n
{==>~
- stucture~stored~for~row~\int_use:N\g_@@_row_int :~
+ structure~stored~for~row~\int_use:N\g_@@_row_int :~
\seq_use:Nn \g_@@_struct_cur_seq {,}
}
}
@@ -444,21 +545,49 @@
% normal tables which can also be used inline and nested and
% \enquote{vmode} tables like longtable.
%
+% \begin{macro}{\l__tag_block_flattened_level_int}
+% Count the levels of nested blockenvs starting with the first that
+% is \enquote{flattened}. The counter is defined in lttagging.dtx,
+% but until the next release 11/24 we set it up here too so that we can
+% use it in the following socket
+% \begin{macrocode}
+\int_if_exist:NF \l__tag_block_flattened_level_int
+ {
+ \int_new:N \l__tag_block_flattened_level_int
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{plugdecl}{Table}
+% Inside a TD or TR Part is not allowed as child. For structures that restore
+% paragraph settings we therefore need a special plug that adjust the settings.
+% Currently we set the para main tag to Div. This leads to double Div-structures
+% but flattening the paragraph doesn't work, it errors if there is a list inside.
+% \begin{macrocode}
+\NewSocketPlug{tagsupport/para/restore}{Table}
+ {
+ \tl_set:Nn \l__tag_para_main_tag_tl {Div}
+ \tl_set_eq:NN \l__tag_para_tag_tl\l__tag_para_tag_default_tl
+ \bool_set_true:N \l__tag_para_bool
+ \bool_set_false:N \l__tag_para_flattened_bool
+ \int_zero:N \l__tag_block_flattened_level_int
+ }
+% \end{macrocode}
+% \end{plugdecl}
+%
% \begin{plugdecl}{Table}
% Inside a table we currently only disable paratagging. We assume
-% that these sockets are in an environment group, so there is no
+% that these sockets are called in a group, so there is no
% need to reenable paratagging.
% \begin{macrocode}
\NewSocketPlug{tagsupport/tbl/init}{Table}
{
- \tag_if_active:T
- {
- \bool_set_false:N \l__tag_para_bool
+ \bool_set_false:N \l__tag_para_bool
+ \AssignSocketPlug{tagsupport/para/restore}{Table}
% \end{macrocode}
% We also initialize the structure data variables a this point.
% \begin{macrocode}
- \@@_init_struct_data:
- }
+ \@@_init_struct_data:
}
% \end{macrocode}
% \end{plugdecl}
@@ -570,7 +699,7 @@
\prop_if_exist:cT
{ g__tag_struct_ \l_@@_tmpa_tl _prop }
{
- \@@_struct_prop_gput:Vnn \l_@@_tmpa_tl {S}{/Artifact}
+ \__tag_struct_prop_gput:onn { \l_@@_tmpa_tl } {S}{/Artifact}
}
}
}
@@ -661,7 +790,7 @@
\prop_if_exist:cT
{ g__tag_struct_ \l_@@_tmpa_tl _prop }
{
- \@@_struct_prop_gput:Vnn \l_@@_tmpa_tl {S}{/Artifact}
+ \__tag_struct_prop_gput:onn {\l_@@_tmpa_tl} {S}{/Artifact}
}
}
}
@@ -708,7 +837,7 @@
\tag_mc_end_push:
% \end{macrocode}
% Close the P-chunk. This assumes that para-tagging is active.
-% For nested tables that is not necessarly true, so we test for it.
+% For nested tables that is not necessarily true, so we test for it.
% \begin{macrocode}
\bool_lazy_and:nnT
{ \bool_if_exist_p:N \l__tag_para_bool } { \l__tag_para_bool }
@@ -726,7 +855,7 @@
\tag_struct_end:
% \end{macrocode}
% reopen the P-chunk. This assumes that para-tagging is active.
-% For nested tables that is not necessarly true, so we test for it.
+% For nested tables that is not necessarily true, so we test for it.
% \begin{macrocode}
\bool_lazy_and:nnT
{ \bool_if_exist_p:N \l__tag_para_bool } { \l__tag_para_bool }
@@ -775,15 +904,32 @@
{/O /Table /ColSpan~\int_eval:n{#1}}
}
\tl_set:Ne \l_@@_cellattribute_tl
- {colspan-\int_eval:n{#1}}
+ {\l_@@_cellattribute_tl,colspan-\int_eval:n{#1}}
}
}
% \end{macrocode}
-% TODO: move to tagpdf
+% \end{plugdecl}
+%
+%
+%
+%
+% \begin{plugdecl}{code}
+% The sockets will be in lttagging.dtx, but that may only happen in
+% the next main release, so for now we test if they are in the
+% format and if not define them now.
% \begin{macrocode}
-\tag_if_active:T
- { \cs_generate_variant:Nn \__tag_attr_new_entry:nn {ee} }
-
+\str_if_exist:cF { l__socket_tagsupport/tbl/leaders/end_plug_str }
+ {
+ \NewSocket{tagsupport/tbl/leaders/begin}{0}
+ \NewSocket{tagsupport/tbl/leaders/end}{0}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewSocketPlug{tagsupport/tbl/leaders/begin}{code}
+ { \tag_mc_begin:n{artifact} }
+\NewSocketPlug{tagsupport/tbl/leaders/end}{code}
+ { \tag_mc_end: }
% \end{macrocode}
% \end{plugdecl}
%
@@ -807,8 +953,7 @@
% \subsection{Interfaces to tagging}
%
% \subsubsection{Tagging helper commands}
-%
-%
+
% \subsubsection{Disabling/enabling}
%
% For now we have only the option true/false but this will probably be extended
@@ -836,6 +981,8 @@
\AssignSocketPlug{tagsupport/tbl/vmode/begin}{noop}
\AssignSocketPlug{tagsupport/tbl/vmode/end}{noop}
\AssignSocketPlug{tagsupport/tbl/colspan}{noop}
+ \AssignSocketPlug{tagsupport/tbl/leaders/begin}{noop}
+ \AssignSocketPlug{tagsupport/tbl/leaders/end}{noop}
}
% \end{macrocode}
% \end{macro}
@@ -863,6 +1010,8 @@
\AssignSocketPlug{tagsupport/tbl/vmode/begin}{Table}
\AssignSocketPlug{tagsupport/tbl/vmode/end}{Table}
\AssignSocketPlug{tagsupport/tbl/colspan}{code}
+ \AssignSocketPlug{tagsupport/tbl/leaders/begin}{code}
+ \AssignSocketPlug{tagsupport/tbl/leaders/end}{code}
}
% \end{macrocode}
% \end{macro}
@@ -883,13 +1032,15 @@
\tl_set:Nn\l_@@_pcelltag_tl {NonStruct}
\tl_set:Nn\l_@@_celltag_tl {text}
\tl_set:Nn\l_@@_tabletag_tl {Div}
+ \clist_clear:N \l_@@_header_rows_clist
+ \clist_clear:N \l_@@_header_columns_clist
},
table/tagging .default:n = true,
table/tagging .initial:n = true
}
% \end{macrocode}
% This are the old key names kept for now for
-% compability. They will got at some time.
+% compatibility. They will got at some time.
% \begin{macrocode}
\keys_define:nn { __tag / setup }
{
@@ -951,30 +1102,16 @@
% \end{macrocode}
%
-% \begin{variable}{\l_@@_header_rows_clist}
-% This holds the numbers of the header rows. Negative numbers are
-% possible and count from the back.
+% \begin{variable}{\l_@@_header_rows_clist,\l_@@_header_columns_clist}
+% This holds the numbers of the header rows and columns. Negative numbers are
+% possible and count from the last column backwards.
% \begin{macrocode}
\clist_new:N \l_@@_header_rows_clist
+\clist_new:N \l_@@_header_columns_clist
% \end{macrocode}
% \end{variable}
%
% \begin{macro}{\@@_set_header_rows:}
-% TEMP: Next tagpdf will have the right command which also updates
-% the debug info.
-% For now a temporary command:
-% \begin{macrocode}
-\cs_if_free:NTF \__tag_struct_prop_gput:nnn
- {
- \cs_new_protected:Npn \@@_struct_prop_gput:nnn #1#2#3
- { \prop_gput:cnn { g__tag_struct_#1_prop }{#2}{#3} }
- }
- { \cs_new_protected:Npn \@@_struct_prop_gput:nnn #1#2#3
- { \__tag_struct_prop_gput:nnn {#1}{#2}{#3} }
- }
-\cs_generate_variant:Nn \@@_struct_prop_gput:nnn {nne,Vnn}
-% \end{macrocode}
-%
% \begin{macrocode}
\cs_new_protected:Npn \@@_set_header_rows:
{
@@ -991,17 +1128,29 @@
% \begin{macrocode}
\prop_if_exist:cT { g__tag_struct_####1_prop }
{
- \@@_struct_prop_gput:nnn{ ####1 }{S}{/TH}
+ \__tag_struct_prop_gput:nnn{ ####1 }{S}{/TH}
% \end{macrocode}
-% This need refinement once row headers (and perhaps other attributes)
-% are used too, but for now it should be ok.
+% This sets the scope class. If the header has already a row attribute
+% we replace by TH-both.
% \begin{macrocode}
\prop_get:cnNTF
{ g__tag_struct_####1_prop }
{ C }
\l_@@_tmpa_tl
- {\@@_struct_prop_gput:nne{ ####1 }{C}{[/TH-col~\l_@@_tmpa_tl]} }
- {\@@_struct_prop_gput:nnn{ ####1 }{C}{/TH-col}}
+ {
+ \str_set:Ne \l_@@_tmpa_str {\l_@@_tmpa_tl}
+ \str_remove_once:Nn \l_@@_tmpa_str {[}
+ \str_remove_once:Nn \l_@@_tmpa_str {]}
+ \str_if_in:NnTF\l_@@_tmpa_str{/TH-row}
+ {
+ \str_replace_once:Nnn \l_@@_tmpa_str {/TH-row}{/TH-both}
+ \__tag_struct_prop_gput:nne{ ####1 }{C}{[\l_@@_tmpa_str]}
+ }
+ {
+ \__tag_struct_prop_gput:nne{ ####1 }{C}{[/TH-col~\l_@@_tmpa_str]}
+ }
+ }
+ {\__tag_struct_prop_gput:nnn{ ####1 }{C}{/TH-col}}
}
}
}
@@ -1015,6 +1164,7 @@
\keys_define:nn { __tag / setup }
{
table/header-rows .clist_set:N = \l_@@_header_rows_clist,
+ table/header-columns .clist_set:N = \l_@@_header_columns_clist,
% \end{macrocode}
% obsolete older name:
% \begin{macrocode}
@@ -1022,8 +1172,114 @@
}
% \end{macrocode}
%
+% \subsection{Multirow support}
+%
+% \begin{macro}{\@@_multirow:n}
+% This command makes the current cell into a multirow cell:
+% it creates, if needed, an RowSpan-attribute, adds it to the attributes
+% of the cell structure, and marks all following cells spanned by the multirow
+% as cells that should not be tagged. The argument is the number of spanned row
+% (including the current row).
+% \begin{macrocode}
+\cs_if_exist:NT \__tag_struct_prop_gput:nnn
+ {
+ \cs_generate_variant:Nn \__tag_struct_prop_gput:nnn {one}
+ }
+\cs_new_protected:Npn \@@_multirow:n #1
+ {
+% \end{macrocode}
+% Create an attribute if needed:
+% \begin{macrocode}
+ \prop_get:NeNF \g__tag_attr_entries_prop
+ {rowspan-\int_eval:n{#1}}
+ \l_@@_tmpa_tl
+ {
+ \__tag_attr_new_entry:ee
+ {rowspan-\int_eval:n{#1}}
+ {/O /Table /RowSpan~\int_eval:n{#1}}
+ }
+% \end{macrocode}
+% ensure that the attribute is marked as used:
+% \begin{macrocode}
+ \seq_gput_left:Ne\g__tag_attr_class_used_seq
+ {\pdf_name_from_unicode_e:n{rowspan-\int_eval:n{#1}}}
+% \end{macrocode}
+% Get the structure number of the current cell
+% \begin{macrocode}
+ \seq_get_right:NN\g_@@_struct_cur_seq \l_@@_tmpb_tl
+% \end{macrocode}
+% If we are in a multicolumn the number can be negative and
+% this must be changed
+% \begin{macrocode}
+ \tl_set:Ne \l_@@_tmpb_tl { \int_abs:n{\l_@@_tmpb_tl} }
+% \end{macrocode}
+% no we must update an existing attribute.
+% TODO: simplify this ... (see also colspan handling).
+% \begin{macrocode}
+ \prop_get:cnNTF
+ { g__tag_struct_\l_@@_tmpb_tl _prop }
+ { C }
+ \l_@@_tmpa_tl
+ {
+ \tl_remove_once:Nn \l_@@_tmpa_tl {[}
+ \tl_remove_once:Nn \l_@@_tmpa_tl {]}
+ \__tag_struct_prop_gput:one{ \l_@@_tmpb_tl }
+ {C}
+ {[/rowspan-\int_eval:n{#1}~\l_@@_tmpa_tl]}
+ }
+ {
+ \__tag_struct_prop_gput:one{ \l_@@_tmpb_tl }
+ {C}
+ {[/rowspan-\int_eval:n{#1}]}
+ }
+% \end{macrocode}
+% Now mark the spanned cells that should be ignored.
+% \begin{macrocode}
+ \@@_gset_untagged_row_cells:nn {#1-1}{\g_@@_span_tl}
+ }
+% \end{macrocode}
+% \end{macro}
%
+% \begin{macrocode}
+\keys_define:nn{ __tag / setup }
+ { table/multirow .code:n = {\@@_multirow:n {#1} }
+ ,table/multirow .default:n = 1
+ }
+% \end{macrocode}
%
+% \begin{macro}{\@@_gset_untagged_row_cells:nn}
+% This command stores the row and column numbers of the cells in the following row(s)
+% that should not be tagged as they are a part of a rowspan.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_gset_untagged_row_cells:nn #1 #2 % #1 number of rows, #2 number of columns
+ {
+ \int_step_inline:nn {#1}
+ {
+ \int_step_inline:nn {#2}
+ {
+ \prop_gput:Nee \g_@@_untagged_cells_prop
+ { \int_eval:n {\g_@@_row_int + ##1},\int_eval:n{\g_@@_col_int + ####1 -1 } }{}
+ }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_if_tag_cell:nn}
+% We must be able to detect if a cell should be tagged. For this
+% we define a conditional --- if more options are needed it can be extended.
+% \begin{macrocode}
+\prg_new_protected_conditional:Npnn\@@_if_tag_cell:nn #1 #2 %#1 row, #2 col
+ { T,TF }
+ {
+ \prop_get:NeNTF \g_@@_untagged_cells_prop
+ {\int_eval:n{#1},\int_eval:n{#2}}\l__tbl_tmpa_tl
+ { \prg_return_false:}
+ { \prg_return_true: }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Misc stuff}
%
% \begin{macro}{\@@_show_curr_cell_data:}
@@ -1048,13 +1304,6 @@
% cell of a row, but still inside that cell, so we use two
% commands. The one adding is used in the row/end socket.
% \begin{macrocode}
-\NewSocket{tbl/celldata/missingcount}{1}
-\NewSocketPlug{tbl/celldata/missingcount}{code}{\tbl_count_missing_cells:n{#1}}
-\AssignSocketPlug{tbl/celldata/missingcount}{code}
-
-% \end{macrocode}
-%
-% \begin{macrocode}
\cs_new:Npn \@@_add_missing_cells:
{
% \end{macrocode}
@@ -1069,6 +1318,7 @@
additional~cell(s)~into~previous~row:}
\int_step_inline:nn { \g_@@_missing_cells_int }
{
+ \int_gincr:N\g_@@_col_int
\UseTaggingSocket{tbl/cell/begin}
\UseTaggingSocket{tbl/cell/end}
}
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-table.pdf b/macros/latex-dev/required/latex-lab/latex-lab-table.pdf
index a87f7638df..c2bb7e7c2f 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-table.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-table.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-testphase.dtx b/macros/latex-dev/required/latex-lab/latex-lab-testphase.dtx
index f0a6fe65d0..1134654cd6 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-testphase.dtx
+++ b/macros/latex-dev/required/latex-lab/latex-lab-testphase.dtx
@@ -47,7 +47,7 @@
%
% Currently the values |phase-I|, |phase-II|, |phase-III| and |new-or| (bundles |new-or-1|
% and |new-or-2|) are provided.
-% |tagpdf| is an undocumented alias for |phase-II| which is kept for compability.
+% |tagpdf| is an undocumented alias for |phase-II| which is kept for compatibility.
% The value |math| combines various math related files.
%
% \StopEventually{\setlength\IndexMin{200pt} \PrintIndex }
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-testphase.pdf b/macros/latex-dev/required/latex-lab/latex-lab-testphase.pdf
index 9cb5334c0d..c9988c89af 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-testphase.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-testphase.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-text.pdf b/macros/latex-dev/required/latex-lab/latex-lab-text.pdf
index 8b778cc94b..8c4fc7780d 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-text.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-text.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-title.pdf b/macros/latex-dev/required/latex-lab/latex-lab-title.pdf
index 94ea473b98..64dfa09d2c 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-title.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-title.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-toc-hyperref-changes.pdf b/macros/latex-dev/required/latex-lab/latex-lab-toc-hyperref-changes.pdf
index e94e8e9cc3..caf6bd4b7b 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-toc-hyperref-changes.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-toc-hyperref-changes.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-toc-kernel-changes.dtx b/macros/latex-dev/required/latex-lab/latex-lab-toc-kernel-changes.dtx
index bb88ffdcb0..bf10bf4f2f 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-toc-kernel-changes.dtx
+++ b/macros/latex-dev/required/latex-lab/latex-lab-toc-kernel-changes.dtx
@@ -17,8 +17,8 @@
% for those people who are interested or want to report an issue.
%
% dates for latex-lab-kernel-changes.sty (pulled from various sources, see ins)
-\def\ltlabkerneldate{2024-02-12}
-\def\ltlabkernelversion{0.85c}
+\def\ltlabkerneldate{2024-07-11}
+\def\ltlabkernelversion{0.85d}
%<*driver>
\documentclass{l3doc}
\EnableCrossrefs
@@ -44,6 +44,11 @@
%
% \providecommand\hook[1]{\texttt{#1}}
%
+%
+% \ProvideDocElement[printtype=\textit{socket},idxtype=socket,idxgroup=Sockets]{Socket}{socketdecl}
+% \ProvideDocElement[printtype=\textit{hook},idxtype=hook,idxgroup=Hooks]{Hook}{hookdecl}
+% \ProvideDocElement[printtype=\textit{plug},idxtype=plug,idxgroup=Plugs]{Plug}{plugdecl}
+%
% \begin{abstract}
% \end{abstract}
%
@@ -187,12 +192,24 @@
% \subsection{\cs{contentsline} extension}
% [latex-lab]
% The tagging code must add code at the begin and end of \cs{contentsline}.
-% This code must have access to the arguments. We set it up as config point
-% for now.
+% This code must have access to the arguments. They are passed
+% together in tagging socket.
+% \begin{socketdecl}{tagsupport/toc/contentsline/before,
+% tagsupport/toc/contentsline/after}
+% Tagging sockets at the begin and end of contentsline.
+% They receive \emph{all} contentsline arguments as one argument
+% in four brace groups. The socket code should then use the parts it needs.
+% The sockets will be in lttagging.dtx, but that may only happen in
+% the next main release, so for now we test if they are in the
+% format and if not define them now.
% \begin{macrocode}
-\def\@contentsline@cfgpoint@before#1#2#3#4{}
-\def\@contentsline@cfgpoint@after#1#2#3#4{}
+\str_if_exist:cF { l__socket_tagsupport/toc/contentsline/before_plug_str }
+ {
+ \NewSocket{tagsupport/toc/contentsline/before}{1}
+ \NewSocket{tagsupport/toc/contentsline/after}{1}
+ }
% \end{macrocode}
+% \end{socketdecl}
% for the hooks we need that the \cs{l@XX} pass also the destination and
% that \cs{l@XX} takes three arguments.
% TODO: test that, if there are two many problems we should pass the
@@ -200,10 +217,10 @@
% \begin{macrocode}
\def\contentsline#1#2#3#4%
{%
- \@contentsline@cfgpoint@before{#1}{#2}{#3}{#4}%
+ \UseTaggingSocket{toc/contentsline/before}{{#1}{#2}{#3}{#4}}%
\gdef\@contentsline@destination{#4}%
\csname l@#1\endcsname{#2}{#3}%
- \@contentsline@cfgpoint@after{#1}{#2}{#3}{#4}%
+ \UseTaggingSocket{toc/contentsline/after}{{#1}{#2}{#3}{#4}}%
}
% \end{macrocode}
%
@@ -225,17 +242,33 @@
% \subsection{\cs{@starttoc}}
% [kernel?]
%
-% We add a configuration point before and after reading the file
+% We add a tagging socket before and after reading the file
% for the tagging.
+% \begin{socketdecl}{tagsupport/toc/starttoc/before,
+% tagsupport/toc/starttoc/after}
+% Tagging sockets for the begin and end of start of \cs{@starttoc}.
+% They take one argument, the extension.
+% The sockets will be in lttagging.dtx, but that may only happen in
+% the next main release, so for now we test if they are in the
+% format and if not define them now.
+% \begin{macrocode}
+\str_if_exist:cF { l__socket_tagsupport/toc/starttoc/before_plug_str }
+ {
+ \NewSocket{tagsupport/toc/starttoc/before}{1}
+ \NewSocket{tagsupport/toc/starttoc/after}{1}
+ }
+% \end{macrocode}
+% \begin{macrocode}
+% \end{macrocode}
+% \end{socketdecl}
+%
% \begin{macrocode}
-\def\@starttoc@cfgpoint@before#1{}
-\def\@starttoc@cfgpoint@after#1{}
\def\@starttoc#1{%
\begingroup
\makeatletter
- \@starttoc@cfgpoint@before{#1}%
+ \UseTaggingSocket{toc/starttoc/before}{#1}%
\@input{\jobname.#1}%
- \@starttoc@cfgpoint@after{#1}%
+ \UseTaggingSocket{toc/starttoc/after}{#1}%
\if@filesw
\expandafter\newwrite\csname tf@#1\endcsname
\immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
@@ -269,15 +302,32 @@
\NewMirroredHookPairWithArguments{contentsline/page/before}{contentsline/page/after}{4}%
% \end{macrocode}
%
-% The dot in the leader must be set as artifact.
+% The dots in the leader must be set as artifact.
% But luatex requires that the mc are set outside the leaders.
-% So we need a config point.
+% So we need sockets.
%
% \cs{@dottedtocline} needs hooks and formatting commands.
-% We add a sixth argument so that it can grab the destination too.
+% To make the leaders into artifact we use tagging sockets.
+% The declaration should perhaps be moved into lttagging so that
+% it can be used also by external packages even if the tagging code is not
+% loaded?
+% \begin{socketdecl}{tagsupport/toc/leaders/before,
+% tagsupport/toc/leaders/after}
+% Tagging sockets to make the dot leaders an artifact.
+% They do not take an argument.
+% The sockets will be in lttagging.dtx, but that may only happen in
+% the next main release, so for now we test if they are in the
+% format and if not define them now.
+% \begin{macrocode}
+\str_if_exist:cF { l__socket_tagsupport/toc/leaders/before_plug_str }
+ {
+ \NewSocket{tagsupport/toc/leaders/before}{0}
+ \NewSocket{tagsupport/toc/leaders/after}{0}
+ }
+% \end{macrocode}
+% \end{socketdecl}
+% The destination is accessed through \cs{@contentsline@destination}.
% \begin{macrocode}
-\def\@dottedtocline@cfgpoint@leaders#1{#1}
-
\def\@dottedtocline#1#2#3#4#5{%
\ifnum #1>\c@tocdepth \else
\vskip \z@ \@plus.2\p@
@@ -291,10 +341,11 @@
\csname contentsline@text@#1@format\endcsname{#4}%
\UseHookWithArguments{contentsline/text/after}{4}{#1}{#4}{#5}{\@contentsline@destination}%
\nobreak
- \@dottedtocline@cfgpoint@leaders{%
+ \UseTaggingSocket{toc/leaders/before}\SuspendTagging{toc/leaders}%
\leaders\hbox{$\m@th
\mkern \@dotsep mu\hbox{.}\mkern \@dotsep
- mu$}\hfill}%
+ mu$}\hfill
+ \ResumeTagging{toc/leaders}\UseTaggingSocket{toc/leaders/after}%
\nobreak
\hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor
\UseHookWithArguments{contentsline/page/before}{4}{#1}{#4}{#5}{\@contentsline@destination}%
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-toc-kernel-changes.pdf b/macros/latex-dev/required/latex-lab/latex-lab-toc-kernel-changes.pdf
index 65e534d37b..7e19e8a9eb 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-toc-kernel-changes.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-toc-kernel-changes.pdf
Binary files differ
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-toc.dtx b/macros/latex-dev/required/latex-lab/latex-lab-toc.dtx
index 7235eb9ed9..5ad0d3cec1 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-toc.dtx
+++ b/macros/latex-dev/required/latex-lab/latex-lab-toc.dtx
@@ -16,8 +16,8 @@
%
% for those people who are interested or want to report an issue.
%
-\def\ltlabtocdate{2023-10-16}
-\def\ltlabtocversion{0.85b}
+\def\ltlabtocdate{2024-07-11}
+\def\ltlabtocversion{0.85c}
%<*driver>
\documentclass{l3doc}
\EnableCrossrefs
@@ -42,7 +42,10 @@
% \newcommand{\docclass}{document class \marginpar{\raggedright document class
% customizations}}
%
-% \providecommand\hook[1]{\texttt{#1}}
+%
+% \ProvideDocElement[printtype=\textit{socket},idxtype=socket,idxgroup=Sockets]{Socket}{socketdecl}
+% \ProvideDocElement[printtype=\textit{hook},idxtype=hook,idxgroup=Hooks]{Hook}{hookdecl}
+% \ProvideDocElement[printtype=\textit{plug},idxtype=plug,idxgroup=Plugs]{Plug}{plugdecl}
%
% \begin{abstract}
% \end{abstract}
@@ -196,14 +199,17 @@
\tag_struct_begin:n{tag=TOC,title=#1}
}
% \end{macrocode}
-% Now map it into the config point:
+% \end{macro}
+% Now define the tagging plug and assign it to the socket.
+% \begin{plugdecl}{default}
% \begin{macrocode}
-\cs_set_protected:Npn\@starttoc@cfgpoint@before#1
- {
- \@@_toc_starttoc_init:n{#1}
- }
+\NewSocketPlug{tagsupport/toc/starttoc/before}{default}
+ {
+ \@@_toc_starttoc_init:n{#1}
+ }
+\AssignSocketPlug{tagsupport/toc/starttoc/before}{default}
% \end{macrocode}
-% \end{macro}
+% \end{plugdecl}
% \begin{macro}{\@@_toc_starttoc_finalize:}
% \begin{macrocode}
\cs_new_protected:Npn \@@_toc_starttoc_finalize:
@@ -215,15 +221,18 @@
\seq_gclear:N \g_@@_toc_stack_seq
}
% \end{macrocode}
-% Now map it into the config point:
+% \end{macro}
+% Now define the tagging plug and assign it to the socket.
+% \begin{plugdecl}{default}
% \begin{macrocode}
-\cs_set_protected:Npn\@starttoc@cfgpoint@after#1
- {
- \@@_toc_starttoc_finalize:
- }
+\NewSocketPlug{tagsupport/toc/starttoc/after}{default}
+ {
+ \@@_toc_starttoc_finalize:
+ }
+\AssignSocketPlug{tagsupport/toc/starttoc/after}{default}
% \end{macrocode}
-% \end{macro}
-
+% \end{plugdecl}
+%
% \begin{macro}{\@@_toc_end:n}
% This commands ends all TOC on the stack with a level higher than the argument
% \begin{macrocode}
@@ -249,10 +258,11 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_toc_contentsline_begin:nnn}
+% \begin{macro}{\@@_toc_contentsline_begin:nnnn}
% This is main command executed at the begin of a |\contentsline|.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_toc_contentsline_begin:nnn #1 #2 #3 %#1 level, #2 content, #3 destination
+\cs_new_protected:Npn \@@_toc_contentsline_begin:nnnn #1 #2 #3 #4
+ %#1 level, #2 content, #3 page number (unused) #4 destination
{
\tag_if_active:T
{
@@ -308,30 +318,34 @@
% \end{NOTE}
% \begin{macrocode}
\prop_gput:Nee \g_@@_struct_ref_by_dest_prop
- { \tag_get:n {struct_num} }{#3}
+ { \tag_get:n {struct_num} }{#4}
\seq_gpush:Ne \g_@@_toc_stack_seq {{TOCI}\use:c{toclevel@#1}}
\group_end:
}
}
}
% \end{macrocode}
-% Now map it into the config point:
+% \end{macro}
+% Now define the tagging plug and assign it to the socket.
+% \begin{plugdecl}{default}
% \begin{macrocode}
-\cs_set_protected:Npn\@contentsline@cfgpoint@before#1#2#3#4
+\NewSocketPlug{tagsupport/toc/contentsline/before}{default}
{
- \@@_toc_contentsline_begin:nnn {#1}{#2}{#4}
- }
+ \@@_toc_contentsline_begin:nnnn #1
+ }
+\AssignSocketPlug{tagsupport/toc/contentsline/before}{default}
% \end{macrocode}
-% \end{macro}
+% \end{plugdecl}
%
-% \begin{macro}{\@@_toc_contentsline_end:n}
+% \begin{macro}{\@@_toc_contentsline_end:nnnn}
% This is the closing code of a |\contentsline|.
% If the contentsline was actually printed, the code has to
% close the TOCI structure and to update the stack.
% \begin{macrocode}
\msg_new:nnn {tag}{toc-no-TOCI}{Missing~TOCI~structure~on~toc~stack}
-\cs_new_protected:Npn \@@_toc_contentsline_end:n #1 %#1 level name
+\cs_new_protected:Npn \@@_toc_contentsline_end:nnnn #1 #2 #3 #4
+% #1 level, #2 content (unused), #3 page number (unused) #4 destination (unused)
{
\int_compare:nNnF { \use:c{toclevel@#1} } > {\use:c{c@tocdepth}}
{
@@ -348,14 +362,17 @@
}
}
% \end{macrocode}
-% Now we map it to the config point
+% \end{macro}
+% Now define the tagging plug and assign it to the socket.
+% \begin{plugdecl}{default}
% \begin{macrocode}
-\cs_set_protected:Npn \@contentsline@cfgpoint@after #1#2#3#4
- {
- \@@_toc_contentsline_end:n {#1}
- }
+\NewSocketPlug{tagsupport/toc/contentsline/after}{default}
+ {
+ \@@_toc_contentsline_end:nnnn #1
+ }
+\AssignSocketPlug{tagsupport/toc/contentsline/after}{default}
% \end{macrocode}
-% \end{macro}
+% \end{plugdecl}
%
% \subsection{Tagging of the content}
% This need discussion.
@@ -380,12 +397,16 @@
\tag_struct_end:
\tag_mc_begin:n{tag=Reference}}
% \end{macrocode}
-%
+% \begin{plugdecl}{artifact}
% \begin{macrocode}
-\def\@dottedtocline@cfgpoint@leaders#1{%
- \tag_mc_begin:n{artifact}\tag_stop:n{leaders}\nobreak#1\nobreak\tag_start:n{leaders}\tag_mc_end:}
+\NewSocketPlug{tagsupport/toc/leaders/before}{artifact}
+ {\tag_mc_begin:n{artifact}\nobreak}
+\NewSocketPlug{tagsupport/toc/leaders/after}{artifact}
+ {\nobreak\tag_mc_end:}
+\AssignSocketPlug{tagsupport/toc/leaders/before}{artifact}
+\AssignSocketPlug{tagsupport/toc/leaders/after}{artifact}
% \end{macrocode}
-
+% \end{plugdecl}
%
% \begin{macrocode}
%</package>
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-toc.pdf b/macros/latex-dev/required/latex-lab/latex-lab-toc.pdf
index 1bea97e1d9..5f6e705a90 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-toc.pdf
+++ b/macros/latex-dev/required/latex-lab/latex-lab-toc.pdf
Binary files differ