texlive[67136] Master/texmf-dist: tagpdf (16may23)

commits+karl at tug.org commits+karl at tug.org
Tue May 16 22:22:46 CEST 2023


Revision: 67136
          http://tug.org/svn/texlive?view=revision&revision=67136
Author:   karl
Date:     2023-05-16 22:22:46 +0200 (Tue, 16 May 2023)
Log Message:
-----------
tagpdf (16may23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/tagpdf/README.md
    trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf-code.pdf
    trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf.pdf
    trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf.tex
    trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx
    trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx
    trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx
    trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx
    trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx
    trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx
    trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx
    trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx
    trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx
    trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx
    trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx
    trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx
    trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty
    trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug-generic.sty
    trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug.sty
    trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def
    trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty
    trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-lua.sty
    trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-book.def
    trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-inline.def
    trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex.def
    trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-mathml.def
    trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf.def
    trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf2.def
    trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child-2.csv
    trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child.csv
    trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf.lua
    trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty
    trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty

Modified: trunk/Master/texmf-dist/doc/latex/tagpdf/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tagpdf/README.md	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/doc/latex/tagpdf/README.md	2023-05-16 20:22:46 UTC (rev 67136)
@@ -1,6 +1,6 @@
 #tagpdf — A package to create tagged pdf
-Packageversion: 0.98f 
-Packagedate: 2023/04/24
+Packageversion: 0.98g 
+Packagedate: 2023/05/16
 Author: Ulrike Fischer
 
 ## License

Modified: trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf-code.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf.tex	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf.tex	2023-05-16 20:22:46 UTC (rev 67136)
@@ -15,8 +15,8 @@
  }
 \DebugBlocksOff
 \makeatletter
-\def\UlrikeFischer at package@version{0.98f}
-\def\UlrikeFischer at package@date{2023-04-24}
+\def\UlrikeFischer at package@version{0.98g}
+\def\UlrikeFischer at package@date{2023-05-16}
 \makeatother
 
 \documentclass[DIV=12,parskip=half-,bibliography=totoc,a4paper]{article}
@@ -558,6 +558,7 @@
  {
   % testphase = phase-I, % tagging without paragraph tagging
   testphase = phase-II % tagging with paragraph tagging and other new stuff.
+  % testphase = phase-III % tagging with paragraph sec, toc, block tagging and more
   % pdfversion = 2.0   % pdfversion must be set here.
  }
 \documentclass{article}
@@ -566,10 +567,26 @@
 \end{document}
 \end{taglstlisting}
 
-\minisec{Activation needed!}
+\minisec{Deactivation}
 
-It is not recommended anymore, but 
-the package can also be loaded normally with |\usepackage| (but it is
+When loading \pkg{tagpdf} through the \texttt{testphase} keys, it is automatically activated. 
+To deactivate it while still retaining all the other new code from the latex-lab testphase files,
+use in the preamble |\tagpdfsetup{activate-all=false}|. You can additionally also deactivate the 
+paratagging and the interword space code. 
+To suppress the loading of the package alltogether you can try
+
+\begin{taglstlisting}
+\makeatletter 
+\disable at package@load{tagpdf}{}
+\makeatother
+\DocumentMetadata{...}
+\end{taglstlisting}
+
+
+\minisec{Loading as package needs activation!}
+
+It is not recommended anymore, but the package can also be loaded normally with |\usepackage| 
+(but it is
 still required to use \cs{DocumentMetadata} to load the \PDF\ management) but
 it will then -- apart from loading more packages and defining a lot of things -- not do much. You will have to \emph{activate} it with \verb+\tagpdfsetup+.
 
@@ -1745,7 +1762,8 @@
 
 
 
-A document should have at least one structure which contains the whole document. A suitable tag is \texttt{Document} or \texttt{Article}. I'm considering to automatically inserting it.
+A document should have at least one structure which contains the whole document. A suitable tag is \texttt{Document}.
+Such a root is now always added automatically. Its type can be changed with the key \texttt{activate}. 
 
 
 

Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx	2023-05-16 20:22:46 UTC (rev 67136)
@@ -47,13 +47,13 @@
 %    }^^A
 % }
 %
-% \date{Version 0.98f, released 2023-04-24}
+% \date{Version 0.98g, released 2023-05-16}
 % \maketitle
 % \begin{implementation}
 %    \begin{macrocode}
 %<@@=tag>
 %<*luatex>
-\ProvidesExplFile {tagpdf-luatex.def} {2023-04-24} {0.98f}
+\ProvidesExplFile {tagpdf-luatex.def} {2023-05-16} {0.98g}
   {tagpdf~driver~for~luatex}
 %    \end{macrocode}
 % \section{Loading the lua}
@@ -158,8 +158,8 @@
 
 local ProvidesLuaModule = {
     name          = "tagpdf",
-    version       = "0.98f",       --TAGVERSION
-    date          = "2023-04-24", --TAGDATE
+    version       = "0.98g",       --TAGVERSION
+    date          = "2023-05-16", --TAGDATE
     description   = "tagpdf lua code",
     license       = "The LATEX Project Public License 1.3c"
 }

Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx	2023-05-16 20:22:46 UTC (rev 67136)
@@ -48,7 +48,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.98f, released 2023-04-24}
+% \date{Version 0.98g, released 2023-05-16}
 % \maketitle
 % \begin{documentation}
 % \section{Commands}
@@ -295,7 +295,7 @@
 %    \begin{macrocode}
 %<@@=tag>
 %<*header>
-\ProvidesExplPackage {tagpdf-checks-code} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf-checks-code} {2023-05-16} {0.98g}
  {part of tagpdf - code related to checks, conditionals, debugging and messages}
 %</header>
 %    \end{macrocode}
@@ -441,7 +441,7 @@
 %  parent tags.
 %    \begin{macrocode}
 \msg_new:nnn { tag } {role-parent-child} 
-  { Rule~'#1'~-->~'#2'~is~#3}
+  { Rule~'#1'~-->~'#2'~is~#3~\msg_line_context:}
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{role-parent-child}
@@ -633,7 +633,7 @@
     \prop_get:cnNT
       {g_@@_struct_\@@_ref_value:enn{tagpdfstruct-#1}{tagstruct}{unknown}_prop}
       {P}
-      \l_tmpa_tl
+      \l_@@_tmpa_tl
       {
         \msg_warning:nnn { tag } {struct-used-twice} {#1}
       }

Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx	2023-05-16 20:22:46 UTC (rev 67136)
@@ -47,7 +47,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.98f, released 2023-04-24}
+% \date{Version 0.98g, released 2023-05-16}
 % \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-04-24} {0.98f}
+%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-05-16} {0.98g}
 %% {latex} {https://www.latex-project.org/ns/dflt/2022}{}
 title,        Title,    pdf2,
 part,         Title,    pdf2,
@@ -92,7 +92,7 @@
 % It is bound to change
 %    \begin{macrocode}
 %<*ns-latex-book>
-%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-04-24} {0.98f}
+%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-05-16} {0.98g}
 %% {latex-book} {https://www.latex-project.org/ns/book/2022}{}
 chapter,       H1,pdf2,
 section,       H2,pdf2,
@@ -108,7 +108,7 @@
 % It is bound to change a lot!
 %    \begin{macrocode}
 %<*ns-latex-inline>
-%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-04-24} {0.98f}
+%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-05-16} {0.98g}
 %% {latex-inline} {https://www.latex-project.org/ns/inline/2022}{}
 chapter,       Span, pdf2,    
 section,       Span, pdf2,
@@ -122,7 +122,7 @@
 % \section{The pdf namespace data}
 %    \begin{macrocode}
 %<*ns-pdf>
-%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-04-24} {0.98f}
+%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-05-16} {0.98g}
 %%  {pdf}   {http://iso.org/pdf/ssn}{}
 StructTreeRoot,StructTreeRoot,pdf,D,
 Document,Document,pdf,D,   
@@ -190,7 +190,7 @@
 % \section{The pdf 2.0 namespace data}
 %    \begin{macrocode}
 %<*ns-pdf2>
-%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-04-24} {0.98f} 
+%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-05-16} {0.98g} 
 %%  {pdf2}  {http://iso.org/pdf2/ssn}{}
 Document,Document,pdf2,D,   
 Part,Part,pdf2,G,       
@@ -246,7 +246,7 @@
 % \section{The mathml namespace data}
 %    \begin{macrocode}
 %<*ns-mathml>
-%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-04-24} {0.98f}
+%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-05-16} {0.98g}
 % {mathml}{http://www.w3.org/1998/Math/MathML}{}
 abs,abs,mathml,
 and,and,mathml,
@@ -481,7 +481,7 @@
 % This will perhaps change in future.
 %    \begin{macrocode}
 %<*parent-child>
-%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-04-24} {0.98f}
+%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-05-16} {0.98g}
 ,,,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 @@
 % This will perhaps change in future.
 %    \begin{macrocode}
 %<*parent-child-2>
-%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-04-24} {0.98f}
+%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-05-16} {0.98g}
 ,,,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,∅

Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx	2023-05-16 20:22:46 UTC (rev 67136)
@@ -46,7 +46,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.98f, released 2023-04-24}
+% \date{Version 0.98g, released 2023-05-16}
 % \maketitle
 % \begin{documentation}
 % \end{documentation}
@@ -55,11 +55,11 @@
 %    \begin{macrocode}
 %<@@=tag>
 %<*generic>
-\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-05-16} {0.98g}
  {part of tagpdf - code related to marking chunks - generic mode}
 %</generic>
 %<*debug>
-\ProvidesExplPackage {tagpdf-debug-generic} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf-debug-generic} {2023-05-16} {0.98g}
  {part of tagpdf - debugging code related to marking chunks - generic mode}
 %</debug>
 %    \end{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx	2023-05-16 20:22:46 UTC (rev 67136)
@@ -46,7 +46,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.98f, released 2023-04-24}
+% \date{Version 0.98g, released 2023-05-16}
 % \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-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-05-16} {0.98g}
   {tagpdf - mc code only for the luamode }
 %</luamode>
 %    \end{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx	2023-05-16 20:22:46 UTC (rev 67136)
@@ -46,7 +46,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.98f, released 2023-04-24}
+% \date{Version 0.98g, released 2023-05-16}
 % \maketitle
 % \begin{documentation}
 % \section{Public Commands}
@@ -174,7 +174,7 @@
 %    \begin{macrocode}
 %<@@=tag>
 %<*header>
-\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-05-16} {0.98g}
   {part of tagpdf - code related to marking chunks -
    code shared by generic and luamode }
 %</header>

Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx	2023-05-16 20:22:46 UTC (rev 67136)
@@ -46,7 +46,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.98f, released 2023-04-24}
+% \date{Version 0.98g, released 2023-05-16}
 % \maketitle
 % \begin{documentation}
 % \begin{function}
@@ -98,7 +98,7 @@
 %    \begin{macrocode}
 %<@@=tag>
 %<*header>
-\ProvidesExplPackage {tagpdf-roles-code} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf-roles-code} {2023-05-16} {0.98g}
  {part of tagpdf - code related to roles and structure names}
 %</header>
 %    \end{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx	2023-05-16 20:22:46 UTC (rev 67136)
@@ -46,7 +46,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.98f, released 2023-04-24}
+% \date{Version 0.98g, released 2023-05-16}
 % \maketitle
 % \begin{documentation}
 % \begin{function}{interwordspace (setup-key)}
@@ -64,7 +64,7 @@
 %    \begin{macrocode}
 %<@@=tag>
 %<*header>
-\ProvidesExplPackage {tagpdf-space-code} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf-space-code} {2023-05-16} {0.98g}
  {part of tagpdf - code related to real space chars}
 %</header>
 %    \end{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx	2023-05-16 20:22:46 UTC (rev 67136)
@@ -46,7 +46,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.98f, released 2023-04-24}
+% \date{Version 0.98g, released 2023-05-16}
 % \maketitle
 % \begin{documentation}
 % \section{Public Commands}
@@ -247,7 +247,7 @@
 %    \begin{macrocode}
 %<@@=tag>
 %<*header>
-\ProvidesExplPackage {tagpdf-struct-code} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf-struct-code} {2023-05-16} {0.98g}
  {part of tagpdf - code related to storing structure}
 %</header>
 %    \end{macrocode}
@@ -303,14 +303,7 @@
 %    \end{macrocode}
 % \end{variable}
 %
-% \begin{variable}{\g_@@_struct_tag_NS_prop}
-% For the parent-child check, we need the tag and NS of every structure
-%    \begin{macrocode}
-\prop_new:N\g_@@_struct_tag_NS_prop
-%    \end{macrocode}
-% \end{variable}
 %
-%
 % \begin{variable}{\g_@@_struct_stack_current_tl,\l_@@_struct_stack_parent_tmpa_tl}
 % The global variable will hold the current structure number. It is already
 % defined in \texttt{tagpdf-base}.
@@ -516,16 +509,17 @@
   { parentrole }
   { {StructTreeRoot}{pdf} }
 
-\prop_gput:Nnn \g_@@_struct_tag_NS_prop {0}{{StructTreeRoot}{pdf}}
 %    \end{macrocode}
-% Namespaces are pdf 2.0 but it doesn't harm
-% to have an empty entry. We could add a test, but if the code moves into
-% the kernel, timing could get tricky.
+% Namespaces are pdf 2.0.
+% If the code moves into the kernel, the setting must be probably delayed.
 %    \begin{macrocode}
-\@@_prop_gput:cnx
-  { g_@@_struct_0_prop }
-  { Namespaces }
-  { \pdf_object_ref:n { @@/tree/namespaces } }
+\pdf_version_compare:NnF < {2.0}
+ {
+   \@@_prop_gput:cnx
+    { g_@@_struct_0_prop }
+    { Namespaces }
+    { \pdf_object_ref:n { @@/tree/namespaces } }
+ }   
 %    \end{macrocode}
 % \end{variable}
 % 
@@ -562,7 +556,6 @@
          { g_@@_struct_#1_prop }         
          { S }
          { \pdf_name_from_unicode_e:n {#2}  } %
-       \prop_gput:Nnn \g_@@_struct_tag_NS_prop {#1}{{#2}{#3}}  
      }
  }     
  {     
@@ -579,7 +572,6 @@
              { NS }
              { \l_@@_get_tmpc_tl } %
          }
-       \prop_gput:Nnn \g_@@_struct_tag_NS_prop {#1}{{#2}{#3}}   
      } 
  }     
 \cs_generate_variant:Nn \@@_struct_set_tag_info:nnn {eVV}
@@ -1553,7 +1545,75 @@
 %</package>
 %    \end{macrocode}
 % \end{macro}
-%
+% \begin{macro}{\tag_struct_use_num:n}
+% This command allows to use a stashed structure in another place.
+% differently to the previous command it doesn't use a label but directly 
+% a structure number to find the parent.
+% TODO: decide how it should be guarded. Probably by the struct-check.
+%    \begin{macrocode}
+%<base>\cs_new_protected:Npn \tag_struct_use_num:n #1 {}
+%<*package>
+\cs_set_protected:Npn \tag_struct_use_num:n #1 %#1 is structure number
+  { 
+    \@@_check_if_active_struct:T
+      {
+        \prop_if_exist:cTF
+          { g_@@_struct_#1_prop } %
+          {
+            \prop_get:cnNT
+              {g_@@_struct_#1_prop}
+              {P}
+              \l_@@_tmpa_tl
+              {
+                \msg_warning:nnn { tag } {struct-used-twice} {#1}
+              }
+            %add the label structure as kid to the current structure (can be the root)
+            \@@_struct_kid_struct_gput_right:xx
+              { \g_@@_struct_stack_current_tl }
+              { #1 }
+            %add the current structure to the labeled one as parents
+            \@@_prop_gput:cnx
+              { g_@@_struct_#1_prop }
+              { P }
+              {
+                \pdf_object_ref:e { @@/struct/\g_@@_struct_stack_current_tl }
+              }
+%    \end{macrocode}
+%   check if the tag is allowed as child. Here we have to retrieve the 
+%   tag info for the child, while the data for the parent is in 
+%   the global tl-vars:
+%    \begin{macrocode}
+             \@@_struct_get_parentrole:eNN  
+              {#1}
+              \l_@@_tmpa_tl
+              \l_@@_tmpb_tl
+            \@@_check_parent_child:VVVVN
+              \g_@@_struct_tag_tl               
+              \g_@@_struct_tag_NS_tl  
+              \l_@@_tmpa_tl
+              \l_@@_tmpb_tl               
+              \l_@@_parent_child_check_tl             
+            \int_compare:nNnT {\l_@@_parent_child_check_tl}<0
+              {
+                \cs_set_eq:NN \l_@@_role_remap_tag_tl \g_@@_struct_tag_tl 
+                \cs_set_eq:NN \l_@@_role_remap_NS_tl \g_@@_struct_tag_NS_tl               
+                \@@_role_remap:
+                \cs_gset_eq:NN \g_@@_struct_tag_tl \l_@@_role_remap_tag_tl 
+                \cs_gset_eq:NN  \g_@@_struct_tag_NS_tl \l_@@_role_remap_NS_tl
+                \@@_struct_set_tag_info:eVV 
+                  { \int_eval:n {\c at g_@@_struct_abs_int} }
+                    \g_@@_struct_tag_tl               
+                    \g_@@_struct_tag_NS_tl                                 
+              }
+          }
+          {
+            \msg_warning:nnn{ tag }{struct-label-unknown}{#1}
+          }
+      }
+  }
+%</package>
+%    \end{macrocode}
+% \end{macro}
 % \begin{macro}[EXP]{\tag_struct_object_ref:n}
 % This is a command that allows to reference a structure. The argument is the
 % number which can be get for the current structure with |\tag_get:n{struct_num}|
@@ -1643,7 +1703,7 @@
 % \section{Attributes and attribute classes}
 %    \begin{macrocode}
 %<*header>
-\ProvidesExplPackage {tagpdf-attr-code} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf-attr-code} {2023-05-16} {0.98g}
   {part of tagpdf - code related to attributes and attribute classes}
 %</header>
 %    \end{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx	2023-05-16 20:22:46 UTC (rev 67136)
@@ -47,13 +47,13 @@
 %    }^^A
 % }
 %
-% \date{Version 0.98f, released 2023-04-24}
+% \date{Version 0.98g, released 2023-05-16}
 % \maketitle
 % \begin{implementation}
 %    \begin{macrocode}
 %<@@=tag>
 %<*header>
-\ProvidesExplPackage {tagpdf-tree-code} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf-tree-code} {2023-05-16} {0.98g}
  {part of tagpdf - code related to writing trees and dictionaries to the pdf}
 %</header>
 %    \end{macrocode}
@@ -310,7 +310,7 @@
 % This is the main command to assemble the page related entries of the parent tree.
 % It wanders through the pages and the mcid numbers and collects all mcid of one page.
 %    \begin{macrocode}
-
+\cs_new_protected:Npn \@@_tree_parenttree_rerun_msg: {}
 \cs_new_protected:Npn \@@_tree_fill_parenttree:
   {
     \int_step_inline:nnnn{1}{1}{\@@_ref_value_lastpage:nn{abspage}{-1}} %not quite clear if labels are needed. See lua code
@@ -350,7 +350,10 @@
                   }
               }
               {
-                \msg_warning:nn { tag } {tree-mcid-index-wrong}
+                \cs_set_protected:Npn \@@_tree_parenttree_rerun_msg:
+                 {
+                   \msg_warning:nn { tag } {tree-mcid-index-wrong}
+                 }   
               }
           }
         \tl_put_right:Nn
@@ -396,6 +399,7 @@
       {
         \@@_tree_fill_parenttree:
       }
+    \@@_tree_parenttree_rerun_msg:  
     \tl_put_right:NV \l_@@_parenttree_content_tl\g_@@_parenttree_objr_tl
     \pdf_object_write:nnx  { @@/tree/parenttree }{dict}
       {

Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx	2023-05-16 20:22:46 UTC (rev 67136)
@@ -46,7 +46,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.98f, released 2023-04-24}
+% \date{Version 0.98g, released 2023-05-16}
 % \maketitle
 % \begin{documentation}
 % \section{Setup commands}
@@ -250,7 +250,7 @@
 %    \begin{macrocode}
 %<@@=tag>
 %<*header>
-\ProvidesExplPackage {tagpdf-user} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf-user} {2023-05-16} {0.98g}
   {tagpdf - user commands}
 %</header>
 %    \end{macrocode}
@@ -513,28 +513,30 @@
 %
 % \section{Commands to extend document commands}
 % The following commands and code parts are not core command of tagpdf.
-% The either provide work arounds for missing functionality elsewhere,
+% They either provide work-arounds for missing functionality elsewhere,
 % 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{Document structure}
-% \begin{macro}{\@@_add_document_structure:n,activate (setup-key)}
+% \begin{macro}{\g_@@_root_default_tl,activate (setup-key)}
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_add_document_structure:n #1
- {
-   \hook_gput_code:nnn{begindocument}{tagpdf}{\tagstructbegin{tag=#1}}
-   \hook_gput_code:nnn{tagpdf/finish/before}{tagpdf}{\tagstructend}
- }
+\tl_new:N\g_@@_root_default_tl
+\tl_gset:Nn\g_@@_root_default_tl {Document}
+
+\hook_gput_code:nnn{begindocument}{tagpdf}{\tagstructbegin{tag=\g_@@_root_default_tl}}
+\hook_gput_code:nnn{tagpdf/finish/before}{tagpdf}{\tagstructend}
+
 \keys_define:nn { @@ / setup}
- {
-   activate   .code:n =
+ {    
+   activate  .code:n =
     {
       \keys_set:nn { @@ / setup }
         { activate-mc,activate-tree,activate-struct }
-      \@@_add_document_structure:n {#1}
+      \tl_gset:Nn\g_@@_root_default_tl {#1}  
     },
-  activate .default:n = Document
+   activate .default:n = Document
  }
+ 
 %    \end{macrocode}
 % \end{macro}
 % \subsection{Structure destinations}
@@ -563,7 +565,7 @@
 % \subsection{Fake space}
 % \begin{macro}{\pdffakespace}
 % We need a luatex variant for |\pdffakespace|. This should probably go into
-% the kernel at some time.
+% the kernel at some time. We also provide a no-op version for dvi mode
 %    \begin{macrocode}
 \sys_if_engine_luatex:T
   {
@@ -572,6 +574,7 @@
        \@@_fakespace:
      }
   }
+\providecommand\pdffakespace{}  
 %    \end{macrocode}
 % \end{macro}
 %
@@ -697,26 +700,35 @@
          }
       }
   }
+%    \end{macrocode}
+% We check the para count at the end. If tagging is not active it is not a error,
+% but we issue a warning as it perhaps indicates that the testphase code didn't guard
+% everything correctly.
+%    \begin{macrocode}
 \AddToHook{enddocument/info}
   {
+    \tag_if_active:F
+      {
+        \msg_redirect_name:nnn { tag } { para-hook-count-wrong } { warning }
+      }  
     \int_compare:nNnF {\g_@@_para_main_begin_int}={\g_@@_para_main_end_int}
-      {
-        \msg_error:nnxxx
-          {tag}
-          {para-hook-count-wrong}
-          {\int_use:N\g_@@_para_main_begin_int}
-          {\int_use:N\g_@@_para_main_end_int}
-          {text-unit}
-      }
+         {
+           \msg_error:nnxxx
+             {tag}
+             {para-hook-count-wrong}
+             {\int_use:N\g_@@_para_main_begin_int}
+             {\int_use:N\g_@@_para_main_end_int}
+             {text-unit}
+         }
     \int_compare:nNnF {\g_@@_para_begin_int}={\g_@@_para_end_int}
-      {
-        \msg_error:nnxxx
-          {tag}
-          {para-hook-count-wrong}
-          {\int_use:N\g_@@_para_begin_int}
-          {\int_use:N\g_@@_para_end_int}
-          {text}
-      }
+         {
+           \msg_error:nnxxx
+             {tag}
+             {para-hook-count-wrong}
+             {\int_use:N\g_@@_para_begin_int}
+             {\int_use:N\g_@@_para_end_int}
+             {text}
+         }  
   }
 %    \end{macrocode}
 % In generic mode we need the additional code from the ptagging tests.

Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx	2023-05-16 20:22:46 UTC (rev 67136)
@@ -36,7 +36,7 @@
 % \begin{function}{ \tag_stop_group_begin:, \tag_stop_group_end:,
 %  \tag_stop:, \tag_start: }
 % We need commands to stop tagging in some places.
-% There simply switches the two local booleans. The grouping commands
+% They simply switches the two local booleans. The grouping commands
 % can be used to group the effect.
 % \end{function}
 %
@@ -92,7 +92,7 @@
 %    \begin{macrocode}
 %<@@=tag>
 %<*package>
-\ProvidesExplPackage {tagpdf} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf} {2023-05-16} {0.98g}
   { A package to experiment with pdf tagging }
 
 \bool_if:nF
@@ -118,7 +118,7 @@
 %    \end{macrocode}
 %<*debug>
 %    \begin{macrocode}
-\ProvidesExplPackage {tagpdf-debug} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf-debug} {2023-05-16} {0.98g}
   { 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-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf-base} {2023-05-16} {0.98g}
   {part of tagpdf - provide base, no-op versions of the user commands }
 %</base>
 %    \end{macrocode} 

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty	2023-05-16 20:22:46 UTC (rev 67136)
@@ -25,7 +25,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf.dtx
-\ProvidesExplPackage {tagpdf-base} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf-base} {2023-05-16} {0.98g}
   {part of tagpdf - provide base, no-op versions of the user commands }
 \AddToHook{begindocument}
  {
@@ -69,6 +69,7 @@
 \cs_new_protected:Npn \tag_struct_end:{}
 \cs_new_protected:Npn \tag_struct_end:n{}
 \cs_new_protected:Npn \tag_struct_use:n #1 {}
+\cs_new_protected:Npn \tag_struct_use_num:n #1 {}
 
 %% File: tagpdf-checks.dtx
 \cs_new:Npn \tag_get:n #1   { \use:c {__tag_get_data_#1: } }

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug-generic.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug-generic.sty	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug-generic.sty	2023-05-16 20:22:46 UTC (rev 67136)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-mc-generic.dtx
-\ProvidesExplPackage {tagpdf-debug-generic} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf-debug-generic} {2023-05-16} {0.98g}
  {part of tagpdf - debugging code related to marking chunks - generic mode}
 \cs_set_protected:Npn \tag_mc_begin:n #1 %#1 keyval
   {

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug.sty	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug.sty	2023-05-16 20:22:46 UTC (rev 67136)
@@ -26,7 +26,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf.dtx
-\ProvidesExplPackage {tagpdf-debug} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf-debug} {2023-05-16} {0.98g}
   { debug code for tagpdf }
 \@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput}
 \prop_gput:Nnn \g_msg_module_type_prop { tag / debug} {}

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def	2023-05-16 20:22:46 UTC (rev 67136)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-backend.dtx
-\ProvidesExplFile {tagpdf-luatex.def} {2023-04-24} {0.98f}
+\ProvidesExplFile {tagpdf-luatex.def} {2023-05-16} {0.98g}
   {tagpdf~driver~for~luatex}
 {
   \fontencoding{TU}\fontfamily{lmr}\fontseries{m}\fontshape{n}\fontsize{10pt}{10pt}\selectfont

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty	2023-05-16 20:22:46 UTC (rev 67136)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-mc-generic.dtx
-\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-05-16} {0.98g}
  {part of tagpdf - code related to marking chunks - generic mode}
 \__tag_prop_new:N \g__tag_MCID_byabspage_prop
 

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-lua.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-lua.sty	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-lua.sty	2023-05-16 20:22:46 UTC (rev 67136)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-mc-luacode.dtx
-\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-05-16} {0.98g}
   {tagpdf - mc code only for the luamode }
 \hook_gput_code:nnn{begindocument}{tagpdf/mc}
   {

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-book.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-book.def	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-book.def	2023-05-16 20:22:46 UTC (rev 67136)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-04-24} {0.98f}
+%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-05-16} {0.98g}
 %% {latex-book} {https://www.latex-project.org/ns/book/2022}{}
 chapter,       H1,pdf2,
 section,       H2,pdf2,

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-inline.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-inline.def	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-inline.def	2023-05-16 20:22:46 UTC (rev 67136)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-04-24} {0.98f}
+%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-05-16} {0.98g}
 %% {latex-inline} {https://www.latex-project.org/ns/inline/2022}{}
 chapter,       Span, pdf2,
 section,       Span, pdf2,

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex.def	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex.def	2023-05-16 20:22:46 UTC (rev 67136)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-04-24} {0.98f}
+%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-05-16} {0.98g}
 %% {latex} {https://www.latex-project.org/ns/dflt/2022}{}
 title,        Title,    pdf2,
 part,         Title,    pdf2,

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-mathml.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-mathml.def	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-mathml.def	2023-05-16 20:22:46 UTC (rev 67136)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-04-24} {0.98f}
+%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-05-16} {0.98g}
 abs,abs,mathml,
 and,and,mathml,
 annotation,annotation,mathml,

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf.def	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf.def	2023-05-16 20:22:46 UTC (rev 67136)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-04-24} {0.98f}
+%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-05-16} {0.98g}
 %%  {pdf}   {http://iso.org/pdf/ssn}{}
 StructTreeRoot,StructTreeRoot,pdf,D,
 Document,Document,pdf,D,

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf2.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf2.def	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf2.def	2023-05-16 20:22:46 UTC (rev 67136)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-04-24} {0.98f}
+%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-05-16} {0.98g}
 %%  {pdf2}  {http://iso.org/pdf2/ssn}{}
 Document,Document,pdf2,D,
 Part,Part,pdf2,G,

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child-2.csv
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child-2.csv	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child-2.csv	2023-05-16 20:22:46 UTC (rev 67136)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-04-24} {0.98f}
+%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-05-16} {0.98g}
 ,,,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,∅

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child.csv
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child.csv	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child.csv	2023-05-16 20:22:46 UTC (rev 67136)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-04-24} {0.98f}
+%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-05-16} {0.98g}
 ,,,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,∅,∅

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf.lua	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf.lua	2023-05-16 20:22:46 UTC (rev 67136)
@@ -24,8 +24,8 @@
 
 local ProvidesLuaModule = {
     name          = "tagpdf",
-    version       = "0.98f",       --TAGVERSION
-    date          = "2023-04-24", --TAGDATE
+    version       = "0.98g",       --TAGVERSION
+    date          = "2023-05-16", --TAGDATE
     description   = "tagpdf lua code",
     license       = "The LATEX Project Public License 1.3c"
 }

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty	2023-05-16 20:22:46 UTC (rev 67136)
@@ -28,7 +28,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf.dtx
-\ProvidesExplPackage {tagpdf} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdf} {2023-05-16} {0.98g}
   { A package to experiment with pdf tagging }
 
 \bool_if:nF
@@ -303,7 +303,7 @@
 \msg_new:nnn { tag } {role-unknown}     { role~#1~is~not~known  }
 \msg_new:nnn { tag } {role-unknown-tag} { tag~#1~is~not~known  }
 \msg_new:nnn { tag } {role-parent-child}
-  { Rule~'#1'~-->~'#2'~is~#3}
+  { Rule~'#1'~-->~'#2'~is~#3~\msg_line_context:}
 \msg_new:nnn { tag } {role-remapping}
   { remapping~tag~to~#1 }
 \msg_new:nnn { tag } {role-tag}         { mapping~tag~#1~to~role~#2  }
@@ -389,7 +389,7 @@
     \prop_get:cnNT
       {g__tag_struct_\__tag_ref_value:enn{tagpdfstruct-#1}{tagstruct}{unknown}_prop}
       {P}
-      \l_tmpa_tl
+      \l__tag_tmpa_tl
       {
         \msg_warning:nnn { tag } {struct-used-twice} {#1}
       }
@@ -856,7 +856,7 @@
       }
   }
 \tl_new:N \l__tag_parenttree_content_tl
-
+\cs_new_protected:Npn \__tag_tree_parenttree_rerun_msg: {}
 \cs_new_protected:Npn \__tag_tree_fill_parenttree:
   {
     \int_step_inline:nnnn{1}{1}{\__tag_ref_value_lastpage:nn{abspage}{-1}} %not quite clear if labels are needed. See lua code
@@ -896,7 +896,10 @@
                   }
               }
               {
-                \msg_warning:nn { tag } {tree-mcid-index-wrong}
+                \cs_set_protected:Npn \__tag_tree_parenttree_rerun_msg:
+                 {
+                   \msg_warning:nn { tag } {tree-mcid-index-wrong}
+                 }
               }
           }
         \tl_put_right:Nn
@@ -928,6 +931,7 @@
       {
         \__tag_tree_fill_parenttree:
       }
+    \__tag_tree_parenttree_rerun_msg:
     \tl_put_right:NV \l__tag_parenttree_content_tl\g__tag_parenttree_objr_tl
     \pdf_object_write:nnx  { __tag/tree/parenttree }{dict}
       {
@@ -1800,7 +1804,6 @@
 \seq_gpush:Nn \g__tag_struct_stack_seq {0}
 \seq_new:N    \g__tag_struct_tag_stack_seq
 \seq_gpush:Nn \g__tag_struct_tag_stack_seq {{Root}{StructTreeRoot}}
-\prop_new:N\g__tag_struct_tag_NS_prop
 \tl_new:N     \l__tag_struct_stack_parent_tmpa_tl
 
 \seq_const_from_clist:Nn \c__tag_struct_StructTreeRoot_entries_seq
@@ -1890,11 +1893,13 @@
   { parentrole }
   { {StructTreeRoot}{pdf} }
 
-\prop_gput:Nnn \g__tag_struct_tag_NS_prop {0}{{StructTreeRoot}{pdf}}
-\__tag_prop_gput:cnx
-  { g__tag_struct_0_prop }
-  { Namespaces }
-  { \pdf_object_ref:n { __tag/tree/namespaces } }
+\pdf_version_compare:NnF < {2.0}
+ {
+   \__tag_prop_gput:cnx
+    { g__tag_struct_0_prop }
+    { Namespaces }
+    { \pdf_object_ref:n { __tag/tree/namespaces } }
+ }
 \cs_new:Npn \__tag_struct_get_id:n #1 %#1=struct num
   {
     (
@@ -1915,7 +1920,6 @@
          { g__tag_struct_#1_prop }
          { S }
          { \pdf_name_from_unicode_e:n {#2}  } %
-       \prop_gput:Nnn \g__tag_struct_tag_NS_prop {#1}{{#2}{#3}}
      }
  }
  {
@@ -1932,7 +1936,6 @@
              { NS }
              { \l__tag_get_tmpc_tl } %
          }
-       \prop_gput:Nnn \g__tag_struct_tag_NS_prop {#1}{{#2}{#3}}
      }
  }
 \cs_generate_variant:Nn \__tag_struct_set_tag_info:nnn {eVV}
@@ -2646,6 +2649,59 @@
           }
       }
   }
+\cs_set_protected:Npn \tag_struct_use_num:n #1 %#1 is structure number
+  {
+    \__tag_check_if_active_struct:T
+      {
+        \prop_if_exist:cTF
+          { g__tag_struct_#1_prop } %
+          {
+            \prop_get:cnNT
+              {g__tag_struct_#1_prop}
+              {P}
+              \l__tag_tmpa_tl
+              {
+                \msg_warning:nnn { tag } {struct-used-twice} {#1}
+              }
+            %add the label structure as kid to the current structure (can be the root)
+            \__tag_struct_kid_struct_gput_right:xx
+              { \g__tag_struct_stack_current_tl }
+              { #1 }
+            %add the current structure to the labeled one as parents
+            \__tag_prop_gput:cnx
+              { g__tag_struct_#1_prop }
+              { P }
+              {
+                \pdf_object_ref:e { __tag/struct/\g__tag_struct_stack_current_tl }
+              }
+             \__tag_struct_get_parentrole:eNN
+              {#1}
+              \l__tag_tmpa_tl
+              \l__tag_tmpb_tl
+            \__tag_check_parent_child:VVVVN
+              \g__tag_struct_tag_tl
+              \g__tag_struct_tag_NS_tl
+              \l__tag_tmpa_tl
+              \l__tag_tmpb_tl
+              \l__tag_parent_child_check_tl
+            \int_compare:nNnT {\l__tag_parent_child_check_tl}<0
+              {
+                \cs_set_eq:NN \l__tag_role_remap_tag_tl \g__tag_struct_tag_tl
+                \cs_set_eq:NN \l__tag_role_remap_NS_tl \g__tag_struct_tag_NS_tl
+                \__tag_role_remap:
+                \cs_gset_eq:NN \g__tag_struct_tag_tl \l__tag_role_remap_tag_tl
+                \cs_gset_eq:NN  \g__tag_struct_tag_NS_tl \l__tag_role_remap_NS_tl
+                \__tag_struct_set_tag_info:eVV
+                  { \int_eval:n {\c at g__tag_struct_abs_int} }
+                    \g__tag_struct_tag_tl
+                    \g__tag_struct_tag_NS_tl
+              }
+          }
+          {
+            \msg_warning:nnn{ tag }{struct-label-unknown}{#1}
+          }
+      }
+  }
 \cs_new:Npn \tag_struct_object_ref:n #1
  {
    \pdf_object_ref:n {__tag/struct/#1}
@@ -3004,21 +3060,23 @@
     ,struct-stack / show .code:n = \seq_show:N \g__tag_struct_tag_stack_seq
     ,struct-stack .default:n = show
   }
-\cs_new_protected:Npn \__tag_add_document_structure:n #1
- {
-   \hook_gput_code:nnn{begindocument}{tagpdf}{\tagstructbegin{tag=#1}}
-   \hook_gput_code:nnn{tagpdf/finish/before}{tagpdf}{\tagstructend}
- }
+\tl_new:N\g__tag_root_default_tl
+\tl_gset:Nn\g__tag_root_default_tl {Document}
+
+\hook_gput_code:nnn{begindocument}{tagpdf}{\tagstructbegin{tag=\g__tag_root_default_tl}}
+\hook_gput_code:nnn{tagpdf/finish/before}{tagpdf}{\tagstructend}
+
 \keys_define:nn { __tag / setup}
  {
-   activate   .code:n =
+   activate  .code:n =
     {
       \keys_set:nn { __tag / setup }
         { activate-mc,activate-tree,activate-struct }
-      \__tag_add_document_structure:n {#1}
+      \tl_gset:Nn\g__tag_root_default_tl {#1}
     },
-  activate .default:n = Document
+   activate .default:n = Document
  }
+
 \AddToHook{begindocument/before}
   {
     \bool_lazy_all:nT
@@ -3040,6 +3098,7 @@
        \__tag_fakespace:
      }
   }
+\providecommand\pdffakespace{}
 \bool_new:N \l__tag_para_bool
 \bool_new:N \l__tag_para_show_bool
 \int_new:N  \g__tag_para_begin_int
@@ -3121,24 +3180,28 @@
   }
 \AddToHook{enddocument/info}
   {
-    \int_compare:nNnF {\g__tag_para_main_begin_int}={\g__tag_para_main_end_int}
+    \tag_if_active:F
       {
-        \msg_error:nnxxx
-          {tag}
-          {para-hook-count-wrong}
-          {\int_use:N\g__tag_para_main_begin_int}
-          {\int_use:N\g__tag_para_main_end_int}
-          {text-unit}
+        \msg_redirect_name:nnn { tag } { para-hook-count-wrong } { warning }
       }
+    \int_compare:nNnF {\g__tag_para_main_begin_int}={\g__tag_para_main_end_int}
+         {
+           \msg_error:nnxxx
+             {tag}
+             {para-hook-count-wrong}
+             {\int_use:N\g__tag_para_main_begin_int}
+             {\int_use:N\g__tag_para_main_end_int}
+             {text-unit}
+         }
     \int_compare:nNnF {\g__tag_para_begin_int}={\g__tag_para_end_int}
-      {
-        \msg_error:nnxxx
-          {tag}
-          {para-hook-count-wrong}
-          {\int_use:N\g__tag_para_begin_int}
-          {\int_use:N\g__tag_para_end_int}
-          {text}
-      }
+         {
+           \msg_error:nnxxx
+             {tag}
+             {para-hook-count-wrong}
+             {\int_use:N\g__tag_para_begin_int}
+             {\int_use:N\g__tag_para_end_int}
+             {text}
+         }
   }
 \AddToHook{begindocument/before}
  {

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty	2023-05-16 20:22:30 UTC (rev 67135)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty	2023-05-16 20:22:46 UTC (rev 67136)
@@ -1,5 +1,5 @@
 %\RequirePackage[enable-debug]{expl3}[2018/06/14]
-\ProvidesExplPackage {tagpdfdocu-patches} {2023-04-24} {0.98f}
+\ProvidesExplPackage {tagpdfdocu-patches} {2023-05-16} {0.98g}
  {patches/commands for the tagpdf documentation}
 \RequirePackage{etoolbox,xpatch}
 



More information about the tex-live-commits mailing list.