summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tagpdf
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/tagpdf')
-rw-r--r--macros/latex/contrib/tagpdf/README.md4
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-backend.dtx27
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-checks.dtx47
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-code.pdfbin1564470 -> 1593565 bytes
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-data.dtx18
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx9
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx20
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx45
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-roles.dtx4
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-space.dtx4
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-struct.dtx20
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-tree.dtx4
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-user.dtx18
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf.dtx6
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf.pdfbin1012495 -> 1021749 bytes
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf.tex39
-rw-r--r--macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty2
17 files changed, 206 insertions, 61 deletions
diff --git a/macros/latex/contrib/tagpdf/README.md b/macros/latex/contrib/tagpdf/README.md
index 5b4a1b211f..bb0353de51 100644
--- a/macros/latex/contrib/tagpdf/README.md
+++ b/macros/latex/contrib/tagpdf/README.md
@@ -1,6 +1,6 @@
#tagpdf — A package to create tagged pdf
-Packageversion: 0.98h
-Packagedate: 2023/06/06
+Packageversion: 0.98i
+Packagedate: 2023/06/14
Author: Ulrike Fischer
## License
diff --git a/macros/latex/contrib/tagpdf/tagpdf-backend.dtx b/macros/latex/contrib/tagpdf/tagpdf-backend.dtx
index 5b6acbf34f..a9c4763358 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-backend.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-backend.dtx
@@ -47,13 +47,13 @@
% }^^A
% }
%
-% \date{Version 0.98h, released 2023-06-06}
+% \date{Version 0.98i, released 2023-06-14}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*luatex>
-\ProvidesExplFile {tagpdf-luatex.def} {2023-06-06} {0.98h}
+\ProvidesExplFile {tagpdf-luatex.def} {2023-06-14} {0.98i}
{tagpdf~driver~for~luatex}
% \end{macrocode}
% \section{Loading the lua}
@@ -158,8 +158,8 @@
local ProvidesLuaModule = {
name = "tagpdf",
- version = "0.98h", --TAGVERSION
- date = "2023-06-06", --TAGDATE
+ version = "0.98i", --TAGVERSION
+ date = "2023-06-14", --TAGDATE
description = "tagpdf lua code",
license = "The LATEX Project Public License 1.3c"
}
@@ -890,6 +890,25 @@ end
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{ltx.@@.func.update_mc_attributes}
+% This updates the mc-attributes of a box. It should only be used on boxes
+% which don't contain structure elements.
+% The arguments are a box, the mc-num and the type (as a number)
+% \begin{macrocode}
+local function @@_update_mc_attributes (head,mcnum,type)
+ for n in node.traverse(head) do
+ node.set_attribute(n,mccntattributeid,mcnum)
+ node.set_attribute(n,mctypeattributeid,type)
+ if n.id == HLIST or n.id == VLIST then
+ @@_update_mc_attributes (n.list,mcnum,type)
+ end
+ end
+ return head
+end
+ltx.@@.func.update_mc_attributes = @@_update_mc_attributes
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{ltx.@@.func.mark_page_elements}
% This is the main traversing function. See the lua comment for more details.
% \begin{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-checks.dtx b/macros/latex/contrib/tagpdf/tagpdf-checks.dtx
index 39b786ee41..81fd2c8d95 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-checks.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-checks.dtx
@@ -48,7 +48,7 @@
% }^^A
% }
%
-% \date{Version 0.98h, released 2023-06-06}
+% \date{Version 0.98i, released 2023-06-14}
% \maketitle
% \begin{documentation}
% \section{Commands}
@@ -66,6 +66,18 @@
% are |mc_tag|, |struct_tag|, |struct_id| and |struct_num|.
% \end{function}
%
+% \begin{function}[pTF,EXP]{\tag_if_box_tagged:N}
+% \begin{syntax}
+% \cs{tag_if_box_tagged:N}\Arg{box}
+% \end{syntax}
+% This tests if a box contains tagging commands.
+% It relies currently on that the code that saved the box correctly set
+% the command \verb+\l_tag_box_\int_use:N #1_tl+ to a positive value.
+% The LaTeX commands will do that automatically
+% at some time but it is in the responsability of the user to
+% ensure that when using low-level code.
+% If the internal command doesn't exist the box is assumed to be tagged.
+% \end{function}
% \section{Description of log messages}
% \subsection{\cs{ShowTagging} command}
% \begin{tabular}{lll}
@@ -300,7 +312,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-checks-code} {2023-06-06} {0.98h}
+\ProvidesExplPackage {tagpdf-checks-code} {2023-06-14} {0.98i}
{part of tagpdf - code related to checks, conditionals, debugging and messages}
%</header>
% \end{macrocode}
@@ -529,7 +541,7 @@
%
% \section{User conditionals}
% \begin{macro}[pTF]{\tag_if_active:}
-% This is a test it tagging is active. This allows packages
+% This tests if tagging is active. This allows packages
% to add conditional code.
% The test is true if all booleans, the global and the two local one are true.
%
@@ -556,6 +568,34 @@
\prg_return_false:
}
}
+%</package>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[pTF]{\tag_if_box_tagged:N}
+% This tests if a box contains tagging commands.
+% It relies on that the code that saved the box correctly set
+% \verb+\l_tag_box_<box number>_tl+ to a positive value.
+% The LaTeX commands will do that automatically
+% at some time but it is in the responsability of the user to
+% ensure that when using low-level code.
+% If the internal command doesn't exist the box is assumed to be tagged.
+% \begin{macrocode}
+%<*base>
+\prg_new_conditional:Npnn \tag_if_box_tagged:N #1 {p,T,F,TF}
+ {
+ \tl_if_exist:cTF {l_tag_box_\int_use:N #1_tl}
+ {
+ \int_compare:nNnTF {\tl_use:c{l_tag_box_\int_use:N #1_tl}}>{0}
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+ {
+ \prg_return_true:
+ % warning??
+ }
+ }
+%</base>
% \end{macrocode}
% \end{macro}
%
@@ -566,6 +606,7 @@
% \begin{macro}[TF]{\@@_check_if_active_mc:,\@@_check_if_active_struct:}
% This checks if mc are active.
% \begin{macrocode}
+%<*package>
\prg_new_conditional:Npnn \@@_check_if_active_mc: {T,F,TF}
{
\bool_lazy_and:nnTF { \g_@@_active_mc_bool } { \l_@@_active_mc_bool }
diff --git a/macros/latex/contrib/tagpdf/tagpdf-code.pdf b/macros/latex/contrib/tagpdf/tagpdf-code.pdf
index 8fd8bc7541..5784294ea4 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-code.pdf
+++ b/macros/latex/contrib/tagpdf/tagpdf-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/tagpdf/tagpdf-data.dtx b/macros/latex/contrib/tagpdf/tagpdf-data.dtx
index e66712cc7f..57dc3d356e 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-data.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-data.dtx
@@ -47,7 +47,7 @@
% }^^A
% }
%
-% \date{Version 0.98h, released 2023-06-06}
+% \date{Version 0.98i, released 2023-06-14}
% \maketitle
% \begin{documentation}
% This files contains a various data files which are read in
@@ -60,7 +60,7 @@
% It lists the new tag, the rolemap and the namespace of the rolemap.
% \begin{macrocode}
%<*ns-latex>
-%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-06-06} {0.98h}
+%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-06-14} {0.98i}
%% {latex} {https://www.latex-project.org/ns/dflt/2022}{}
title, Title, pdf2,
part, Title, pdf2,
@@ -92,7 +92,7 @@ text, P, pdf2,
% It is bound to change
% \begin{macrocode}
%<*ns-latex-book>
-%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-06-06} {0.98h}
+%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-06-14} {0.98i}
%% {latex-book} {https://www.latex-project.org/ns/book/2022}{}
chapter, H1,pdf2,
section, H2,pdf2,
@@ -108,7 +108,7 @@ subparagraph, H6,pdf2,
% It is bound to change a lot!
% \begin{macrocode}
%<*ns-latex-inline>
-%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-06-06} {0.98h}
+%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-06-14} {0.98i}
%% {latex-inline} {https://www.latex-project.org/ns/inline/2022}{}
chapter, Span, pdf2,
section, Span, pdf2,
@@ -122,7 +122,7 @@ P, Span, pdf2,
% \section{The pdf namespace data}
% \begin{macrocode}
%<*ns-pdf>
-%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-06-06} {0.98h}
+%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-06-14} {0.98i}
%% {pdf} {http://iso.org/pdf/ssn}{}
StructTreeRoot,StructTreeRoot,pdf,D,
Document,Document,pdf,D,
@@ -190,7 +190,7 @@ Strong,Span,pdf,I,
% \section{The pdf 2.0 namespace data}
% \begin{macrocode}
%<*ns-pdf2>
-%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-06-06} {0.98h}
+%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-06-14} {0.98i}
%% {pdf2} {http://iso.org/pdf2/ssn}{}
Document,Document,pdf2,D,
Part,Part,pdf2,G,
@@ -246,7 +246,7 @@ Strong,Strong,pdf2,I,
% \section{The mathml namespace data}
% \begin{macrocode}
%<*ns-mathml>
-%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-06-06} {0.98h}
+%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-06-14} {0.98i}
% {mathml}{http://www.w3.org/1998/Math/MathML}{}
abs,abs,mathml,
and,and,mathml,
@@ -481,7 +481,7 @@ xor,xor,mathml,
% This will perhaps change in future.
% \begin{macrocode}
%<*parent-child>
-%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-06-06} {0.98h}
+%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-06-14} {0.98i}
,,,StructTreeRoot,Document,Art,Part,Div,Sect,BlockQuote,NonStruct,TOC,TOCI,Index,Private,Quote,Note,Reference,BibEntry,P,Hn,H,Lbl,Code,Span,Link,Annot,Form,Ruby,RB,RT,RP,Warichu,WT,WP,L,LI,LBody,Table,TR,TH,TD,THead,TBody,TFoot,Caption,Figure,Formula,MC
Document,both,document level,1,0..n,∅,‡,‡,∅,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅
Art,1.7,grouping,∅,0..n,∅,‡,‡,0..n,0..n,‡,∅,∅,∅,0..n,∅,0..n,∅,∅,∅,0..1,0..1,∅,∅,∅,0..n,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,0..n,∅,∅,0..n,0..n,∅,∅,∅,0..n,0..n,∅,∅
@@ -536,7 +536,7 @@ MC,both,---,∅,∅,∅,∅,∅,∅,0..n,‡,∅,∅,∅,0..n,0..n,0..n,0..n,0..
% This will perhaps change in future.
% \begin{macrocode}
%<*parent-child-2>
-%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-06-06} {0.98h}
+%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-06-14} {0.98i}
,,,StructTreeRoot,Document,DocumentFragment,Art,Part,Div,Sect,Aside,BlockQuote,NonStruct,TOC,TOCI,Index,Private,Title,Sub,Quote,Note,Reference,BibEntry,P,Hn,H,Lbl,Code,Em,Strong,Span,Link,Annot,Form,Ruby,RB,RT,RP,Warichu,WT,WP,FENote,L,LI,LBody,Table,TR,TH,TD,THead,TBody,TFoot,Caption,Figure,Formula,math,mathml,Artifact,MC
Document,both,document level,1,0..n,0..n,∅,‡,‡,∅,0..n,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,0..n,∅
DocumentFragment,2.0,document level,∅,0..n,0..n,0..n,‡,‡,0..n,0..n,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅*,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅*,∅*,∅,∅,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅,0..n,∅
diff --git a/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx b/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx
index a82cb68524..97732c57bf 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98h, released 2023-06-06}
+% \date{Version 0.98i, released 2023-06-14}
% \maketitle
% \begin{documentation}
% \end{documentation}
@@ -55,11 +55,11 @@
% \begin{macrocode}
%<@@=tag>
%<*generic>
-\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-06-06} {0.98h}
+\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-06-14} {0.98i}
{part of tagpdf - code related to marking chunks - generic mode}
%</generic>
%<*debug>
-\ProvidesExplPackage {tagpdf-debug-generic} {2023-06-06} {0.98h}
+\ProvidesExplPackage {tagpdf-debug-generic} {2023-06-14} {0.98i}
{part of tagpdf - debugging code related to marking chunks - generic mode}
%</debug>
% \end{macrocode}
@@ -657,6 +657,7 @@
% \end{macrocode}
% \end{macro}
%
+%
% \begin{macro}{\tag_mc_begin:n,\tag_mc_end:}
% These are the core public commands to open and close an mc.
% They don't need to be in the same group or grouping level,
@@ -664,7 +665,7 @@
% the state is passed to the end command through a global var and
% a global boolean.
% \begin{macrocode}
-%<base>\cs_new_protected:Npn \tag_mc_begin:n #1 { \@@_whatsits: }
+%<base>\cs_new_protected:Npn \tag_mc_begin:n #1 { \@@_whatsits: \int_gincr:N \c@g_@@_MCID_abs_int }
%<base>\cs_new_protected:Nn \tag_mc_end:{ \@@_whatsits: }
%<*generic|debug>
%<*generic>
diff --git a/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx b/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx
index cf70950a28..261a3ff73f 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98h, released 2023-06-06}
+% \date{Version 0.98i, released 2023-06-14}
% \maketitle
% \begin{implementation}
% The code is splitted into three parts: code shared by all engines,
@@ -86,7 +86,7 @@
% \begin{macrocode}
%<@@=tag>
%<*luamode>
-\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-06-06} {0.98h}
+\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-06-14} {0.98i}
{tagpdf - mc code only for the luamode }
%</luamode>
% \end{macrocode}
@@ -375,6 +375,22 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\tag_mc_reset_box:N}
+% This allows to reset the mc-attributes in box. On base and generic mode it should do
+% nothing.
+% \begin{macrocode}
+\cs_set_protected:Npn \tag_mc_reset_box:N #1
+ {
+ \lua_now:e
+ {
+ local~type=tex.getattribute(luatexbase.attributes.g_@@_mc_type_attr)
+ local~mc=tex.getattribute(luatexbase.attributes.g_@@_mc_cnt_attr)
+ ltx.__tag.func.update_mc_attributes(tex.getbox(\int_use:N #1),mc,type)
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{ \@@_get_data_mc_tag: }
% The command to retrieve the current mc tag.
% TODO: Perhaps this should use the attribute instead.
diff --git a/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx b/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx
index 2096e11d30..9c9d4ec735 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98h, released 2023-06-06}
+% \date{Version 0.98i, released 2023-06-14}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
@@ -111,6 +111,13 @@
% Determines if a mc-chunk is open.
% \end{function}
+% \begin{function}[ EXP,added=2023-06-11]{\tag_mc_reset_box:N}
+% \begin{syntax}
+% \cs{tag_mc_reset:N} \Arg{box}
+% \end{syntax}
+% This resets in lua mode the mc attributes to the one currently in use.
+% It does nothing in generic mode.
+% \end{function}
%
% \section{Public keys}
% The following keys can be used with |\tag_mc_begin:n|, |\tagmcbegin|,
@@ -174,7 +181,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-06-06} {0.98h}
+\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-06-14} {0.98i}
{part of tagpdf - code related to marking chunks -
code shared by generic and luamode }
%</header>
@@ -192,18 +199,34 @@
%
% \begin{variable}{g_@@_MCID_abs_int}
% \begin{macrocode}
-%<*shared>
+%<*base>
\newcounter { g_@@_MCID_abs_int }
% \end{macrocode}
% \end{variable}
+% \begin{macro}{\@@_get_data_mc_counter:}
+% This command allows \cs{tag_get:n} to get the current
+% state of the mc counter with the keyword |mc_counter|.
+% By comparing the numbers it can be used to check the number of
+% structure commands in a piece of code.
+% \begin{macrocode}
+\cs_new:Npn \@@_get_data_mc_counter:
+ {
+ \int_use:N \c@g_@@_MCID_abs_int
+ }
+%</base>
+% \end{macrocode}
+% \end{macro}
%
-% \begin{macro}{\_@@_get_mc_abs_cnt:}
+%
+% \begin{macro}{\@@_get_mc_abs_cnt:}
% A (expandable) function to get the current value of the cnt.
+% TODO: duplicate of the previous one, this should be cleaned up.
% \begin{macrocode}
-\cs_new:Npn \_@@_get_mc_abs_cnt: { \int_use:N \c@g_@@_MCID_abs_int }
+%<*shared>
+\cs_new:Npn \@@_get_mc_abs_cnt: { \int_use:N \c@g_@@_MCID_abs_int }
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{variable}{\g_@@_MCID_tmp_bypage_int}
% The following hold the temporary by page number assigned to a mc.
% It must be defined in the shared code to avoid problems with labels.
@@ -362,7 +385,13 @@
%</shared>
% \end{macrocode}
% \end{macro}
-%
+% \begin{macro}{\tag_mc_reset_box:N}
+% This allows to reset the mc-attributes in box. On base and generic mode it should do
+% nothing.
+% \begin{macrocode}
+%<base>\cs_new_protected:Npn \tag_mc_reset_box:N #1 {}
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\tag_mc_end_push:, \tag_mc_begin_pop:n}
%
% \begin{macrocode}
@@ -410,7 +439,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% \subsection{Keys}
% This are the keys where the code can be shared between the modes.
%
diff --git a/macros/latex/contrib/tagpdf/tagpdf-roles.dtx b/macros/latex/contrib/tagpdf/tagpdf-roles.dtx
index 5876c4ba32..fcfd5f7534 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-roles.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-roles.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98h, released 2023-06-06}
+% \date{Version 0.98i, released 2023-06-14}
% \maketitle
% \begin{documentation}
% \begin{function}
@@ -98,7 +98,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-roles-code} {2023-06-06} {0.98h}
+\ProvidesExplPackage {tagpdf-roles-code} {2023-06-14} {0.98i}
{part of tagpdf - code related to roles and structure names}
%</header>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-space.dtx b/macros/latex/contrib/tagpdf/tagpdf-space.dtx
index 6e751618ee..e6b5e02513 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-space.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-space.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98h, released 2023-06-06}
+% \date{Version 0.98i, released 2023-06-14}
% \maketitle
% \begin{documentation}
% \begin{function}{interwordspace (setup-key)}
@@ -64,7 +64,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-space-code} {2023-06-06} {0.98h}
+\ProvidesExplPackage {tagpdf-space-code} {2023-06-14} {0.98i}
{part of tagpdf - code related to real space chars}
%</header>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-struct.dtx b/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
index 542671bd15..d2bb7a2b08 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98h, released 2023-06-06}
+% \date{Version 0.98i, released 2023-06-14}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
@@ -247,7 +247,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-struct-code} {2023-06-06} {0.98h}
+\ProvidesExplPackage {tagpdf-struct-code} {2023-06-14} {0.98i}
{part of tagpdf - code related to storing structure}
%</header>
% \end{macrocode}
@@ -978,6 +978,20 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@@_get_data_struct_counter:}
+% this command allows \cs{tag_get:n} to get the current
+% state of the structure counter with the keyword |struct_counter|.
+% By comparing the numbers it can be used to check the number of
+% structure commands in a piece of code.
+% \begin{macrocode}
+%<*base>
+\cs_new:Npn \@@_get_data_struct_counter:
+ {
+ \int_use:N \c@g_@@_struct_abs_int
+ }
+%</base>
+% \end{macrocode}
+% \end{macro}
% \section{Keys}
% This are the keys for the user commands.
% we store the tag in a variable. But we should be careful, it is only reliable
@@ -1726,7 +1740,7 @@
% \section{Attributes and attribute classes}
% \begin{macrocode}
%<*header>
-\ProvidesExplPackage {tagpdf-attr-code} {2023-06-06} {0.98h}
+\ProvidesExplPackage {tagpdf-attr-code} {2023-06-14} {0.98i}
{part of tagpdf - code related to attributes and attribute classes}
%</header>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-tree.dtx b/macros/latex/contrib/tagpdf/tagpdf-tree.dtx
index 61f6db544a..393a7c359f 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-tree.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-tree.dtx
@@ -47,13 +47,13 @@
% }^^A
% }
%
-% \date{Version 0.98h, released 2023-06-06}
+% \date{Version 0.98i, released 2023-06-14}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-tree-code} {2023-06-06} {0.98h}
+\ProvidesExplPackage {tagpdf-tree-code} {2023-06-14} {0.98i}
{part of tagpdf - code related to writing trees and dictionaries to the pdf}
%</header>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-user.dtx b/macros/latex/contrib/tagpdf/tagpdf-user.dtx
index 8ebd1813dd..be082172ef 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-user.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-user.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98h, released 2023-06-06}
+% \date{Version 0.98i, released 2023-06-14}
% \maketitle
% \begin{documentation}
% \section{Setup commands}
@@ -250,7 +250,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-user} {2023-06-06} {0.98h}
+\ProvidesExplPackage {tagpdf-user} {2023-06-14} {0.98i}
{tagpdf - user commands}
%</header>
% \end{macrocode}
@@ -517,6 +517,16 @@
% or do a first step to apply tagpdf commands to document commands.
% This part should be regularly revisited to check if the code should go to a
% better place or can be improved.
+%
+% \subsection{new ref system}
+% Until l3ref is in the kernel, we provide a definition for \cs{newlabeldata} in
+% the aux-file to avoid errors if a document switches between tagging and non-tagging.
+% \begin{macrocode}
+%</package>
+%<base>\AddToHook{begindocument}
+%<base> {\immediate\write\@mainaux{\string\providecommand\string\newlabeldata[2]{}}}
+%<*package>
+% \end{macrocode}
% \subsection{Document structure}
% \begin{macro}{\g_@@_root_default_tl,activate (setup-key)}
% \begin{macrocode}
@@ -840,9 +850,11 @@
\bool_gset_false:N \g_@@_in_mc_bool
}
\tag_mc_begin:n {artifact}
+ \tag_stop:n{headfoot}
}
\cs_new_protected:Npn \@@_exclude_headfoot_end:
{
+ \tag_start:n{headfoot}
\tag_mc_end:
\bool_if:NTF \g_@@_mode_lua_bool
{
@@ -869,10 +881,12 @@
}
\tag_struct_begin:n{tag=Artifact,attribute-class=@@/attr/#1}
\tag_mc_begin:n {artifact=#1}
+ \tag_stop:n{headfoot}
}
\cs_new_protected:Npn \@@_exclude_struct_headfoot_end:
{
+ \tag_start:n{headfoot}
\tag_mc_end:
\tag_struct_end:
\bool_if:NTF \g_@@_mode_lua_bool
diff --git a/macros/latex/contrib/tagpdf/tagpdf.dtx b/macros/latex/contrib/tagpdf/tagpdf.dtx
index b4c9e55090..b5898d0ed4 100644
--- a/macros/latex/contrib/tagpdf/tagpdf.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf.dtx
@@ -92,7 +92,7 @@
% \begin{macrocode}
%<@@=tag>
%<*package>
-\ProvidesExplPackage {tagpdf} {2023-06-06} {0.98h}
+\ProvidesExplPackage {tagpdf} {2023-06-14} {0.98i}
{ A package to experiment with pdf tagging }
\bool_if:nF
@@ -118,7 +118,7 @@
% \end{macrocode}
%<*debug>
% \begin{macrocode}
-\ProvidesExplPackage {tagpdf-debug} {2023-06-06} {0.98h}
+\ProvidesExplPackage {tagpdf-debug} {2023-06-14} {0.98i}
{ debug code for tagpdf }
\@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput}
% \end{macrocode}
@@ -141,7 +141,7 @@
% we define a base package with dummy functions
% \begin{macrocode}
%<*base>
-\ProvidesExplPackage {tagpdf-base} {2023-06-06} {0.98h}
+\ProvidesExplPackage {tagpdf-base} {2023-06-14} {0.98i}
{part of tagpdf - provide base, no-op versions of the user commands }
%</base>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf.pdf b/macros/latex/contrib/tagpdf/tagpdf.pdf
index a75c6a78db..329b97b8a5 100644
--- a/macros/latex/contrib/tagpdf/tagpdf.pdf
+++ b/macros/latex/contrib/tagpdf/tagpdf.pdf
Binary files differ
diff --git a/macros/latex/contrib/tagpdf/tagpdf.tex b/macros/latex/contrib/tagpdf/tagpdf.tex
index 27cd1d128d..1ee0abb181 100644
--- a/macros/latex/contrib/tagpdf/tagpdf.tex
+++ b/macros/latex/contrib/tagpdf/tagpdf.tex
@@ -16,8 +16,8 @@
}
\DebugBlocksOff
\makeatletter
-\def\UlrikeFischer@package@version{0.98h}
-\def\UlrikeFischer@package@date{2023-06-06}
+\def\UlrikeFischer@package@version{0.98i}
+\def\UlrikeFischer@package@date{2023-06-14}
\makeatother
\documentclass[bibliography=totoc,a4paper]{article}
@@ -298,6 +298,9 @@ structures can be inspected and be compared by the l3build checks.%
\section{Changes}
+
+This section lists only important changes. More can be found in the \texttt{CHANGELOG.MD} and by checking the git commits.
+
\subsection{Changes in 0.3}
@@ -509,12 +512,6 @@ added. The ID of a structure can be retrieved with |\tag_get:n|
see~\ref{sec:retrieve}.
-\subsection{Changes in version 0.98d}
-The main change is from now on every structure has an ID and an IDtree is
-added. The ID of a structure can be retrieved with |\tag_get:n|
-see~\ref{sec:retrieve}.
-
-
\subsection{Changes in version 0.98e}
\begin{itemize}
@@ -1211,16 +1208,30 @@ In \emph{generic mode}, where marked content command shouldn't be nested, it wor
In \emph{lua mode} it tests if the mc-attribute is currently unset. You can't test the nesting level with it!
+
+
+\begin{docCommand}{tag_mc_reset_box:N}{\marg{box}}\end{docCommand}
+
+In lua mode this command will process the given box and reset all mc related attributes in the box to the current values.
+This means that if the box is used all its contents will be a kid of the current structure.
+This should (probably) only be used on boxes which don't contain tagging commands.
+See below section~\ref{sec:savebox} for more details.
+
+
\subsubsection{Retrieving data} \label{sec:retrieve}
With more elaborate tagging the need arise to retrieve and store current data.
\begin{docCommand}{tag_get:n}{\marg{key word}}\end{docCommand}
-This (expandable) command give back some variables. Currently the working key words are \verb+mc_tag+, \verb+struct_tag+,
-\verb+struct_id+ and \verb+struct_num+. The ID is a string and returned including parentheses.
-\verb+struct_num+ returns a number and works also if only \pkg{tagpdf-base} has been loaded, but then doesn't give the same output: if \pkg{tagpdf} is loaded and tagging is active, \verb+struct_num+ gives the number of currently
-active structure, so it reverts to the parent number if a structure is closed. If only \pkg{tagpdf-base} is loaded
-nesting of structure is not tracked and so the command gives back the number of the last structure that has been created.
+This (expandable) command give back some variables. Currently the working key words are
+\begin{itemize}
+\item \verb+mc_tag+: the tag name of the current mc-chunk
+\item \verb+struct_tag+: the tag name of the current structure
+\item \verb+struct_id+: The ID of the current structure. This is a string and is returned including parentheses.
+\item \verb+struct_num+: This returns a number and works also if only \pkg{tagpdf-base} has been loaded, but then doesn't give the same output: if \pkg{tagpdf} is loaded and tagging is active, \verb+struct_num+ gives the number of currently active structure, so it reverts to the parent number if a structure is closed. If only \pkg{tagpdf-base} is loaded nesting of structure is not tracked and so the command gives back the number of the last structure that has been created.
+\item \verb+struct_counter+: This returns a number and works also if only \pkg{tagpdf-base} has been loaded. It gives back the state of the absolute structure counter and so number of the last structure that has been created. This can be used to detect if in a piece of code there are structure commands. Be aware that this is a \LaTeX{} counter and so reset in some places.
+\item \verb+mc_counter+: This returns a number and works also if only \pkg{tagpdf-base} has been loaded. It gives back the state of the absolute mc-counter and so number of the last mc-chunk that has been created. This can be used to detect if in a piece of code there are mc-commands.
+\end{itemize}
\subsubsection{Luamode: global or not global -- that is the question}\label{sec:global-local}
@@ -2209,7 +2220,7 @@ This is in pdftex a primitive. It inserts the dummy space glyph. \pkg{tagpdf} de
necessary to surround destinations with a dummy structure (a Span or an
Artifact) to get the right page number.
-
+\section{Storing and reusing boxes}\label{sec:savebox}
\section{Accessibility is not only tagging}
diff --git a/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty b/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty
index 4f14e73b1a..0628a46660 100644
--- a/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty
+++ b/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty
@@ -1,5 +1,5 @@
%\RequirePackage[enable-debug]{expl3}[2018/06/14]
-\ProvidesExplPackage {tagpdfdocu-patches} {2023-06-06} {0.98h}
+\ProvidesExplPackage {tagpdfdocu-patches} {2023-06-14} {0.98i}
{patches/commands for the tagpdf documentation}
\RequirePackage{etoolbox,xpatch}