texlive[72314] Master/texmf-dist: tagpdf (17sep24)

commits+karl at tug.org commits+karl at tug.org
Tue Sep 17 21:56:02 CEST 2024


Revision: 72314
          https://tug.org/svn/texlive?view=revision&revision=72314
Author:   karl
Date:     2024-09-17 21:56:02 +0200 (Tue, 17 Sep 2024)
Log Message:
-----------
tagpdf (17sep24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/tagpdf/README.md
    trunk/Master/texmf-dist/doc/latex/tagpdf/ex-AF-file.pdf
    trunk/Master/texmf-dist/doc/latex/tagpdf/ex-alt-actualtext.pdf
    trunk/Master/texmf-dist/doc/latex/tagpdf/ex-attribute.pdf
    trunk/Master/texmf-dist/doc/latex/tagpdf/ex-formula-problem.pdf
    trunk/Master/texmf-dist/doc/latex/tagpdf/ex-list.pdf
    trunk/Master/texmf-dist/doc/latex/tagpdf/ex-mc-manual-para-split-obsolete.pdf
    trunk/Master/texmf-dist/doc/latex/tagpdf/ex-softhyphen.pdf
    trunk/Master/texmf-dist/doc/latex/tagpdf/ex-spaceglyph-listings.pdf
    trunk/Master/texmf-dist/doc/latex/tagpdf/ex-structure-obsolete.pdf
    trunk/Master/texmf-dist/doc/latex/tagpdf/ex-tagpdf-template.pdf
    trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf-code.pdf
    trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf-code.tex
    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-lua.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.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

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf-docelements.tex

Modified: trunk/Master/texmf-dist/doc/latex/tagpdf/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tagpdf/README.md	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/doc/latex/tagpdf/README.md	2024-09-17 19:56:02 UTC (rev 72314)
@@ -1,6 +1,6 @@
 #tagpdf — A package to create tagged pdf
-Packageversion: 0.99e 
-Packagedate: 2024/09/11
+Packageversion: 0.99f 
+Packagedate: 2024/09/16
 Author: Ulrike Fischer, LaTeX Project Team
 
 ## License

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

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

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

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

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

Modified: trunk/Master/texmf-dist/doc/latex/tagpdf/ex-mc-manual-para-split-obsolete.pdf
===================================================================
(Binary files differ)

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

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

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

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

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

Modified: trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf-code.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf-code.tex	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf-code.tex	2024-09-17 19:56:02 UTC (rev 72314)
@@ -28,9 +28,18 @@
 
 % The next line is needed so that \GetFileInfo will be able to pick up
 % version data.
+\usepackage{iftex}
+%until l3doc is corrected
+\ifluatex
+\usepackage[TU]{fontenc}
+\ttfamily
+  \DeclareFontShape{TU}{lmtt}{m}{it}
+   {<-> \UnicodeFontFile{lmmonoslant10-regular}{}}{}
+\fi
 \usepackage{longtable}
 \usepackage{tagpdf}
-\makeatletter
+
+\input{tagpdf-docelements}
 %\def\@setupverbvisiblespace{}
 %\def\verb{\relax\ifmmode\hbox\else\leavevmode\null\fi
 %  \bgroup
@@ -38,13 +47,12 @@
 %    \verbatim at font\@noligs
 %    \language\l at nohyphenation
 %    \@ifstar\@verb\@verb}
-\makeatother
 \begin{document}
 
 \GetFileInfo{tagpdf.sty}
 
 \title{%
-  \pkg{tagpdf} -- A package to experiment with pdf tagging%
+  \pkg{tagpdf} -- \LaTeX{} kernel code for PDF tagging%
   \thanks{This file describes \fileversion,
     last revised \filedate.}%
 }

Added: trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf-docelements.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf-docelements.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf-docelements.tex	2024-09-17 19:56:02 UTC (rev 72314)
@@ -0,0 +1,2 @@
+\ProvideDocElement[printtype=\textit{struct key},idxtype=key,idxgroup=Structure keys]{Structkeydecl}{structkeydecl} 
+\ProvideDocElement[printtype=\textit{setup key},idxtype=key,idxgroup=Setup keys]{Setupkeydecl}{setupkeydecl} 


Property changes on: trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf-docelements.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
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	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf.tex	2024-09-17 19:56:02 UTC (rev 72314)
@@ -16,8 +16,8 @@
  }
 \DebugBlocksOff
 \makeatletter
-\def\UlrikeFischer at package@version{0.99e}
-\def\UlrikeFischer at package@date{2024-09-11}
+\def\UlrikeFischer at package@version{0.99f}
+\def\UlrikeFischer at package@date{2024-09-16}
 \makeatother
 
 \documentclass[bibliography=totoc,a4paper]{article}
@@ -99,7 +99,7 @@
 
 The package is developed and improved in parallel with the code in the \pkg{latex-lab} 
 bundle (part of the core \LaTeX{} distribution),  the \pkg{pdfmanagement-testphase} 
-package (the \LaTeX{} PDF management bundle) and the L3 programming layer (part of of the \LaTeX{} format). 
+package (the \LaTeX{} PDF management bundle) and the L3 programming layer (part of the \LaTeX{} format). 
 That means you must ensure that all these components are up-to-date and in 
 sync which each other. 
 
@@ -1715,6 +1715,11 @@
       \cs{property\_ref:nn}\verb+{tagpdfstruct-label}{tagstruct}+ to retrieve 
       it. 
 
+  \item[\PrintKeyName{firstkid}]  If this key is used the structure is
+      added at the left of the kids of the parent structure (if the structure is not stashed). This means that it will be the first kid of the structure (unless some
+      later structure uses the key too). This can be needed e.g. for a caption as
+      the PDF reference requires it to be the first or last kid of its structure.
+      
   \item[\PrintKeyName{alt}] This key inserts an \texttt{/Alt} value in the 
       dictionary of structure object, see section~\ref{sec:alt}. The value 
       is handled as verbatim string and hex encoded. The value will be 
@@ -2059,37 +2064,50 @@
 
 \begin{docCommands}
  {
-  {doc name=tag_stop:},
-  {doc name=tag_start:},
-  {doc name=tagstop},
-  {doc name=tagstart},
-  {doc name=tag_stop:n,doc parameter=\marg{label}},
-  {doc name=tag_start:n,doc parameter=\marg{label}}
+  {doc name=tag_suspend:n,doc parameter=\marg{label}},
+  {doc name=tag_resume:n,doc parameter=\marg{label}} 
  } 
 \end{docCommands}
 
-This commands stop and start tagging in the current group by switching 
+These commands suspend and resume tagging in the current group by switching 
 \emph{local} booleans. They also stop the increasing of the counters which 
 keep track of paragraphs if the correct wrapper commands are used. 
 
 Restarting tagging is normally only needed if groups can't be used and then 
-must be done with care: |\tagstart| should normally only restart tagging if 
+must be done with care: |\tag_resume:n| should normally only restart tagging if 
 the corresponding stop command actually stopped tagging. This is implement 
 through a local counter which keeps track of the level.  
 
-The \meta{label} can be used to identify the command in debugging message. 
+The \meta{label} can be used to identify the command in debugging message. The label is not expanded and so can for example be a single command token.
 
+The commands are the L3-layer versions of |\SuspendTagging| and |\ResumeTagging|
+and will be available in the kernel with the 2024 november release. 
+
 \begin{taglstlisting}
-\tag_stop:n{outer}
+\tag_suspend:n{\outercommand}
  ...
- \tag_stop:n{inner}
+ \tag_suspend:n{\innercommand}
   ...
- \tag_start:n{inner}
+ \tag_resume:n{\innercommand}
  ...
-\tag_start:n{outer}
+\tag_resume:n{\outercommand}
 \end{taglstlisting} 
  
+\begin{docCommands}
+ {
+  {doc name=tag_stop:},
+  {doc name=tag_start:},
+  {doc name=tagstop},
+  {doc name=tagstart},
+  {doc name=tag_stop:n,doc parameter=\marg{label}},
+  {doc name=tag_start:n,doc parameter=\marg{label}}
+ }
+\end{docCommands}  
 
+These commands are now deprecated in favor or |\tag_suspend:n| and |\tag_resume:n| 
+but are still provided for some time. 
+
+
 \subsection{Lazy and automatic tagging}\label{sec:lazy}
 
 
@@ -3050,7 +3068,11 @@
 compilations. The new code requires a current pdfmanagement-testphase and 
 is then used automatically if the new engines are detected. 
 
-\subsection{}
+\subsection{Changes in version 0.99f}
+
+Deprecated |\tag_start:|, |\tag_stop:|, |\tag_stop:n| and 
+|\tag_start:n| in favor of |\tag_suspend:n| and |\tag_resume:n|.
+
 \printbibliography[heading=bibintoc]
 
 

Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx	2024-09-17 19:56:02 UTC (rev 72314)
@@ -47,13 +47,13 @@
 %    }^^A
 % }
 %
-% \date{Version 0.99e, released 2024-09-11}
+% \date{Version 0.99f, released 2024-09-16}
 % \maketitle
 % \begin{implementation}
 %    \begin{macrocode}
 %<@@=tag>
 %<*luatex>
-\ProvidesExplFile {tagpdf-luatex.def} {2024-09-11} {0.99e}
+\ProvidesExplFile {tagpdf-luatex.def} {2024-09-16} {0.99f}
   {tagpdf~driver~for~luatex}
 %    \end{macrocode}
 % \section{Loading the lua}
@@ -85,6 +85,7 @@
 %     \@@_seq_new:N,
 %     \@@_prop_gput:Nnn,
 %     \@@_seq_gput_right:Nn,
+%     \@@_seq_gput_left:Nn,
 %     \@@_seq_item:cn,
 %     \@@_prop_item:cn,
 %     \@@_seq_show:N,
@@ -123,9 +124,18 @@
     \seq_gput_right:Nn #1 { #2 }
     \lua_now:e { table.insert(ltx.@@.tables.\cs_to_str:N#1, "#2") }
   }
-
+%    \end{macrocode}
+%
+% this inserts on the right of the lua table, but as the lua table is not used for kids
+% this is ignored for now.
+%    \begin{macrocode}
+\cs_set_protected:Npn \@@_seq_gput_left:Nn #1 #2
+  {
+    \seq_gput_left:Nn #1 { #2 }
+    \lua_now:e { table.insert(ltx.@@.tables.\cs_to_str:N#1, "#2") }
+  }
+  
 %Hm not quite sure about the naming
-
 \cs_set:Npn \@@_seq_item:cn #1 #2
   {
     \lua_now:e { tex.print(ltx.@@.tables.#1[#2]) }
@@ -164,8 +174,8 @@
 
 local ProvidesLuaModule = {
     name          = "tagpdf",
-    version       = "0.99e",       --TAGVERSION
-    date          = "2024-09-11", --TAGDATE
+    version       = "0.99f",       --TAGVERSION
+    date          = "2024-09-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	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx	2024-09-17 19:56:02 UTC (rev 72314)
@@ -48,7 +48,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.99e, released 2024-09-11}
+% \date{Version 0.99f, released 2024-09-16}
 % \maketitle
 % \begin{documentation}
 % \section{Commands}
@@ -331,7 +331,7 @@
 %    \begin{macrocode}
 %<@@=tag>
 %<*header>
-\ProvidesExplPackage {tagpdf-checks-code} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-checks-code} {2024-09-16} {0.99f}
  {part of tagpdf - code related to checks, conditionals, debugging and messages}
 %</header>
 %    \end{macrocode}
@@ -1137,24 +1137,24 @@
      }
  }
 %    \end{macrocode}
-% This tracks tag stop and start.
-% The tag-stop message should go before the int is increased.
-% The tag-start message after the int is decreased.
+% This tracks tag suspend and resume.
+% The tag-suspend message should go before the int is increased.
+% The tag-resume message after the int is decreased.
 %    \begin{macrocode}
-\msg_new:nnn { tag / debug } {tag-stop}
+\msg_new:nnn { tag / debug } {tag-suspend}
   {
     \int_if_zero:nTF
       {#1}
-      {Tagging~stopped}
-      {Tagging~(not)~stopped~(already~inactive)}\\    
+      {Tagging~suspended}
+      {Tagging~(not)~suspended~(already~inactive)}\\    
     level:~#1~==>~\int_eval:n{#1+1}\tl_if_empty:nF{#2}{,~label:~#2}~[\msg_line_context:]
   }
-\msg_new:nnn { tag / debug } {tag-start}
+\msg_new:nnn { tag / debug } {tag-resume}
   {
     \int_if_zero:nTF
       {#1}
-      {Tagging~restarted}
-      {Tagging~(not)~restarted}\\
+      {Tagging~resumed}
+      {Tagging~(not)~resumed}\\
     level:~\int_eval:n{#1+1}~==>~#1\tl_if_empty:nF{#2}{,~label:~#2}~[\msg_line_context:]
   }  
 %    \end{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx	2024-09-17 19:56:02 UTC (rev 72314)
@@ -47,7 +47,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.99e, released 2024-09-11}
+% \date{Version 0.99f, released 2024-09-16}
 % \maketitle
 % \begin{documentation}
 % This files contains a various data files which are read in
@@ -61,7 +61,7 @@
 % latex-lab has also a namespace module, which takes precedence!
 %    \begin{macrocode}
 %<*ns-latex>
-%% \ProvidesExplFile {tagpdf-ns-latex.def} {2024-09-11} {0.99e}
+%% \ProvidesExplFile {tagpdf-ns-latex.def} {2024-09-16} {0.99f}
 %% {latex} {https://www.latex-project.org/ns/dflt/2022}{}
 title,        Title,    pdf2,
 part,         Title,    pdf2,
@@ -93,7 +93,7 @@
 % It is bound to change
 %    \begin{macrocode}
 %<*ns-latex-book>
-%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2024-09-11} {0.99e}
+%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2024-09-16} {0.99f}
 %% {latex-book} {https://www.latex-project.org/ns/book/2022}{}
 chapter,       H1,pdf2,
 section,       H2,pdf2,
@@ -107,7 +107,7 @@
 % \section{The pdf namespace data}
 %    \begin{macrocode}
 %<*ns-pdf>
-%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2024-09-11} {0.99e}
+%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2024-09-16} {0.99f}
 %%  {pdf}   {http://iso.org/pdf/ssn}{}
 StructTreeRoot,StructTreeRoot,pdf,D,
 Document,Document,pdf,D,   
@@ -175,7 +175,7 @@
 % \section{The pdf 2.0 namespace data}
 %    \begin{macrocode}
 %<*ns-pdf2>
-%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2024-09-11} {0.99e} 
+%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2024-09-16} {0.99f} 
 %%  {pdf2}  {http://iso.org/pdf2/ssn}{}
 StructTreeRoot,StructTreeRoot,pdf2,D,
 Document,Document,pdf2,D,   
@@ -232,7 +232,7 @@
 % \section{The mathml namespace data}
 %    \begin{macrocode}
 %<*ns-mathml>
-%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2024-09-11} {0.99e}
+%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2024-09-16} {0.99f}
 % {mathml}{http://www.w3.org/1998/Math/MathML}{}
 abs,abs,mathml,
 and,and,mathml,
@@ -467,7 +467,7 @@
 % This will perhaps change in future.
 %    \begin{macrocode}
 %<*parent-child>
-%% \ProvidesExplFile {tagpdf-parent-child.csv} {2024-09-11} {0.99e}
+%% \ProvidesExplFile {tagpdf-parent-child.csv} {2024-09-16} {0.99f}
 ,,,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,∅,∅
@@ -522,7 +522,7 @@
 % This will perhaps change in future.
 %    \begin{macrocode}
 %<*parent-child-2>
-%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2024-09-11} {0.99e}
+%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2024-09-16} {0.99f}
 ,,,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	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx	2024-09-17 19:56:02 UTC (rev 72314)
@@ -46,7 +46,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.99e, released 2024-09-11}
+% \date{Version 0.99f, released 2024-09-16}
 % \maketitle
 % \begin{documentation}
 % \end{documentation}
@@ -55,11 +55,11 @@
 %    \begin{macrocode}
 %<@@=tag>
 %<*generic>
-\ProvidesExplPackage {tagpdf-mc-code-generic} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-mc-code-generic} {2024-09-16} {0.99f}
  {part of tagpdf - code related to marking chunks - generic mode}
 %</generic>
 %<*debug>
-\ProvidesExplPackage {tagpdf-debug-generic} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-debug-generic} {2024-09-16} {0.99f}
  {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	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx	2024-09-17 19:56:02 UTC (rev 72314)
@@ -46,7 +46,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.99e, released 2024-09-11}
+% \date{Version 0.99f, released 2024-09-16}
 % \maketitle
 % \begin{implementation}
 % The code is split into three parts: code shared by all engines,
@@ -86,11 +86,11 @@
 %    \begin{macrocode}
 %<@@=tag>
 %<*luamode>
-\ProvidesExplPackage {tagpdf-mc-code-lua} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-mc-code-lua} {2024-09-16} {0.99f}
   {tagpdf - mc code only for the luamode }
 %</luamode>
 %<*debug>
-\ProvidesExplPackage {tagpdf-debug-lua} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-debug-lua} {2024-09-16} {0.99f}
  {part of tagpdf - debugging code related to marking chunks - lua mode}
 %</debug>
 %    \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	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx	2024-09-17 19:56:02 UTC (rev 72314)
@@ -46,7 +46,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.99e, released 2024-09-11}
+% \date{Version 0.99f, released 2024-09-16}
 % \maketitle
 % \begin{documentation}
 % \section{Public Commands}
@@ -181,7 +181,7 @@
 %    \begin{macrocode}
 %<@@=tag>
 %<*header>
-\ProvidesExplPackage {tagpdf-mc-code-shared} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-mc-code-shared} {2024-09-16} {0.99f}
   {part of tagpdf - code related to marking chunks -
    code shared by generic and luamode }
 %</header>
@@ -365,12 +365,12 @@
   \tag_mc_end_push:
   \tag_mc_begin:n {artifact=#1}
   \group_begin:
-  \tag_stop:n{artifact-group}
+  \tag_suspend:n{artifact-group}
  }
 
 \cs_set_protected:Npn \tag_mc_artifact_group_end:
  {
-  \tag_start:n{artifact-group}
+  \tag_resume:n{artifact-group}
   \group_end:
   \tag_mc_end:
   \tag_mc_begin_pop:n{}

Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx	2024-09-17 19:56:02 UTC (rev 72314)
@@ -46,7 +46,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.99e, released 2024-09-11}
+% \date{Version 0.99f, released 2024-09-16}
 % \maketitle
 % \begin{documentation}
 % \begin{function}
@@ -98,7 +98,7 @@
 %    \begin{macrocode}
 %<@@=tag>
 %<*header>
-\ProvidesExplPackage {tagpdf-roles-code} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-roles-code} {2024-09-16} {0.99f}
  {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	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx	2024-09-17 19:56:02 UTC (rev 72314)
@@ -46,7 +46,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.99e, released 2024-09-11}
+% \date{Version 0.99f, released 2024-09-16}
 % \maketitle
 % \begin{documentation}
 % \begin{function}{activate/space (setup-key),interwordspace (deprecated)}
@@ -66,7 +66,7 @@
 %    \begin{macrocode}
 %<@@=tag>
 %<*header>
-\ProvidesExplPackage {tagpdf-space-code} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-space-code} {2024-09-16} {0.99f}
  {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	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx	2024-09-17 19:56:02 UTC (rev 72314)
@@ -27,6 +27,7 @@
 \usepackage{array,booktabs,caption}
 \hypersetup{pdfauthor=Ulrike Fischer,
  pdftitle=tagpdf-tree module (tagpdf)}
+\input{tagpdf-docelements}
 \begin{document}
   \DocInput{\jobname.dtx}
 \end{document}
@@ -46,7 +47,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.99e, released 2024-09-11}
+% \date{Version 0.99f, released 2024-09-16}
 % \maketitle
 % \begin{documentation}
 % \section{Public Commands}
@@ -135,7 +136,7 @@
 % 
 % \section{Public keys}
 % \subsection{Keys for the structure commands}
-% \begin{function}{tag (struct-key)}
+% \begin{structkeydecl}{tag}
 % This is required. The value of the key is normally one of the
 % standard types listed in the main tagpdf documentation.
 % It is possible to setup new tags/types.
@@ -144,15 +145,15 @@
 % Currently the names spaces |pdf|, |pdf2|, |mathml| and |user| are defined.
 % This allows to use a different name space than
 % the one connected by default to the tag. But normally this should not be needed.
-% \end{function}
-% \begin{function}{stash (struct-key)}
+% \end{structkeydecl}
+% \begin{structkeydecl}{stash}
 %  Normally a new structure inserts itself as a kid
 %  into the currently active structure. This key prohibits this.
 %  The structure is nevertheless from now on
 %  \enquote{the current active structure}
 %  and parent for following  marked content and structures.
-% \end{function}
-% \begin{function}{label (struct-key)}
+% \end{structkeydecl}
+% \begin{structkeydecl}{label}
 % This key sets a label by which
 % one can refer to the structure. It is e.g.
 % used by \cs{tag_struct_use:n} (where a real label is actually not
@@ -161,8 +162,8 @@
 % Internally the label name will start with \texttt{tagpdfstruct-} and it stores
 % the two attributes |tagstruct| (the structure number) and |tagstructobj| (the
 % object reference).
-% \end{function}
-% \begin{function}{parent (struct-key)}
+% \end{structkeydecl}
+% \begin{structkeydecl}{parent}
 % By default a structure is added as kid to the currently active structure.
 % With the parent key one can choose another parent. The value is a structure number which
 % must refer to an already existing, previously created structure. Such a structure
@@ -169,47 +170,55 @@
 % number can for example be have been stored with \cs{tag_get:n}, but one can also use
 % a label on the parent structure and then use
 % \cs{property_ref:nn}|{tagpdfstruct-label}{tagstruct}| to retrieve it.
-% \end{function}
-% \begin{function}{title (struct-key),title-o (struct-key)}
+% \end{structkeydecl}
+% \begin{structkeydecl}{firstkey}
+% If this key is used the structure is added at the left of the kids of 
+% the parent structure (if the structure is not stashed). 
+% This means that it will be the first kid of the structure 
+% (unless some later structure uses the key too).
+% \end{structkeydecl}
+% \begin{structkeydecl}{title,title-o}
 % This keys allows to set the dictionary entry
 % \texttt{/Title} in the structure object.
 % The value is handled as verbatim string and hex encoded.
 % Commands are not expanded. |title-o| will expand the value once.
-% \end{function}
+% \end{structkeydecl}
 %
-% \begin{function}{alt (struct-key)}
+% \begin{structkeydecl}{alt}
 % This key inserts an \texttt{/Alt} value in the dictionary of structure object.
 % The value is handled as verbatim string and hex encoded.
 % The value will be expanded first once. If it is empty, nothing will happen.
-% \end{function}
-% \begin{function}{actualtext (struct-key)}
+% \end{structkeydecl}
+% \begin{structkeydecl}{actualtext}
 % This key inserts an \texttt{/ActualText} value in the dictionary of structure object.
 % The value is handled as verbatim string and hex encoded.
 % The value will be expanded first once. If it is empty, nothing will happen.
-% \end{function}
-% \begin{function}{lang (struct-key)}
+% \end{structkeydecl}
+% \begin{structkeydecl}{lang}
 % This key allows to set the language for a structure element. The value should be a bcp-identifier,
 % e.g. |de-De|.
-% \end{function}
-% \begin{function}{ref (struct-key)}
+% \end{structkeydecl}
+% \begin{structkeydecl}{ref}
 %  This key allows to add references to other structure elements,
 %  it adds the |/Ref| array to the structure.
 % The value should be a comma separated list of structure labels
 % set with the |label| key. e.g. |ref={label1,label2}|.
-% \end{function}
-% \begin{function}{E (struct-key)}
+% \end{structkeydecl}
+% \begin{structkeydecl}{E}
 %  This key sets the |/E| key, the expanded form of an
 %  abbreviation or an acronym
 %  (I couldn't think of a better name, so I sticked to E).
-% \end{function}
-% \begin{function}{AF (struct-key),AFref (struct-key), 
-%  AFinline (struct-key),AFinline-o (struct-key),texsource,mathml}
+% \end{structkeydecl}
+% \begin{structkeydecl}{AF,AFref, 
+%  AFinline,AFinline-o,texsource,mathml}
+% These keys handle associated files in the structure element. 
+% 
 % \begin{syntax}
 % AF = \meta{object name}\\
 % AFref = \meta{object reference}\\
 % AF-inline = \meta{text content}\\
 % \end{syntax}
-% These keys allows to reference an associated file in the structure element.
+% 
 % The value \meta{object name} should be the name of an object pointing
 % to the \texttt{/Filespec} dictionary as expected by
 % |\pdf_object_ref:n| from a current \texttt{l3kernel}.
@@ -221,15 +230,16 @@
 % Future versions will perhaps extend this to more mime types, but it is
 % still a research task to find out what is really needed.
 % 
-% |texsource| is a special variant of |AF-inline-o| which embeds the file 
-% as |.tex| source with the |/AFrelationship| key set to |/Source|. It also sets the |/Desc| key
-% to a (currently) fix text. 
+% |texsource| is a special variant of |AF-inline-o| which embeds the content 
+% as |.tex| source with the |/AFrelationship| key set to |/Source|. 
+% It also sets the |/Desc| key to a (currently) fix text. 
 % 
-% |mathml|  is a special variant of |AF-inline-o| which embeds the file 
+% |mathml| is a special variant of |AF-inline-o| which embeds the content
 % as |.xml| file with the |/AFrelationship| key set to |/Supplement|. 
 % It also sets the |/Desc| key to a (currently) fix text. 
 %
-% The argument of |AF| is an object name referring an embedded file as declared for example with 
+% The argument of |AF| is an object name referring an embedded file as declared 
+% for example with 
 % \cs{pdf_object_new:n} or with the l3pdffile module. |AF| expands its argument 
 % (this allows e.g. to use some variable for automatic numbering) 
 % and can be used more than once, to associate more than one file. 
@@ -243,9 +253,9 @@
 % does not check if the reference is valid!}
 % 
 % The inline keys can be used only once per structure. Additional calls are ignored.
-% \end{function}
+% \end{structkeydecl}
 %
-% \begin{function}{attribute (struct-key)}
+% \begin{structkeydecl}{attribute}
 %  This key takes as argument a comma list of attribute names
 %  (use braces to protect the commas from the external key-val parser)
 %  and allows to add one or more attribute dictionary entries in
@@ -255,9 +265,9 @@
 %      \end{verbatim}
 %  Attribute names and their content must be declared first in \cs{tagpdfsetup}.
 %
-%  \end{function}
+%  \end{structkeydecl}
 %
-% \begin{function}{attribute-class (struct-key)}
+% \begin{structkeydecl}{attribute-class}
 %  This key takes as argument a comma list of attribute class names
 %  (use braces to protect the commas from the external key-val parser)
 %  and allows to add one or more attribute classes to the structure object.
@@ -264,7 +274,8 @@
 %
 %  Attribute class names and their content
 %  must be declared first in \cs{tagpdfsetup}.
-% \end{function}
+% \end{structkeydecl}
+% 
 % \subsection{Setup keys}
 % \begin{function}{role/new-attribute (setup-key), newattribute (deprecated)}
 % \begin{syntax}
@@ -284,7 +295,7 @@
 % \end{verbatim}
 %
 % \end{function}
-% \begin{function}{root-AF (setup-key)}
+% \begin{setupkeydecl}{root-AF}
 % \begin{syntax}
 % root-AF = \meta{object name}
 % \end{syntax}
@@ -291,13 +302,13 @@
 % This key can be used in the setup command \cs{tagpdfsetup} and allows
 % to add associated files to the root structure. Like |AF| it can be used more than
 % once to add more than one file.
-% \end{function}
+% \end{setupkeydecl}
 % \end{documentation}
 % \begin{implementation}
 %    \begin{macrocode}
 %<@@=tag>
 %<*header>
-\ProvidesExplPackage {tagpdf-struct-code} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-struct-code} {2024-09-16} {0.99f}
  {part of tagpdf - code related to storing structure}
 %</header>
 %    \end{macrocode}
@@ -471,6 +482,15 @@
 %    \end{macrocode}
 % \end{variable}
 % 
+% \begin{variable}{\l_@@_struct_addkid_tl}
+% This decides if a structure kid is added at the left or right of the parent.
+% The default is \texttt{right}.
+%    \begin{macrocode}
+\tl_new:N  \l_@@_struct_addkid_tl
+\tl_set:Nn \l_@@_struct_addkid_tl {right}
+%    \end{macrocode}
+% \end{variable}
+ 
 % \subsection{Variables used by tagging code of basic elements}
 %
 % \begin{variable}{\g_@@_struct_dest_num_prop}
@@ -720,8 +740,9 @@
 %    \end{macrocode}
 %    \begin{macrocode}
 %<*package|debug>
-%<package>\cs_new_protected:Npn \@@_struct_kid_mc_gput_right:nn #1 #2 %#1 structure num, #2 MCID absnum%
-%<debug>\cs_set_protected:Npn \@@_struct_kid_mc_gput_right:nn #1 #2 %#1 structure num, #2 MCID absnum%
+%<package>\cs_new_protected:Npn \@@_struct_kid_mc_gput_right:nn #1 #2 
+%<debug>\cs_set_protected:Npn \@@_struct_kid_mc_gput_right:nn #1 #2 
+%#1 structure num, #2 MCID absnum%
   {
     \@@_seq_gput_right:ce
       { g_@@_struct_kids_#1_seq }
@@ -749,8 +770,9 @@
 %  This commands adds a structure as kid. We only need to record the object
 %  reference in the sequence.
 %    \begin{macrocode}
-%<package>\cs_new_protected:Npn\@@_struct_kid_struct_gput_right:nn #1 #2 %#1 num of parent struct, #2 kid struct
-%<debug>\cs_set_protected:Npn\@@_struct_kid_struct_gput_right:nn #1 #2 %#1 num of parent struct, #2 kid struct
+%<package>\cs_new_protected:Npn\@@_struct_kid_struct_gput_right:nn #1 #2
+%<debug>\cs_set_protected:Npn\@@_struct_kid_struct_gput_right:nn #1 #2 
+%%#1 num of parent struct, #2 kid struct
   {
     \@@_seq_gput_right:ce
       { g_@@_struct_kids_#1_seq }
@@ -763,10 +785,35 @@
 %<debug>        Struct~#2
 %<debug>      }            
   }
-
 %<package>\cs_generate_variant:Nn \@@_struct_kid_struct_gput_right:nn {ee}
 %    \end{macrocode}
 % \end{macro}
+%  \begin{macro}
+%    {
+%      \@@_struct_kid_struct_gput_left:nn,\@@_struct_kid_struct_gput_left:ee
+%    }
+%  This commands adds a structure as kid one the left, so as first
+%  kid. We only need to record the object reference in the sequence.
+%    \begin{macrocode}
+%<package>\cs_new_protected:Npn\@@_struct_kid_struct_gput_left:nn #1 #2
+%<debug>\cs_set_protected:Npn\@@_struct_kid_struct_gput_left:nn #1 #2 
+%%#1 num of parent struct, #2 kid struct
+  {
+    \@@_seq_gput_left:ce
+      { g_@@_struct_kids_#1_seq }
+      {
+        \pdf_object_ref_indexed:nn { @@/struct }{ #2 }
+      }
+%<debug>    \seq_gput_left:cn
+%<debug>      { g_@@_struct_debug_kids_#1_seq }
+%<debug>      {
+%<debug>        Struct~#2
+%<debug>      }            
+  }
+%<package>\cs_generate_variant:Nn \@@_struct_kid_struct_gput_left:nn {ee}
+%    \end{macrocode}
+% \end{macro}
+% 
 % \begin{macro}
 %  {\@@_struct_kid_OBJR_gput_right:nnn,\@@_struct_kid_OBJR_gput_right:eee}
 % At last the command to add an OBJR object. This has to write an object first.
@@ -775,10 +822,11 @@
 % object reference
 %
 %    \begin{macrocode}
-%<package>\cs_new_protected:Npn\@@_struct_kid_OBJR_gput_right:nnn #1 #2 #3 %#1 num of parent struct,
-%<package>                                                             %#2 obj reference
-%<package>                                                             %#3 page object reference
+%<package>\cs_new_protected:Npn\@@_struct_kid_OBJR_gput_right:nnn #1 #2 #3 
+%<package>                                                             
+%<package>                                                             
 %<debug>\cs_set_protected:Npn\@@_struct_kid_OBJR_gput_right:nnn #1 #2 #3
+%%#1 num of parent struct,#2 obj reference,#3 page object reference
   {
     \pdf_object_unnamed_write:nn
       { dict }
@@ -982,7 +1030,8 @@
 %    \begin{macrocode}
         \prop_get:cnNF { g_@@_struct_#1_prop } {P}\l_@@_tmpb_tl
           { 
-            \prop_gput:cne { g_@@_struct_#1_prop } {P}{\pdf_object_ref_indexed:nn { @@/struct }{1}}
+            \prop_gput:cne { g_@@_struct_#1_prop } {P}
+              {\pdf_object_ref_indexed:nn { @@/struct }{1}}
             \prop_gput:cne { g_@@_struct_#1_prop } {S}{/Artifact}
             \seq_if_empty:cF {g_@@_struct_kids_#1_seq}
               {
@@ -1034,8 +1083,9 @@
 %         \tag_struct_end:
 % \end{verbatim}
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_struct_insert_annot:nn #1 #2 %#1 object reference to the annotation/xform
-                                                       %#2 structparent number
+\cs_new_protected:Npn \@@_struct_insert_annot:nn #1 #2 
+ %#1 object reference to the annotation/xform
+ %#2 structparent number
   {
     \bool_if:NT \g_@@_active_struct_bool
       {
@@ -1057,7 +1107,8 @@
             #1 %
           }
           {
-            \pdf_pageobject_ref:n { \property_ref:nnn {@tag at objr@page@#2 }{ tagabspage }{1} }
+            \pdf_pageobject_ref:n 
+              { \property_ref:nnn {@tag at objr@page@#2 }{ tagabspage }{1} }
           }
         % add the parent obj number to the parent tree:
         \exp_args:Nne
@@ -1066,7 +1117,8 @@
             #2
           }
           {
-            \pdf_object_ref_indexed:nn { @@/struct }{ \l_@@_struct_stack_parent_tmpa_tl }
+            \pdf_object_ref_indexed:nn 
+              { @@/struct }{ \l_@@_struct_stack_parent_tmpa_tl }
           }
         % increase the int:
         \int_gincr:N \c at g_@@_parenttree_obj_int 
@@ -1141,7 +1193,8 @@
 \socket_new:nn { tag/struct/tag }{1}
 \socket_new_plug:nnn { tag/struct/tag }{ latex-tags }
  {
-   \seq_set_split:Nne \l_@@_tmpa_seq { / } {#1/\prop_item:Ne\g__tag_role_tags_NS_prop{#1}}
+   \seq_set_split:Nne \l_@@_tmpa_seq { / } 
+     {#1/\prop_item:Ne\g__tag_role_tags_NS_prop{#1}}
    \tl_gset:Ne \g_@@_struct_tag_tl   { \seq_item:Nn\l_@@_tmpa_seq {1} }
    \tl_gset:Ne \g_@@_struct_tag_NS_tl{ \seq_item:Nn\l_@@_tmpa_seq {2} }  
    \@@_check_structure_tag:N \g_@@_struct_tag_tl
@@ -1149,10 +1202,12 @@
  
 \socket_new_plug:nnn { tag/struct/tag }{ pdf-tags }
  {
-   \seq_set_split:Nne \l_@@_tmpa_seq { / } {#1/\prop_item:Ne\g_@@_role_tags_NS_prop{#1}}
+   \seq_set_split:Nne \l_@@_tmpa_seq { / } 
+     {#1/\prop_item:Ne\g_@@_role_tags_NS_prop{#1}}
    \tl_gset:Ne \g_@@_struct_tag_tl   { \seq_item:Nn\l_@@_tmpa_seq {1} }
    \tl_gset:Ne \g_@@_struct_tag_NS_tl{ \seq_item:Nn\l_@@_tmpa_seq {2} }
-   \@@_role_get:VVNN \g_@@_struct_tag_tl\g_@@_struct_tag_NS_tl\l_@@_tmpa_tl\l_@@_tmpb_tl
+   \@@_role_get:VVNN 
+     \g_@@_struct_tag_tl \g_@@_struct_tag_NS_tl \l_@@_tmpa_tl \l_@@_tmpb_tl
    \tl_gset:Ne \g_@@_struct_tag_tl {\l_@@_tmpa_tl}
    \tl_gset:Ne \g_@@_struct_tag_NS_tl{\l_@@_tmpb_tl}
    \@@_check_structure_tag:N \g_@@_struct_tag_tl
@@ -1160,19 +1215,20 @@
 \socket_assign_plug:nn { tag/struct/tag } {latex-tags} 
 %    \end{macrocode}
 
-% \begin{macro}
+% \begin{structkeydecl}
 %  {
-%    label (struct-key),
-%    stash (struct-key),
-%    parent (struct-key),
-%    tag (struct-key),
-%    title (struct-key),
-%    title-o (struct-key),
-%    alt (struct-key),
-%    actualtext (struct-key),
-%    lang (struct-key),
-%    ref (struct-key),
-%    E (struct-key)
+%    label,
+%    stash,
+%    parent,
+%    firstkid,
+%    tag,
+%    title,
+%    title-o,
+%    alt,
+%    actualtext,
+%    lang,
+%    ref,
+%    E
 %  }
 %    \begin{macrocode}
 \keys_define:nn { @@ / struct }
@@ -1202,7 +1258,8 @@
               { parent~key~ignored }
           }
       },
-    parent .default:n    = {-1},
+    parent .default:n    = {-1},    
+	firstkid .code:n = { \tl_set:Nn \l_@@_struct_addkid_tl {left} },   
     tag   .code:n        = % S property
       {
         \socket_use:nn { tag/struct/tag }{#1}
@@ -1271,6 +1328,7 @@
       },
     }  
 %    \end{macrocode}
+% \end{structkeydecl}
 % Ref is rather special as it values are often
 % known only at the end of the document.
 % It therefore stores it values as
@@ -1328,7 +1386,7 @@
    
 %    \end{macrocode}
 % \end{macro}
-%
+% \begin{structkeydecl}{ref,E,}
 %    \begin{macrocode}
 \keys_define:nn { @@ / struct }
   {
@@ -1354,9 +1412,9 @@
       },
   }
 %    \end{macrocode}
-% \end{macro}
-% \begin{macro}{AF (struct-key), AFref (struct-key),
-%   AFinline (struct-key),AFinline-o (struct-key)}
+% \end{structkeydecl}
+% 
+% \begin{structkeydecl}{AF, AFref,AFinline,AFinline-o,texsource,mathml}
 % keys for the AF keys (associated files). They use commands from l3pdffile!
 % The stream variants use txt as extension to get the mimetype.
 % TODO: check if this should be configurable. For math we will perhaps need another
@@ -1407,7 +1465,8 @@
 %    \end{macrocode}
 % 
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_struct_add_AF:nn #1 #2 % #1 struct num #2 object reference
+\cs_new_protected:Npn \@@_struct_add_AF:nn #1 #2 
+% #1 struct num #2 object reference
   {
      \tl_if_exist:cTF
        {
@@ -1433,7 +1492,8 @@
       {
         \pdf_object_if_exist:eTF {#1}
           {
-            \@@_struct_add_AF:ee { \int_use:N \c at g_@@_struct_abs_int }{\pdf_object_ref:e {#1}}
+            \@@_struct_add_AF:ee 
+             { \int_use:N \c at g_@@_struct_abs_int }{\pdf_object_ref:e {#1}}
             \@@_struct_prop_gput:nne
              { \int_use:N \c at g_@@_struct_abs_int }            
              { AF }
@@ -1490,8 +1550,8 @@
     }  
  }
 %    \end{macrocode}
-% \end{macro}
-% \begin{macro}{root-AF (setup-key)}
+% \end{structkeydecl}
+% \begin{setupkeydecl}{root-AF}
 % The root structure can take AF keys too, so we provide a key for it.
 % This key is used with |\tagpdfsetup|, not in a structure!
 %    \begin{macrocode}
@@ -1518,7 +1578,7 @@
       },
   }
 %    \end{macrocode}
-% \end{macro}
+% \end{setupkeydecl}
 % \section{User commands}
 % We allow to set a language by default
 % \begin{macro}{\l_@@_struct_lang_tl}
@@ -1699,7 +1759,7 @@
             %record this structure as kid:
             %\tl_show:N \g_@@_struct_stack_current_tl
             %\tl_show:N \l_@@_struct_stack_parent_tmpa_tl
-            \@@_struct_kid_struct_gput_right:ee
+            \use:c { @@_struct_kid_struct_gput_ \l_@@_struct_addkid_tl :ee }
                { \l_@@_struct_stack_parent_tmpa_tl }
                { \g_@@_struct_stack_current_tl }
             %\prop_show:c { g_@@_struct_\g_@@_struct_stack_current_tl _prop }
@@ -2057,7 +2117,7 @@
 % \section{Attributes and attribute classes}
 %    \begin{macrocode}
 %<*header>
-\ProvidesExplPackage {tagpdf-attr-code} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-attr-code} {2024-09-16} {0.99f}
   {part of tagpdf - code related to attributes and attribute classes}
 %</header>
 %    \end{macrocode}
@@ -2132,7 +2192,7 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{attribute-class (struct-key)}
+% \begin{structkeydecl}{attribute-class}
 % attribute-class has to store the used attribute names so that
 % they can be added to the ClassMap later.
 %    \begin{macrocode}
@@ -2174,8 +2234,8 @@
      }
   }
 %    \end{macrocode}
-% \end{macro}
-% \begin{macro}{attribute (struct-key)}
+% \end{structkeydecl}
+% \begin{structkeydecl}{attribute}
 %    \begin{macrocode}
 \keys_define:nn { @@ / struct }
   {
@@ -2232,5 +2292,5 @@
   }
 %</package>
 %    \end{macrocode}
-% \end{macro}
+% \end{structkeydecl}
 % \end{implementation}

Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx	2024-09-17 19:56:02 UTC (rev 72314)
@@ -47,13 +47,13 @@
 %    }^^A
 % }
 %
-% \date{Version 0.99e, released 2024-09-11}
+% \date{Version 0.99f, released 2024-09-16}
 % \maketitle
 % \begin{implementation}
 %    \begin{macrocode}
 %<@@=tag>
 %<*header>
-\ProvidesExplPackage {tagpdf-tree-code} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-tree-code} {2024-09-16} {0.99f}
  {part of tagpdf - code related to writing trees and dictionaries to the pdf}
 %</header>
 %    \end{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx	2024-09-17 19:56:02 UTC (rev 72314)
@@ -46,7 +46,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.99e, released 2024-09-11}
+% \date{Version 0.99f, released 2024-09-16}
 % \maketitle
 % \begin{documentation}
 % \section{Setup commands}
@@ -309,7 +309,7 @@
 %    \begin{macrocode}
 %<@@=tag>
 %<*header>
-\ProvidesExplPackage {tagpdf-user} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-user} {2024-09-16} {0.99f}
   {tagpdf - user commands}
 %</header>
 %    \end{macrocode}
@@ -866,9 +866,9 @@
             {\tagmcbegin{tag=Lbl}}
            {#1}
          }
-   \tag_stop:n{hangfrom}
+   \tag_suspend:n{hangfrom}
    \hangindent \wd\@tempboxa\noindent
-   \tag_start:n{hangfrom}
+   \tag_resume:n{hangfrom}
    \tagmcbegin{}\box\@tempboxa\tagmcend\tagstructend\tagmcbegin{}
    }
  } 
@@ -1166,7 +1166,7 @@
 %    \tagpdfparaOff
 %   }
 %  This two command switch para mode on and off. |\tagpdfsetup| could be used
-%  too but is longer. An alternative is |\tag_tool:n{para=false}|
+%  too but is longer. An alternative is |\tag_tool:n{para/tagging=false}|
 %    \begin{macrocode}
 %<base>\newcommand\tagpdfparaOn {}
 %<base>\newcommand\tagpdfparaOff{}
@@ -1246,11 +1246,11 @@
        \bool_gset_false:N \g_@@_in_mc_bool
      }
     \tag_mc_begin:n {artifact}
-    \tag_stop:n{headfoot}
+    \tag_suspend:n{headfoot}
  }
 \cs_new_protected:Npn \@@_exclude_headfoot_end:
  {
-    \tag_start:n{headfoot}
+    \tag_resume:n{headfoot}
     \tag_mc_end:
     \bool_if:NTF \g_@@_mode_lua_bool
      {
@@ -1277,12 +1277,12 @@
      }
     \tag_struct_begin:n{tag=Artifact,attribute-class=@@/attr/#1}
     \tag_mc_begin:n {artifact=#1}
-    \tag_stop:n{headfoot}
+    \tag_suspend:n{headfoot}
  }
 
 \cs_new_protected:Npn \@@_exclude_struct_headfoot_end:
  {
-    \tag_start:n{headfoot}
+    \tag_resume:n{headfoot}
     \tag_mc_end:
     \tag_struct_end:
     \bool_if:NTF \g_@@_mode_lua_bool

Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx	2024-09-17 19:56:02 UTC (rev 72314)
@@ -21,36 +21,75 @@
 %    https://github.com/latex3/tagpdf
 %
 % for those people who are interested.
+%<*driver>
+\DocumentMetadata{}
+\documentclass{l3doc}
+\usepackage{array,booktabs,caption}
+\hypersetup{pdfauthor=Ulrike Fischer,
+ pdftitle=tagpdf (main module)}
+\input{tagpdf-docelements}
+\begin{document}
+  \DocInput{\jobname.dtx}
+\end{document}
+%</driver>
+% \fi
+% \title{^^A
+%   The \pkg{tagpdf} main module
+%   \\ Part of the tagpdf package
+% }
 %
-% \fi
+% \author{^^A
+%  Ulrike Fischer\thanks
+%    {^^A
+%      E-mail:
+%        \href{mailto:fischer at troubleshooting-tex.de}
+%          {fischer at troubleshooting-tex.de}^^A
+%    }^^A
+% }
+%
+% \date{Version 0.99f, released 2024-09-16}
+% \maketitle% 
+% 
 % \begin{documentation}
-% \begin{function}{
-%  \tag_stop:, \tag_start:,
-%  \tagstop, \tagstart }
+% \begin{function}{\tag_suspend:n, \tag_resume:n,\tag_stop:n, \tag_start:n }%
+% \begin{syntax}
+% \cs{tag_suspend:n}\Arg{label}\\
+% \cs{tag_resume:n}\Arg{label}\\ 
+% \cs{tag_stop:n}\Arg{label} (\emph{deprecated})\\
+% \cs{tag_start:n}\Arg{label} (\emph{deprecated}) 
+% \end{syntax}
 % We need commands to stop tagging in some places.
 % They switches three local booleans and also stop the counting
-% of paragraphs. If they are nested an inner \cs{tag_start:} will not
-% restart tagging.
+% of paragraphs. If they are nested an inner \cs{tag_resume:n} will not
+% restart tagging. 
+% \meta{label} is only used in debugging messages to allow to follow the nesting
+% and to identify which code is disabling the tagging.
+% The label is not expanded so can be a single token, e.g. |\caption|.
+% |\tag_suspend:n| and |\tag_resume:n| are the l3-layer variants of
+% |\SuspendTagging| and |\ResumeTagging| and will be provided by the kernel
+% in the next release.
 % \end{function}
-%
-% \begin{function}{\tag_stop:n, \tag_start:n }%
-% \begin{syntax}
-% \cs{tag_stop:n}\Arg{label}
-% \cs{tag_start:n}\Arg{label}\\
-% \end{syntax}
-% The commands with argument allow to give a label. This is only used
-% in debugging messages to allow to follow the nesting.
+% 
+% \begin{function}{
+%  \tag_stop:, \tag_start:, 
+%  \tagstop, \tagstart }
+% \emph{deprecated} These are variants of the above commands
+% without the debuging level. They are now deprecated and it 
+% is recommended to use the kernel command
+% |\SuspendTagging|, |\ResumeTagging|, |\tag_suspend:n| and |\tag_resume:n|
+% instead. 
 % \end{function}
 %
-% \begin{function}{activate/spaces (setup-key)}
+%
+% \begin{setupkeydecl}{activate/spaces}
 %  |activate/spaces| activates the additional parsing needed for
 %  interword spaces. It replaces the deprecated key |interwordspace|.
-% \end{function}
+% \end{setupkeydecl}
 %
-% \begin{function}{activate/mc (setup-key),
-%    activate/tree (setup-key),
-%    activate/struct (setup-key),
-%    activate/all (setup-key),
+% \begin{setupkeydecl}{activate/mc,
+%    activate/tree,
+%    activate/struct,
+%    activate/all,
 %    activate-mc (deprecated),
 %    activate-tree (deprecated),
 %    activate-struct (deprecated),
@@ -57,32 +96,32 @@
 %    activate-all (deprecated),
 %    }
 % Keys to activate the various tagging steps. 
-% \end{function}
-%\begin{function}{activate/struct-dest (setup-key),no-struct-dest (deprecated)}
+% \end{setupkeydecl}
+%\begin{setupkeydecl}{activate/struct-dest,no-struct-dest (deprecated)}
 % The key allows to suppress the creation of structure destinations
-% \end{function}
+% \end{setupkeydecl}
 %
-% \begin{function}{debug/log (setup-key)}
+% \begin{setupkeydecl}{debug/log}
 % The |debug/log| key takes currently the values |none|, |v|, |vv|, |vvv|, |all|.
 % More details are in \texttt{tagpdf-checks}.
-% \end{function}
+% \end{setupkeydecl}
 %
-% \begin{function}{activate/tagunmarked (setup-key), tagunmarked (deprecated) }
+% \begin{setupkeydecl}{activate/tagunmarked, tagunmarked (deprecated) }
 % This key allows to set if (in luamode) unmarked text should be
 % marked up as artifact. The initial value is true.
-% \end{function}
+% \end{setupkeydecl}
 %
-% \begin{function}{activate/softhyphen (setup-key)}
+% \begin{setupkeydecl}{activate/softhyphen}
 % This key allows to activates automatic handling of hyphens inserted
 % by hyphenation. It only is used in luamode and replaces hyphens
 % by U+00AD if the font supports this.
-% \end{function}
+% \end{setupkeydecl}
 % 
-% \begin{function}{page/tabsorder (setup-key), tabsorder (deprecated)}
+% \begin{setupkeydecl}{page/tabsorder, tabsorder (deprecated)}
 % This sets the tabsorder on a page. The values are |row|, |column|, |structure| (default)
 % or |none|. Currently this is set more or less globally. More finer control can be
 % added if needed.
-% \end{function}
+% \end{setupkeydecl}
 %
 % \begin{function}{tagstruct,tagstructobj,tagabspage,tagmcabs,tagmcid}
 % These are attributes used by the label/ref system.
@@ -93,7 +132,7 @@
 %    \begin{macrocode}
 %<@@=tag>
 %<*package>
-\ProvidesExplPackage {tagpdf} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf} {2024-09-16} {0.99f}
   { LaTeX kernel code for PDF tagging }
 
 \bool_if:nF
@@ -119,7 +158,7 @@
 %    \end{macrocode}
 %<*debug>
 %    \begin{macrocode}
-\ProvidesExplPackage {tagpdf-debug} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-debug} {2024-09-16} {0.99f}
   { debug code for tagpdf }
 \@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput}
 %    \end{macrocode}
@@ -142,7 +181,7 @@
 % we define a base package with dummy functions
 %    \begin{macrocode}
 %<*base>
-\ProvidesExplPackage {tagpdf-base} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-base} {2024-09-16} {0.99f}
   {part of tagpdf - provide base, no-op versions of the user commands }
 %</base>
 %    \end{macrocode} 
@@ -467,6 +506,7 @@
 \cs_set_eq:NN \@@_seq_new:N         \seq_new:N
 \cs_set_eq:NN \@@_prop_gput:Nnn     \prop_gput:Nnn
 \cs_set_eq:NN \@@_seq_gput_right:Nn \seq_gput_right:Nn
+\cs_set_eq:NN \@@_seq_gput_left:Nn  \seq_gput_left:Nn
 \cs_set_eq:NN \@@_seq_item:cn       \seq_item:cn
 \cs_set_eq:NN \@@_prop_item:cn      \prop_item:cn
 \cs_set_eq:NN \@@_seq_show:N        \seq_show:N
@@ -474,6 +514,7 @@
 % cnx temporary needed for latex-lab-graphic code
 \cs_generate_variant:Nn \@@_prop_gput:Nnn      { Nen , Nee, Nne , cnn, cen, cne, cno, cnx}
 \cs_generate_variant:Nn \@@_seq_gput_right:Nn  { Ne  , No, cn, ce }
+\cs_generate_variant:Nn \@@_seq_gput_left:Nn   { ce }
 \cs_generate_variant:Nn \@@_prop_new:N   { c }
 \cs_generate_variant:Nn \@@_seq_new:N    { c }
 \cs_generate_variant:Nn \@@_seq_show:N   { c }
@@ -485,6 +526,7 @@
 % \section{General tagging commands}
 %
 % \begin{macro}{
+%   \tag_suspend:n,\tag_resume:n,
 %   \tag_stop:,\tag_start:,
 %   \tag_stop:n,\tag_start:n}
 % We need commands to stop tagging in some places.
@@ -493,7 +535,8 @@
 % counter. Tagging only is only restarted at the outer level,
 % if the current level is 1.
 % The commands with argument allow to give a label. This is only used
-% in debugging messages to allow to follow the nesting.
+% in debugging messages to allow to follow the nesting. The label is
+% not expand so can e.g. be a single command token.
 % 
 % \begin{variable}{\l_@@_tag_stop_int}
 % When stop/start pairs are nested we do not want the inner 
@@ -510,7 +553,7 @@
 %    \begin{macrocode}
 \cs_set_protected:Npn \tag_stop:
   {
-%<debug>     \msg_note:nne {tag / debug }{tag-stop}{ \int_use:N \l_@@_tag_stop_int }      
+%<debug>     \msg_note:nne {tag / debug }{tag-suspend}{ \int_use:N \l_@@_tag_stop_int }      
     \int_incr:N \l_@@_tag_stop_int
     \bool_set_false:N \l_@@_active_struct_bool
     \bool_set_false:N \l_@@_active_mc_bool
@@ -527,15 +570,15 @@
         \bool_set_true:N \l_@@_active_socket_bool
         \@@_start_para_ints:
       }
-%<debug>    \msg_note:nne {tag / debug }{tag-start}{ \int_use:N \l_@@_tag_stop_int }                   
+%<debug>    \msg_note:nne {tag / debug }{tag-resume}{ \int_use:N \l_@@_tag_stop_int }                   
   }
 \cs_set_eq:NN\tagstop\tag_stop:
 \cs_set_eq:NN\tagstart\tag_start:  
 %    \end{macrocode}
 %    \begin{macrocode}
-\cs_set_protected:Npn \tag_stop:n #1
+\cs_set_protected:Npn \tag_suspend:n #1
   {
-%<debug>    \msg_note:nnee {tag / debug }{tag-stop}
+%<debug>    \msg_note:nnee {tag / debug }{tag-suspend}
 %<debug>       { \int_use:N \l_@@_tag_stop_int }{\exp_not:n{#1}}           
     \int_incr:N \l_@@_tag_stop_int
     \bool_set_false:N \l_@@_active_struct_bool
@@ -543,7 +586,8 @@
     \bool_set_false:N \l_@@_active_socket_bool
     \@@_stop_para_ints:
   }
-\cs_set_protected:Npn \tag_start:n #1
+\cs_set_eq:NN \tag_stop:n \tag_suspend:n 
+\cs_set_protected:Npn \tag_resume:n #1
   {
     \int_if_zero:nF { \l_@@_tag_stop_int } { \int_decr:N \l_@@_tag_stop_int }
     \int_if_zero:nT { \l_@@_tag_stop_int }
@@ -552,10 +596,11 @@
         \bool_set_true:N \l_@@_active_mc_bool
         \bool_set_true:N \l_@@_active_socket_bool
         \@@_start_para_ints:
-      } 
-%<debug>    \msg_note:nnee {tag / debug }{tag-start}
+      }     
+%<debug>    \msg_note:nnee {tag / debug }{tag-resume}
 %<debug>       { \int_use:N \l_@@_tag_stop_int }{\exp_not:n{#1}}             
   }
+\cs_set_eq:NN \tag_start:n \tag_resume:n    
 %</package|debug>
 %<*base>
 \cs_new_protected:Npn \tag_stop:{}
@@ -564,6 +609,11 @@
 \cs_new_protected:Npn \tagstart{}
 \cs_new_protected:Npn \tag_stop:n  #1 {}
 \cs_new_protected:Npn \tag_start:n #1 {}
+%    \end{macrocode}
+% Until the commands are provided by the kernel we provide them here too
+%    \begin{macrocode}
+\cs_set_eq:NN \tag_suspend:n \tag_stop:n
+\cs_set_eq:NN \tag_resume:n  \tag_start:n
 %</base>
 %    \end{macrocode}
 % \end{macro}
@@ -573,13 +623,13 @@
 %
 % TODO: the log-levels must be sorted
 %
-% \begin{macro}
+% \begin{setupkeydecl}
 %  {
-%    activate/mc (setup-key),
-%    activate/tree (setup-key),
-%    activate/struct (setup-key),
-%    activate/all (setup-key),
-%    activate/struct-dest (setup-key),
+%    activate/mc,
+%    activate/tree,
+%    activate/struct,
+%    activate/all,
+%    activate/struct-dest,
 %  }
 %  Keys to (globally) activate tagging.
 %  |activate/spaces| activates the additional parsing needed for
@@ -607,14 +657,14 @@
     activate-all  .default:n = true,
     no-struct-dest .bool_gset_inverse:N = \g_@@_active_struct_dest_bool,    
 %    \end{macrocode}
-% \end{macro}
-% \begin{macro}{debug/show (setup-key)}
+% \end{setupkeydecl}
+% \begin{setupkeydecl}{debug/show}
 % Subkeys/values are defined in various other places.
 %    \begin{macrocode}
     debug/show            .choice:,
 %    \end{macrocode}
-% \end{macro}
-% \begin{macro}{debug/log (setup-key), debug/uncompress (setup-key), log (deprecated), uncompress (deprecated)}
+% \end{setupkeydecl}
+% \begin{setupkeydecl}{debug/log, debug/uncompress, log (deprecated), uncompress (deprecated)}
 % The |log| takes currently the values |none|, |v|, |vv|, |vvv|, |all|.
 % The description of the log levels is in tagpdf-checks.
 %    \begin{macrocode}
@@ -635,8 +685,8 @@
     log             .meta:n = {debug/log={#1}},
     uncompress      .code:n = { \pdf_uncompress:  },
 %    \end{macrocode}
-% \end{macro}
-% \begin{macro}{activate/tagunmarked (setup-key),tagunmarked (deprecated)}
+% \end{setupkeydecl}
+% \begin{setupkeydecl}{activate/tagunmarked,tagunmarked (deprecated)}
 % This key allows to set if (in luamode) unmarked text should be
 % marked up as artifact. The initial value is true.
 %    \begin{macrocode}
@@ -647,15 +697,15 @@
 %    \begin{macrocode}
     tagunmarked .bool_gset:N = \g_@@_tagunmarked_bool,
 %    \end{macrocode}
-% \end{macro}
-% \begin{macro}{activate/softhyphen (setup-key)}
+% \end{setupkeydecl}
+% \begin{setupkeydecl}{activate/softhyphen}
 % This key activates (in luamode) the handling of soft hyphens.
 %    \begin{macrocode}
     activate/softhyphen     .bool_gset:N = \g_@@_softhyphen_bool,
     activate/softhyphen     .initial:n  = true,
 %    \end{macrocode}
-% \end{macro}
-% \begin{macro}{page/tabsorder (setup-key),tabsorder (deprecated)}
+% \end{setupkeydecl}
+% \begin{setupkeydecl}{page/tabsorder,tabsorder (deprecated)}
 % This sets the tabsorder on a page. The values are |row|, |column|, |structure| (default)
 % or |none|. Currently this is set more or less globally. More finer control can be
 % added if needed.
@@ -676,7 +726,7 @@
     tabsorder .meta:n = {page/tabsorder={#1}},    
   }
 %    \end{macrocode}
-% \end{macro}
+% \end{setupkeydecl}
 % \section{loading of engine/more dependent code}
 %    \begin{macrocode}
 \sys_if_engine_luatex:T

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty	2024-09-17 19:56:02 UTC (rev 72314)
@@ -25,7 +25,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf.dtx
-\ProvidesExplPackage {tagpdf-base} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-base} {2024-09-16} {0.99f}
   {part of tagpdf - provide base, no-op versions of the user commands }
 \cs_new_protected:Npn \__tag_whatsits: {}
 \AddToHook{begindocument}
@@ -45,6 +45,8 @@
 \cs_new_protected:Npn \tagstart{}
 \cs_new_protected:Npn \tag_stop:n  #1 {}
 \cs_new_protected:Npn \tag_start:n #1 {}
+\cs_set_eq:NN \tag_suspend:n \tag_stop:n
+\cs_set_eq:NN \tag_resume:n  \tag_start:n
 %% File: tagpdf-mc-generic.dtx
 \cs_new_protected:Npn \tag_mc_begin:n #1 { \__tag_whatsits: \int_gincr:N \c at g__tag_MCID_abs_int }
 \cs_new_protected:Nn \tag_mc_end:{ \__tag_whatsits: }

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug-generic.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug-generic.sty	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug-generic.sty	2024-09-17 19:56:02 UTC (rev 72314)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-mc-generic.dtx
-\ProvidesExplPackage {tagpdf-debug-generic} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-debug-generic} {2024-09-16} {0.99f}
  {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-lua.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug-lua.sty	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug-lua.sty	2024-09-17 19:56:02 UTC (rev 72314)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-mc-luacode.dtx
-\ProvidesExplPackage {tagpdf-debug-lua} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-debug-lua} {2024-09-16} {0.99f}
  {part of tagpdf - debugging code related to marking chunks - lua mode}
 \cs_set_protected:Npn \__tag_mc_handle_stash:n #1 %1 mcidnum
   {

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug.sty	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug.sty	2024-09-17 19:56:02 UTC (rev 72314)
@@ -26,7 +26,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf.dtx
-\ProvidesExplPackage {tagpdf-debug} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-debug} {2024-09-16} {0.99f}
   { debug code for tagpdf }
 \@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput}
 \prop_gput:Nnn \g_msg_module_type_prop { tag / debug} {}
@@ -33,7 +33,7 @@
 \prop_gput:Nnn \g_msg_module_name_prop { tag / debug }{tagpdf~DEBUG}
 \cs_set_protected:Npn \tag_stop:
   {
-     \msg_note:nne {tag / debug }{tag-stop}{ \int_use:N \l__tag_tag_stop_int }
+     \msg_note:nne {tag / debug }{tag-suspend}{ \int_use:N \l__tag_tag_stop_int }
     \int_incr:N \l__tag_tag_stop_int
     \bool_set_false:N \l__tag_active_struct_bool
     \bool_set_false:N \l__tag_active_mc_bool
@@ -50,13 +50,13 @@
         \bool_set_true:N \l__tag_active_socket_bool
         \__tag_start_para_ints:
       }
-    \msg_note:nne {tag / debug }{tag-start}{ \int_use:N \l__tag_tag_stop_int }
+    \msg_note:nne {tag / debug }{tag-resume}{ \int_use:N \l__tag_tag_stop_int }
   }
 \cs_set_eq:NN\tagstop\tag_stop:
 \cs_set_eq:NN\tagstart\tag_start:
-\cs_set_protected:Npn \tag_stop:n #1
+\cs_set_protected:Npn \tag_suspend:n #1
   {
-    \msg_note:nnee {tag / debug }{tag-stop}
+    \msg_note:nnee {tag / debug }{tag-suspend}
        { \int_use:N \l__tag_tag_stop_int }{\exp_not:n{#1}}
     \int_incr:N \l__tag_tag_stop_int
     \bool_set_false:N \l__tag_active_struct_bool
@@ -64,7 +64,8 @@
     \bool_set_false:N \l__tag_active_socket_bool
     \__tag_stop_para_ints:
   }
-\cs_set_protected:Npn \tag_start:n #1
+\cs_set_eq:NN \tag_stop:n \tag_suspend:n
+\cs_set_protected:Npn \tag_resume:n #1
   {
     \int_if_zero:nF { \l__tag_tag_stop_int } { \int_decr:N \l__tag_tag_stop_int }
     \int_if_zero:nT { \l__tag_tag_stop_int }
@@ -74,9 +75,10 @@
         \bool_set_true:N \l__tag_active_socket_bool
         \__tag_start_para_ints:
       }
-    \msg_note:nnee {tag / debug }{tag-start}
+    \msg_note:nnee {tag / debug }{tag-resume}
        { \int_use:N \l__tag_tag_stop_int }{\exp_not:n{#1}}
   }
+\cs_set_eq:NN \tag_start:n \tag_resume:n
 \bool_if:NTF \g__tag_mode_lua_bool
   {
    \RequirePackage {tagpdf-debug-lua}
@@ -195,20 +197,20 @@
         }
      }
  }
-\msg_new:nnn { tag / debug } {tag-stop}
+\msg_new:nnn { tag / debug } {tag-suspend}
   {
     \int_if_zero:nTF
       {#1}
-      {Tagging~stopped}
-      {Tagging~(not)~stopped~(already~inactive)}\\
+      {Tagging~suspended}
+      {Tagging~(not)~suspended~(already~inactive)}\\
     level:~#1~==>~\int_eval:n{#1+1}\tl_if_empty:nF{#2}{,~label:~#2}~[\msg_line_context:]
   }
-\msg_new:nnn { tag / debug } {tag-start}
+\msg_new:nnn { tag / debug } {tag-resume}
   {
     \int_if_zero:nTF
       {#1}
-      {Tagging~restarted}
-      {Tagging~(not)~restarted}\\
+      {Tagging~resumed}
+      {Tagging~(not)~resumed}\\
     level:~\int_eval:n{#1+1}~==>~#1\tl_if_empty:nF{#2}{,~label:~#2}~[\msg_line_context:]
   }
 %% File: tagpdf-user.dtx
@@ -263,7 +265,7 @@
 \seq_new:c  { g__tag_struct_debug_kids_1_seq }
 \prop_gset_eq:cc { g__tag_struct_debug_1_prop }{ g__tag_struct_1_prop }
 \prop_gremove:cn { g__tag_struct_debug_1_prop }{Namespaces}
-\cs_set_protected:Npn \__tag_struct_kid_mc_gput_right:nn #1 #2 %#1 structure num, #2 MCID absnum%
+\cs_set_protected:Npn \__tag_struct_kid_mc_gput_right:nn #1 #2
   {
     \__tag_seq_gput_right:ce
       { g__tag_struct_kids_#1_seq }
@@ -281,7 +283,8 @@
         \prop_item:Nn \g__tag_struct_cont_mc_prop {#2}
       }
   }
-\cs_set_protected:Npn\__tag_struct_kid_struct_gput_right:nn #1 #2 %#1 num of parent struct, #2 kid struct
+\cs_set_protected:Npn\__tag_struct_kid_struct_gput_right:nn #1 #2
+%%#1 num of parent struct, #2 kid struct
   {
     \__tag_seq_gput_right:ce
       { g__tag_struct_kids_#1_seq }
@@ -294,8 +297,22 @@
         Struct~#2
       }
   }
-
+\cs_set_protected:Npn\__tag_struct_kid_struct_gput_left:nn #1 #2
+%%#1 num of parent struct, #2 kid struct
+  {
+    \__tag_seq_gput_left:ce
+      { g__tag_struct_kids_#1_seq }
+      {
+        \pdf_object_ref_indexed:nn { __tag/struct }{ #2 }
+      }
+    \seq_gput_left:cn
+      { g__tag_struct_debug_kids_#1_seq }
+      {
+        Struct~#2
+      }
+  }
 \cs_set_protected:Npn\__tag_struct_kid_OBJR_gput_right:nnn #1 #2 #3
+%%#1 num of parent struct,#2 obj reference,#3 page object reference
   {
     \pdf_object_unnamed_write:nn
       { dict }
@@ -450,7 +467,7 @@
             %record this structure as kid:
             %\tl_show:N \g__tag_struct_stack_current_tl
             %\tl_show:N \l__tag_struct_stack_parent_tmpa_tl
-            \__tag_struct_kid_struct_gput_right:ee
+            \use:c { __tag_struct_kid_struct_gput_ \l__tag_struct_addkid_tl :ee }
                { \l__tag_struct_stack_parent_tmpa_tl }
                { \g__tag_struct_stack_current_tl }
             %\prop_show:c { g__tag_struct_\g__tag_struct_stack_current_tl _prop }

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def	2024-09-17 19:56:02 UTC (rev 72314)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-backend.dtx
-\ProvidesExplFile {tagpdf-luatex.def} {2024-09-11} {0.99e}
+\ProvidesExplFile {tagpdf-luatex.def} {2024-09-16} {0.99f}
   {tagpdf~driver~for~luatex}
 {
   \fontencoding{TU}\fontfamily{lmr}\fontseries{m}\fontshape{n}\fontsize{10pt}{10pt}\selectfont
@@ -54,8 +54,12 @@
     \seq_gput_right:Nn #1 { #2 }
     \lua_now:e { table.insert(ltx.__tag.tables.\cs_to_str:N#1, "#2") }
   }
+\cs_set_protected:Npn \__tag_seq_gput_left:Nn #1 #2
+  {
+    \seq_gput_left:Nn #1 { #2 }
+    \lua_now:e { table.insert(ltx.__tag.tables.\cs_to_str:N#1, "#2") }
+  }
 
-
 \cs_set:Npn \__tag_seq_item:cn #1 #2
   {
     \lua_now:e { tex.print(ltx.__tag.tables.#1[#2]) }

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	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty	2024-09-17 19:56:02 UTC (rev 72314)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-mc-generic.dtx
-\ProvidesExplPackage {tagpdf-mc-code-generic} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-mc-code-generic} {2024-09-16} {0.99f}
  {part of tagpdf - code related to marking chunks - generic mode}
 \tl_new:N \l__tag_mc_ref_abspage_tl
 

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	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-lua.sty	2024-09-17 19:56:02 UTC (rev 72314)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-mc-luacode.dtx
-\ProvidesExplPackage {tagpdf-mc-code-lua} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf-mc-code-lua} {2024-09-16} {0.99f}
   {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	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-book.def	2024-09-17 19:56:02 UTC (rev 72314)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2024-09-11} {0.99e}
+%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2024-09-16} {0.99f}
 %% {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.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex.def	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex.def	2024-09-17 19:56:02 UTC (rev 72314)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-latex.def} {2024-09-11} {0.99e}
+%% \ProvidesExplFile {tagpdf-ns-latex.def} {2024-09-16} {0.99f}
 %% {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	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-mathml.def	2024-09-17 19:56:02 UTC (rev 72314)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2024-09-11} {0.99e}
+%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2024-09-16} {0.99f}
 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	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf.def	2024-09-17 19:56:02 UTC (rev 72314)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2024-09-11} {0.99e}
+%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2024-09-16} {0.99f}
 %%  {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	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf2.def	2024-09-17 19:56:02 UTC (rev 72314)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2024-09-11} {0.99e}
+%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2024-09-16} {0.99f}
 %%  {pdf2}  {http://iso.org/pdf2/ssn}{}
 StructTreeRoot,StructTreeRoot,pdf2,D,
 Document,Document,pdf2,D,

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	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child-2.csv	2024-09-17 19:56:02 UTC (rev 72314)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2024-09-11} {0.99e}
+%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2024-09-16} {0.99f}
 ,,,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	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child.csv	2024-09-17 19:56:02 UTC (rev 72314)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-parent-child.csv} {2024-09-11} {0.99e}
+%% \ProvidesExplFile {tagpdf-parent-child.csv} {2024-09-16} {0.99f}
 ,,,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	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf.lua	2024-09-17 19:56:02 UTC (rev 72314)
@@ -24,8 +24,8 @@
 
 local ProvidesLuaModule = {
     name          = "tagpdf",
-    version       = "0.99e",       --TAGVERSION
-    date          = "2024-09-11", --TAGDATE
+    version       = "0.99f",       --TAGVERSION
+    date          = "2024-09-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	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty	2024-09-17 19:56:02 UTC (rev 72314)
@@ -28,7 +28,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: tagpdf.dtx
-\ProvidesExplPackage {tagpdf} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdf} {2024-09-16} {0.99f}
   { LaTeX kernel code for PDF tagging }
 
 \bool_if:nF
@@ -180,6 +180,7 @@
 \cs_set_eq:NN \__tag_seq_new:N         \seq_new:N
 \cs_set_eq:NN \__tag_prop_gput:Nnn     \prop_gput:Nnn
 \cs_set_eq:NN \__tag_seq_gput_right:Nn \seq_gput_right:Nn
+\cs_set_eq:NN \__tag_seq_gput_left:Nn  \seq_gput_left:Nn
 \cs_set_eq:NN \__tag_seq_item:cn       \seq_item:cn
 \cs_set_eq:NN \__tag_prop_item:cn      \prop_item:cn
 \cs_set_eq:NN \__tag_seq_show:N        \seq_show:N
@@ -186,6 +187,7 @@
 \cs_set_eq:NN \__tag_prop_show:N       \prop_show:N
 \cs_generate_variant:Nn \__tag_prop_gput:Nnn      { Nen , Nee, Nne , cnn, cen, cne, cno, cnx}
 \cs_generate_variant:Nn \__tag_seq_gput_right:Nn  { Ne  , No, cn, ce }
+\cs_generate_variant:Nn \__tag_seq_gput_left:Nn   { ce }
 \cs_generate_variant:Nn \__tag_prop_new:N   { c }
 \cs_generate_variant:Nn \__tag_seq_new:N    { c }
 \cs_generate_variant:Nn \__tag_seq_show:N   { c }
@@ -212,7 +214,7 @@
   }
 \cs_set_eq:NN\tagstop\tag_stop:
 \cs_set_eq:NN\tagstart\tag_start:
-\cs_set_protected:Npn \tag_stop:n #1
+\cs_set_protected:Npn \tag_suspend:n #1
   {
     \int_incr:N \l__tag_tag_stop_int
     \bool_set_false:N \l__tag_active_struct_bool
@@ -220,7 +222,8 @@
     \bool_set_false:N \l__tag_active_socket_bool
     \__tag_stop_para_ints:
   }
-\cs_set_protected:Npn \tag_start:n #1
+\cs_set_eq:NN \tag_stop:n \tag_suspend:n
+\cs_set_protected:Npn \tag_resume:n #1
   {
     \int_if_zero:nF { \l__tag_tag_stop_int } { \int_decr:N \l__tag_tag_stop_int }
     \int_if_zero:nT { \l__tag_tag_stop_int }
@@ -231,6 +234,7 @@
         \__tag_start_para_ints:
       }
   }
+\cs_set_eq:NN \tag_start:n \tag_resume:n
 \keys_define:nn { __tag / setup }
   {
     activate/mc     .bool_gset:N = \g__tag_active_mc_bool,
@@ -666,12 +670,12 @@
   \tag_mc_end_push:
   \tag_mc_begin:n {artifact=#1}
   \group_begin:
-  \tag_stop:n{artifact-group}
+  \tag_suspend:n{artifact-group}
  }
 
 \cs_set_protected:Npn \tag_mc_artifact_group_end:
  {
-  \tag_start:n{artifact-group}
+  \tag_resume:n{artifact-group}
   \group_end:
   \tag_mc_end:
   \tag_mc_begin_pop:n{}
@@ -1973,6 +1977,9 @@
 \prop_new_linked:N \g__tag_struct_label_num_prop
 
 \bool_new:N \l__tag_struct_elem_stash_bool
+\tl_new:N  \l__tag_struct_addkid_tl
+\tl_set:Nn \l__tag_struct_addkid_tl {right}
+
 \prop_new_linked:N \g__tag_struct_ref_by_dest_prop
 \cs_new:Npn \__tag_struct_output_prop_aux:nn #1 #2 %#1 num, #2 key
   {
@@ -2097,7 +2104,7 @@
        /MCID \c_space_tl \property_ref:enn{mcid-#1}{tagmcid}{1}
      >>
   }
-\cs_new_protected:Npn \__tag_struct_kid_mc_gput_right:nn #1 #2 %#1 structure num, #2 MCID absnum%
+\cs_new_protected:Npn \__tag_struct_kid_mc_gput_right:nn #1 #2
   {
     \__tag_seq_gput_right:ce
       { g__tag_struct_kids_#1_seq }
@@ -2111,7 +2118,8 @@
       }
   }
 \cs_generate_variant:Nn \__tag_struct_kid_mc_gput_right:nn {ne}
-\cs_new_protected:Npn\__tag_struct_kid_struct_gput_right:nn #1 #2 %#1 num of parent struct, #2 kid struct
+\cs_new_protected:Npn\__tag_struct_kid_struct_gput_right:nn #1 #2
+%%#1 num of parent struct, #2 kid struct
   {
     \__tag_seq_gput_right:ce
       { g__tag_struct_kids_#1_seq }
@@ -2119,12 +2127,22 @@
         \pdf_object_ref_indexed:nn { __tag/struct }{ #2 }
       }
   }
-
 \cs_generate_variant:Nn \__tag_struct_kid_struct_gput_right:nn {ee}
-\cs_new_protected:Npn\__tag_struct_kid_OBJR_gput_right:nnn #1 #2 #3 %#1 num of parent struct,
-                                                             %#2 obj reference
-                                                             %#3 page object reference
+\cs_new_protected:Npn\__tag_struct_kid_struct_gput_left:nn #1 #2
+%%#1 num of parent struct, #2 kid struct
   {
+    \__tag_seq_gput_left:ce
+      { g__tag_struct_kids_#1_seq }
+      {
+        \pdf_object_ref_indexed:nn { __tag/struct }{ #2 }
+      }
+  }
+\cs_generate_variant:Nn \__tag_struct_kid_struct_gput_left:nn {ee}
+\cs_new_protected:Npn\__tag_struct_kid_OBJR_gput_right:nnn #1 #2 #3
+
+
+%%#1 num of parent struct,#2 obj reference,#3 page object reference
+  {
     \pdf_object_unnamed_write:nn
       { dict }
       {
@@ -2262,7 +2280,8 @@
       {
         \prop_get:cnNF { g__tag_struct_#1_prop } {P}\l__tag_tmpb_tl
           {
-            \prop_gput:cne { g__tag_struct_#1_prop } {P}{\pdf_object_ref_indexed:nn { __tag/struct }{1}}
+            \prop_gput:cne { g__tag_struct_#1_prop } {P}
+              {\pdf_object_ref_indexed:nn { __tag/struct }{1}}
             \prop_gput:cne { g__tag_struct_#1_prop } {S}{/Artifact}
             \seq_if_empty:cF {g__tag_struct_kids_#1_seq}
               {
@@ -2288,8 +2307,9 @@
         \msg_error:nnn { tag } { struct-no-objnum } { #1}
       }
   }
-\cs_new_protected:Npn \__tag_struct_insert_annot:nn #1 #2 %#1 object reference to the annotation/xform
-                                                       %#2 structparent number
+\cs_new_protected:Npn \__tag_struct_insert_annot:nn #1 #2
+ %#1 object reference to the annotation/xform
+ %#2 structparent number
   {
     \bool_if:NT \g__tag_active_struct_bool
       {
@@ -2311,7 +2331,8 @@
             #1 %
           }
           {
-            \pdf_pageobject_ref:n { \property_ref:nnn {@tag at objr@page@#2 }{ tagabspage }{1} }
+            \pdf_pageobject_ref:n
+              { \property_ref:nnn {@tag at objr@page@#2 }{ tagabspage }{1} }
           }
         % add the parent obj number to the parent tree:
         \exp_args:Nne
@@ -2320,7 +2341,8 @@
             #2
           }
           {
-            \pdf_object_ref_indexed:nn { __tag/struct }{ \l__tag_struct_stack_parent_tmpa_tl }
+            \pdf_object_ref_indexed:nn
+              { __tag/struct }{ \l__tag_struct_stack_parent_tmpa_tl }
           }
         % increase the int:
         \int_gincr:N \c at g__tag_parenttree_obj_int
@@ -2341,7 +2363,8 @@
 \socket_new:nn { tag/struct/tag }{1}
 \socket_new_plug:nnn { tag/struct/tag }{ latex-tags }
  {
-   \seq_set_split:Nne \l__tag_tmpa_seq { / } {#1/\prop_item:Ne\g__tag_role_tags_NS_prop{#1}}
+   \seq_set_split:Nne \l__tag_tmpa_seq { / }
+     {#1/\prop_item:Ne\g__tag_role_tags_NS_prop{#1}}
    \tl_gset:Ne \g__tag_struct_tag_tl   { \seq_item:Nn\l__tag_tmpa_seq {1} }
    \tl_gset:Ne \g__tag_struct_tag_NS_tl{ \seq_item:Nn\l__tag_tmpa_seq {2} }
    \__tag_check_structure_tag:N \g__tag_struct_tag_tl
@@ -2349,10 +2372,12 @@
 
 \socket_new_plug:nnn { tag/struct/tag }{ pdf-tags }
  {
-   \seq_set_split:Nne \l__tag_tmpa_seq { / } {#1/\prop_item:Ne\g__tag_role_tags_NS_prop{#1}}
+   \seq_set_split:Nne \l__tag_tmpa_seq { / }
+     {#1/\prop_item:Ne\g__tag_role_tags_NS_prop{#1}}
    \tl_gset:Ne \g__tag_struct_tag_tl   { \seq_item:Nn\l__tag_tmpa_seq {1} }
    \tl_gset:Ne \g__tag_struct_tag_NS_tl{ \seq_item:Nn\l__tag_tmpa_seq {2} }
-   \__tag_role_get:VVNN \g__tag_struct_tag_tl\g__tag_struct_tag_NS_tl\l__tag_tmpa_tl\l__tag_tmpb_tl
+   \__tag_role_get:VVNN
+     \g__tag_struct_tag_tl \g__tag_struct_tag_NS_tl \l__tag_tmpa_tl \l__tag_tmpb_tl
    \tl_gset:Ne \g__tag_struct_tag_tl {\l__tag_tmpa_tl}
    \tl_gset:Ne \g__tag_struct_tag_NS_tl{\l__tag_tmpb_tl}
    \__tag_check_structure_tag:N \g__tag_struct_tag_tl
@@ -2387,6 +2412,7 @@
           }
       },
     parent .default:n    = {-1},
+firstkid .code:n = { \tl_set:Nn \l__tag_struct_addkid_tl {left} },
     tag   .code:n        = % S property
       {
         \socket_use:nn { tag/struct/tag }{#1}
@@ -2548,7 +2574,7 @@
  }
 
 \cs_generate_variant:Nn \__tag_struct_add_inline_AF:nn {on}
-\cs_new_protected:Npn \__tag_struct_add_AF:nn #1 #2 % #1 struct num #2 object reference
+\cs_new_protected:Npn \__tag_struct_add_AF:nn #1 #2
   {
      \tl_if_exist:cTF
        {
@@ -2574,7 +2600,8 @@
       {
         \pdf_object_if_exist:eTF {#1}
           {
-            \__tag_struct_add_AF:ee { \int_use:N \c at g__tag_struct_abs_int }{\pdf_object_ref:e {#1}}
+            \__tag_struct_add_AF:ee
+             { \int_use:N \c at g__tag_struct_abs_int }{\pdf_object_ref:e {#1}}
             \__tag_struct_prop_gput:nne
              { \int_use:N \c at g__tag_struct_abs_int }
              { AF }
@@ -2788,7 +2815,7 @@
             %record this structure as kid:
             %\tl_show:N \g__tag_struct_stack_current_tl
             %\tl_show:N \l__tag_struct_stack_parent_tmpa_tl
-            \__tag_struct_kid_struct_gput_right:ee
+            \use:c { __tag_struct_kid_struct_gput_ \l__tag_struct_addkid_tl :ee }
                { \l__tag_struct_stack_parent_tmpa_tl }
                { \g__tag_struct_stack_current_tl }
             %\prop_show:c { g__tag_struct_\g__tag_struct_stack_current_tl _prop }
@@ -3515,9 +3542,9 @@
             {\tagmcbegin{tag=Lbl}}
            {#1}
          }
-   \tag_stop:n{hangfrom}
+   \tag_suspend:n{hangfrom}
    \hangindent \wd\@tempboxa\noindent
-   \tag_start:n{hangfrom}
+   \tag_resume:n{hangfrom}
    \tagmcbegin{}\box\@tempboxa\tagmcend\tagstructend\tagmcbegin{}
    }
  }
@@ -3768,11 +3795,11 @@
        \bool_gset_false:N \g__tag_in_mc_bool
      }
     \tag_mc_begin:n {artifact}
-    \tag_stop:n{headfoot}
+    \tag_suspend:n{headfoot}
  }
 \cs_new_protected:Npn \__tag_exclude_headfoot_end:
  {
-    \tag_start:n{headfoot}
+    \tag_resume:n{headfoot}
     \tag_mc_end:
     \bool_if:NTF \g__tag_mode_lua_bool
      {
@@ -3796,12 +3823,12 @@
      }
     \tag_struct_begin:n{tag=Artifact,attribute-class=__tag/attr/#1}
     \tag_mc_begin:n {artifact=#1}
-    \tag_stop:n{headfoot}
+    \tag_suspend:n{headfoot}
  }
 
 \cs_new_protected:Npn \__tag_exclude_struct_headfoot_end:
  {
-    \tag_start:n{headfoot}
+    \tag_resume:n{headfoot}
     \tag_mc_end:
     \tag_struct_end:
     \bool_if:NTF \g__tag_mode_lua_bool

Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty	2024-09-17 19:55:44 UTC (rev 72313)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty	2024-09-17 19:56:02 UTC (rev 72314)
@@ -1,5 +1,5 @@
 %\RequirePackage[enable-debug]{expl3}[2018/06/14]
-\ProvidesExplPackage {tagpdfdocu-patches} {2024-09-11} {0.99e}
+\ProvidesExplPackage {tagpdfdocu-patches} {2024-09-16} {0.99f}
  {patches/commands for the tagpdf documentation}
 \RequirePackage{etoolbox,xpatch}
 



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