texlive[67224] Master/texmf-dist: latex-lab (26may23)

commits+karl at tug.org commits+karl at tug.org
Fri May 26 23:07:57 CEST 2023


Revision: 67224
          http://tug.org/svn/texlive?view=revision&revision=67224
Author:   karl
Date:     2023-05-26 23:07:56 +0200 (Fri, 26 May 2023)
Log Message:
-----------
latex-lab (26may23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/README.md
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-code.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-doc.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/changes.txt
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-code.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-doc.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-amsmath.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-block-tagging.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-footnotes.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathpkg.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathtagging.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathtools.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-1.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-2.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-testphase.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-hyperref-changes.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-kernel-changes.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-tagging-functions.pdf
    trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-block-tagging.dtx
    trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx
    trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-mathtagging.dtx
    trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-new-or-1.dtx
    trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-testphase.dtx
    trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-hyperref-changes.dtx
    trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-kernel-changes.dtx
    trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-tagging-functions.dtx
    trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab.ins
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/block-tagging-latex-lab-testphase.ltx
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-footnotes.ltx
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-kernel-changes.sty
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-mathtagging.ltx
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-block-tagging.sty
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-new-or-1.sty
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/phase-III-latex-lab-testphase.ltx
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/sec-tagging-latex-lab-testphase.ltx
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/toc-tagging-latex-lab-testphase.ltx

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/TODOS-unsorted.md
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-bib.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-float.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-graphic.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-minipage.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-sec.pdf
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-footnotemark.md
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-footnotetext.md
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-kern-kern.md
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-makefntext.md
    trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-bib.dtx
    trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-float.dtx
    trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-graphic.dtx
    trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-minipage.dtx
    trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-sec.dtx
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/bib-latex-lab-testphase.ltx
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/float-latex-lab-testphase.ltx
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/graphic-latex-lab-testphase.ltx
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-bib.sty
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-float.sty
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-graphic.sty
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-minipage.sty
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-sec.sty
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-toc.sty
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/minipage-latex-lab-testphase.ltx

Removed Paths:
-------------
    trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-sec-tagging.pdf
    trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-sec-tagging.dtx
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-sec-tagging.sty
    trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-toc-tagging.sty

Modified: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex-dev/latex-lab/README.md	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/doc/latex-dev/latex-lab/README.md	2023-05-26 21:07:56 UTC (rev 67224)
@@ -1,6 +1,6 @@
 # LaTeX laboratory
 
-Release 2023-06-01 pre-release 2
+Release 2023-06-01 pre-release 3
 
 ## Overview
 

Added: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/TODOS-unsorted.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex-dev/latex-lab/TODOS-unsorted.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex-dev/latex-lab/TODOS-unsorted.md	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,33 @@
+
+# A number of todos (unsorted and incomplete)
+
+
+## Code extensions / cleanup
+
+### theorem-like envs
+
+ - this can currently only handle the simple version from LaTeX2e
+ - it is missing a proper set of templates
+ - it is missing extensions to support different styles (a la amsmath and the like)
+
+
+## Missing basic support
+
+ - `\textbf` should probably mapt to `<Strong>`
+ - `\emph` should probably map to `<Em>`
+
+ - Logos such as `\TeX` and `\LaTeX` should produce proper ActualText
+
+
+
+
+## Package Support
+
+### csquotes
+
+ - we can't really grab TeX's basic quotes, e.g.
+ ```
+   some quotes around ``text'' here
+```
+  at least not easily, but we can support `\enquote` and the like
+


Property changes on: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/TODOS-unsorted.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/blocks-code.pdf
===================================================================
(Binary files differ)

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

Modified: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/changes.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex-dev/latex-lab/changes.txt	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/doc/latex-dev/latex-lab/changes.txt	2023-05-26 21:07:56 UTC (rev 67224)
@@ -1,3 +1,40 @@
+2023-05-20 Ulrike Fischer <Ulrike.Fischer at latex-project.org>
+    * renamed latex-lab-sec-tagging -> latex-lab-sec for consistency
+      
+
+2023-05-19 Ulrike Fischer <Ulrike.Fischer at latex-project.org>
+	* new latex-lab-bib.dtx:
+	tagging support for cite and bibliography with standard LaTeX and natbib
+    * small corrections/adaptions in latex-lab-sec-tagging and latex-lab-toc-tagging
+
+2023-05-18 Ulrike Fischer <Ulrike.Fischer at latex-project.org>
+	* new latex-lab-floats.dtx:
+	tagging support for float environments
+    * new latex-lab-graphic.dtx
+    tagging support for includegraphics and picture environment
+    * new latex-lab-minipage.dtx
+    tagging support for minipage and parbox
+
+2023-05-16  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* latex-lab-block-tagging.dtx (subsubsection{Verbatim instances}):
+	verbatim environments get their own block instances so that they can receive
+	special formatting instructions.
+	This also fixes a bug that we forgot to set par-skip to 0pt by default (tagpdf/74)
+
+	(paragraph{Helper commands for verbatim}):
+	The \legacyverbatimsetup command needs to execute \@@par inside a group, because
+	we need to preserve any outer setup to \parshape (tagpdf/79)
+
+2023-04-09 Ulrike Fischer <Ulrike.Fischer at latex-project.org>
+	* latex-lab-sec-tagging.dtx:
+	don't load extra glyphtounicode if \pdfglyphtounicode is not defined.
+
+2023-04-09 Ulrike Fischer <Ulrike.Fischer at latex-project.org>
+	* latex-lab-footnotes.dtx:
+	made \footnote and \footnotetext long
+
+
 2023-03-08  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* latex-lab-block-tagging.dtx:

Modified: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-code.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/documentmetadata-support-doc.pdf
===================================================================
(Binary files differ)

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

Added: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-bib.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-bib.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-bib.pdf	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-bib.pdf	2023-05-26 21:07:56 UTC (rev 67224)

Property changes on: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-bib.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-block-tagging.pdf
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-float.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-float.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-float.pdf	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-float.pdf	2023-05-26 21:07:56 UTC (rev 67224)

Property changes on: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-float.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-footnotes.pdf
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-graphic.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-graphic.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-graphic.pdf	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-graphic.pdf	2023-05-26 21:07:56 UTC (rev 67224)

Property changes on: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-graphic.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-mathpkg.pdf
===================================================================
(Binary files differ)

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

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

Added: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-minipage.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-minipage.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-minipage.pdf	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-minipage.pdf	2023-05-26 21:07:56 UTC (rev 67224)

Property changes on: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-minipage.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-new-or-2.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-sec-tagging.pdf
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-sec.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-sec.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-sec.pdf	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-sec.pdf	2023-05-26 21:07:56 UTC (rev 67224)

Property changes on: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-sec.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-testphase.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-hyperref-changes.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-kernel-changes.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/latex-lab-toc-tagging-functions.pdf
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-footnotemark.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-footnotemark.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-footnotemark.md	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,189 @@
+# Packages that alter \@footnotemark ...
+
+Scan of TeXlive 2022  for checking ... may not be longer accurate and may contain a few false positives
+
+```
+% bibarts
+
+\let\ba at footnmark=\@footnotemark
+\def\@footnotemark{\ifhmode{\nobreak \hskip 0.04em plus 0.01em}\else\leavevmode\fi\ba at footnmark}%
+
+
+% ./bxjscls/bxjsja-minimal.def
+
+\def\bxjs at cjk@loaded{%
+  \def\@footnotemark{%
+    \leavevmode
+    \ifhmode
+      \edef\@x at sf{\the\spacefactor}%
+      \ifdim\lastkern>\z@\ifdim\lastkern<5sp\relax
+         \unkern\unkern
+         \ifdim\lastskip>\z@ \unskip \fi
+      \fi\fi
+      \nobreak
+    \fi
+    \@makefnmark
+    \ifhmode \spacefactor\@x at sf \fi
+    \relax}%
+  \let\bxjs at cjk@loaded\relax
+}
+
+% ./arabtex/afoot.sty
+
+\let \a@@footnotemark \@footnotemark
+
+\def \a at footnotemark {% inside Arabic environment
+\iftrans \unskip \unskip \nobreak \@makefnmark \fi 
+\ifarab \a at spacefalse \putwordb at x \@makefnmark \a at spacetrue \fi }
+
+% ./hyperref/hyperref.sty
+
+  \def\@footnotemark{%
+    \leavevmode
+    \ifhmode\edef\@x at sf{\the\spacefactor}\nobreak\fi
+    \stepcounter{Hfootnote}%
+    \global\let\Hy at saved@currentHref\@currentHref
+    \hyper at makecurrent{Hfootnote}%
+    \global\let\Hy at footnote@currentHref\@currentHref
+    \global\let\@currentHref\Hy at saved@currentHref
+    \hyper at linkstart{link}{\Hy at footnote@currentHref}%
+    \@makefnmark
+    \hyper at linkend
+    \ifhmode\spacefactor\@x at sf\fi
+    \relax
+  }%
+
+
+% ./hypdvips/hypdvips.sty
+
+  \def\@footnotemark{%
+    \leavevmode
+    \ifhmode\edef\@x at sf{\the\spacefactor}\nobreak\fi
+    \stepcounter{Hfootnote}%
+    \global\let\Hy at saved@currentHref\@currentHref
+    \hyper at makecurrent{Hfootnote}%
+    \global\let\Hy at footnote@currentHref\@currentHref
+    \global\let\@currentHref\Hy at saved@currentHref
+    \ifHy at draft%
+      \@makefnmark%
+    \else%
+      \pp at hyperfootnote%
+    \fi%
+    \ifhmode\spacefactor\@x at sf\fi
+    \relax
+    }
+
+  \newcommand{\pp at hyperfootnote}{%
+    \ifx\pp at activerect\pp at true%
+      \@makefnmark%
+    \else%
+      \ifpp at smallfootnotes%
+        \let\pp at backup@@thefnmark\@thefnmark%
+        \renewcommand{\@thefnmark}{\pdf at rect{\pp at backup@@thefnmark}}%
+        \Hy at colorlink\@footnotecolor%
+        \@makefnmark%
+        \Hy at endcolorlink%
+        \pdfmark{%
+          pdfmark=/ANN,%
+          linktype=footnote,%
+          Subtype=/Link,%
+          AcroHighlight=\@pdfhighlight,%
+          Border=\@pdfborder,%
+          BorderStyle=\@pdfborderstyle,%
+          Color=\@footnotebordercolor,%
+          Dest=\Hy at footnote@currentHref,%
+          Raw=H.B%
+          }%
+      \let\@thefnmark\pp at backup@@thefnmark%
+      \else%
+        \pdfmark[\@makefnmark]{%
+          pdfmark=/ANN,%
+          linktype=footnote,%
+          Subtype=/Link,%
+          AcroHighlight=\@pdfhighlight,%
+          Border=\@pdfborder,%
+          BorderStyle=\@pdfborderstyle,%
+          Color=\@footnotebordercolor,%
+          Dest=\Hy at footnote@currentHref%
+          }%
+      \fi%
+    \fi%
+    }
+
+
+% ./memoir/memhfixc.sty
+
+\ifHy at hyperfootnotes
+ \def\@footnotemark{%
+    \leavevmode
+    \ifhmode\edef\@x at sf{\the\spacefactor}%
+      \m at mmf@check% <--- added
+    \nobreak\fi
+    \stepcounter{Hfootnote}%
+    \global\let\Hy at saved@currentHref\@currentHref
+    \hyper at makecurrent{Hfootnote}%
+    \global\let\Hy at footnote@currentHref\@currentHref
+    \global\let\@currentHref\Hy at saved@currentHref
+    \hyper at linkstart{link}{\Hy at footnote@currentHref}%
+    \@makefnmark
+    \hyper at linkend
+    \m at mmf@prepare% <--- added
+    \ifhmode\spacefactor\@x at sf\fi
+    \relax
+  }%
+\fi
+
+
+% caption3.sty
+
+% this is altering the top-level when inside a float
+
+
+% ./koma-script/scrlttr2.cls
+
+\newcommand*{\scr at footnotemark}{%
+  \leavevmode
+  \ifhmode\edef\@x at sf{\the\spacefactor}\FN at mf@check\nobreak\fi
+  \@makefnmark
+  \csname FN at mf@prepare\endcsname
+  \ifhmode\spacefactor\@x at sf\fi
+  \relax}
+
+% tested against this ...
+
+\newcommand*{\scr at saved@footnotemark}{%
+  \leavevmode
+  \ifhmode\edef\@x at sf{\the\spacefactor}\nobreak\fi
+  \@makefnmark
+  \ifhmode\spacefactor\@x at sf\fi
+  \relax}
+
+
+% ./chextras/chextras.sty
+
+\ifstd at notes\else
+ \let\std at footnotemark\@footnotemark
+ \def\alt at footnotemark{\unskip\thinspace\std at footnotemark}
+ \let\@footnotemark\alt at footnotemark
+
+% footmisx.sty
+
+  \newcommand*\@footmisxnotemark{%
+    \leavevmode
+    \ifhmode
+      \edef\@x at sf{\the\spacefactor}%
+      \FN at mf@check
+      \nobreak
+    \fi
+    \@footmicx at makefnmark
+    \ifFN at pp@towrite
+      \FN at pp@writetemp
+      \FN at pp@towritefalse
+    \fi
+    \FN at mf@prepare
+    \ifhmode\spacefactor\@x at sf\fi
+    \relax
+  }
+ 
+
+```


Property changes on: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-footnotemark.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-footnotetext.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-footnotetext.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-footnotetext.md	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,848 @@
+# Packages that alter \@footnotetext ...
+
+Scan of TeXlive 2022  for checking ... may not be longer accurate and may contain a few false positives
+
+```
+
+% ./bibarts/bibarts.sty
+
+\let\ba at footnotetext=\@footnotetext
+\long\def\@footnotetext#1{\ba at footnotetext{%
+   \global\let\thisto at ba=-%
+   \global\let\thisti at ba=-%
+   \global\let\thisp at ba=-%
+   \global\let\thisvol at ba=-%
+   \global\let\thiss at ba=-%
+   \global\let\thisn at ba=-%
+   \global\let\pos at ba=0%
+    \kern 0.1em\nulskip at ba{\@footnotetrue\ignorespaces
+    #1\nulskip at ba\ba at textmode}\global\let\lastto at ba=\thisto at ba
+   \global\let\lastti at ba=\thisti at ba
+   \global\let\lastp at ba=\thisp at ba
+   \global\let\lastvol at ba=\thisvol at ba
+   \global\let\lasts at ba=\thiss at ba
+   \global\let\lastn at ba=\thisn at ba}}%
+
+
+% ./fnbreak/fnbreak.sty
+
+  \let\fnb at orig@footnotetext\@footnotetext
+  \long\def\@footnotetext#1{\fnb at orig@footnotetext{\fnb at fnstart#1\fnb at fnend}}%
+
+
+% ./revtex4-1/revtex4-1.cls  ./revtex/ltxutil.sty ./revtex/revtex4-2.cls ...
+
+\long\def\@footnotetext{%
+ \insert\footins\bgroup
+  \make at footnotetext
+}%
+\long\def\@mpfootnotetext{%
+ \minipagefootnote at pick
+  \make at footnotetext
+}%
+\long\def\make at footnotetext#1{%
+  \set at footnotefont
+  \set at footnotewidth
+  \@parboxrestore
+  \protected at edef\@currentlabel{%
+   \csname p@\@mpfn\endcsname\@thefnmark
+  }%
+  \color at begingroup
+   \@makefntext{%
+    \rule\z@\footnotesep\ignorespaces#1%
+    \@finalstrut\strutbox\vadjust{\vskip\z at skip}%
+   }%
+  \color at endgroup
+ \minipagefootnote at drop
+}%
+
+
+% ./nrc/nrc1.cls  ./nrc/nrc2.cls
+
+% this is missing the \par at the end and \@currentcounter
+
+\long\def\@footnotetext#1{%
+  \insert\footins{%
+    \reset at font\smallt
+    \interlinepenalty\interfootnotelinepenalty
+    \splittopskip\footnotesep
+    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+    \hsize\columnwidth \@parboxrestore
+    \protected at edef\@currentlabel{%
+       \csname p at footnote\endcsname\@thefnmark
+    }%
+    \color at begingroup
+      \@makefntext{%
+        \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox
+      }%
+    \color at endgroup
+  }%
+}%
+
+%-------------------------------------
+
+% ./bigfoot/bigfoot.sty
+
+  \def\@footnotetext{\Footnotetextdefault{}}%
+
+%-------------------------------------
+
+
+% ./uafthesis/uafthesis.cls
+
+% this is missing the \par at the end and \@currentcounter
+
+%% this little gem provides for single-spaced footnotes
+\long\def\@footnotetext#1{\insert\footins{%
+    \ssp
+    \reset at font\footnotesize
+    \interlinepenalty\interfootnotelinepenalty
+    \splittopskip\footnotesep
+    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+    \hsize\columnwidth \@parboxrestore
+   \edef\@currentlabel{\csname p at footnote\endcsname\@thefnmark}\@makefntext
+    {\rule{\z@}{\footnotesep}\ignorespaces
+      #1\strut}}}
+
+%-------------------------------------
+
+
+
+% ./resphilosophica/resphilosophica.cls
+
+% I wonder if this \, is really intended below ...
+
+\long\def\@footnotetext#1{%
+  \insert\footins{%
+    \normalfont\footnotesize
+    \interlinepenalty\interfootnotelinepenalty
+    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
+    \floatingpenalty\@MM \hsize\columnwidth
+    \@parboxrestore \parindent\normalparindent \sloppy
+    \protected at edef\@currentlabel{%
+      \csname p at footnote\endcsname\@thefnmark}%
+    \@makefntext{%
+      \,\rule\z@\footnotesep\ignorespaces#1\unskip\strut\par}}}
+
+%-------------------------------------
+
+
+
+% ./setspace/setspace.sty
+
+% this is missing the \par at the end and \@currentcounter
+
+\long\def\@footnotetext#1{%
+  \insert\footins{%
+% GT:  Next line added.  Hook desired here!
+    \def\baselinestretch {\setspace at singlespace}%
+    \reset at font\footnotesize
+    \interlinepenalty\interfootnotelinepenalty
+    \splittopskip\footnotesep
+    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+    \hsize\columnwidth
+    \@parboxrestore
+    \protected at edef\@currentlabel{%
+      \csname p at footnote\endcsname\@thefnmark
+    }%
+    \color at begingroup
+      \@makefntext{%
+        \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+    \color at endgroup}}
+
+%-------------------------------------
+
+
+
+% ./linguex/linguex.sty
+
+
+\let\predefinedfootnotetext=\@footnotetext
+\long\def\@footnotetext#1{\@noftnotefalse\predefinedfootnotetext{#1}%
+         \@noftnotetrue}
+
+
+%-------------------------------------
+
+
+% ./fnpara/fnpara.sty
+
+\long\def\@footnotetext#1{\insert\footins{%
+    \reset at font\footnotesize
+    \interlinepenalty\interfootnotelinepenalty
+    \splittopskip\footnotesep
+    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+    \hsize\columnwidth \@parboxrestore
+    \protected at edef\@currentlabel{%
+       \csname p at footnote\endcsname\@thefnmark
+    }%
+    \color at begingroup
+    \setbox0=\hbox{%
+      \@makefntext{%
+        \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox
+        \penalty -10
+        \hskip\footglue
+      }%
+    }%
+    \dp0=0pt \ht0=\fudgefactor\wd0 \box0
+    \color at endgroup}}
+
+%-------------------------------------
+
+
+% ./footmisc/footmisc.sty (para option)
+
+% this is missing the \par at the end and \@currentcounter
+
+  \long\def\FN at footnotetext#1{%
+    \insert\footins{%
+      \ifFN at setspace
+        \let\baselinestretch\FN at baselinestretch
+      \fi
+      \reset at font\footnotesize
+      \interlinepenalty\interfootnotelinepenalty
+      \splittopskip\footnotesep
+      \splitmaxdepth \dp\strutbox
+      \floatingpenalty\@MM
+      \hsize\columnwidth
+      \@parboxrestore
+      \protected at edef\@currentlabel{\csname p at footnote\endcsname\@thefnmark}%
+      \color at begingroup
+        \setbox\FN at tempboxa\hbox{%
+          \@makefntext{\ignorespaces#1\strut
+            \penalty-10\relax
+            \hskip\footglue
+          }% end of \@makefntext parameter
+        }% end of \hbox
+        \dp\FN at tempboxa\z@
+        \ht\FN at tempboxa\dimexpr\wd\FN at tempboxa *%
+                        \footnotebaselineskip / \columnwidth\relax
+        \box\FN at tempboxa
+      \color at endgroup
+    }%
+    \FN at mf@prepare
+  }
+
+%-------------------------------------
+
+
+% ./footmisc/footmisc.sty (normal)
+
+% this is missing the \par at the end and \@currentcounter
+
+    \long\def\FN at footnotetext#1{%
+      \insert\footins{%
+        \ifFN at setspace
+          \let\baselinestretch\FN at baselinestretch
+        \fi
+        \reset at font\footnotesize
+        \interlinepenalty\interfootnotelinepenalty
+        \splittopskip\footnotesep
+        \splitmaxdepth \dp\strutbox
+        \floatingpenalty\@MM
+        \hsize\columnwidth
+        \@parboxrestore
+        \protected at edef\@currentlabel{%
+          \csname p at footnote\endcsname\@thefnmark
+        }%
+        \color at begingroup
+          \@makefntext{%
+            \rule\z@\footnotesep
+            \ignorespaces#1\@finalstrut\strutbox
+          }%
+        \color at endgroup
+      }%
+      \FN at mf@prepare
+    }%
+
+
+
+%-------------------------------------
+
+
+% ./footmisc/footmisc.sty (side option)
+
+    \long\def\FN at footnotetext#1{%
+      \marginpar{%
+        \ifFN at setspace
+          \let\baselinestretch\FN at baselinestretch
+        \fi
+        \reset at font\footnotesize
+        \protected at edef\@currentlabel{%
+          \csname p at footnote\endcsname\@thefnmark
+        }%
+        \color at begingroup
+          \@makefntext{%
+            \ignorespaces#1%
+          }%
+        \color at endgroup
+      }%
+      \FN at mf@prepare
+    }%
+
+
+
+%-------------------------------------
+
+
+
+% ./bxjscls/bxjsarticle.cls ./bxjscls/bxjsbook.cls ...
+
+\long\def\@footnotetext{%
+  \insert\footins\bgroup
+    \normalfont\footnotesize
+    \interlinepenalty\interfootnotelinepenalty
+    \splittopskip\footnotesep
+    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+    \hsize\columnwidth \@parboxrestore
+    \protected at edef\@currentlabel{%
+       \csname p at footnote\endcsname\@thefnmark
+    }%
+    \color at begingroup
+      \@makefntext{%
+        \rule\z@\footnotesep\ignorespaces}%
+      \futurelet\jsc at next\jsc at fo@t}
+\def\jsc at fo@t{\ifcat\bgroup\noexpand\jsc at next \let\jsc at next\jsc at f@@t
+                                \else \let\jsc at next\jsc at f@t\fi \jsc at next}
+\def\jsc at f@@t{\bgroup\aftergroup\jsc@@foot\let\jsc at next}
+\def\jsc at f@t#1{#1\jsc@@foot}
+\def\jsc@@foot{\@finalstrut\strutbox\color at endgroup\egroup
+  \ifx\pltx at foot@penalty\@undefined\else
+    \ifhmode\null\fi
+    \ifnum\pltx at foot@penalty=\z@\else
+      \penalty\pltx at foot@penalty
+      \pltx at foot@penalty\z@
+    \fi
+  \fi}
+
+
+not covered so far supports \footnote{ catcode changes ...} but also
+\foonote A  --- the latter is questionable I would say
+
+
+%-------------------------------------
+
+
+% ./fn2end/fn2end.sty
+
+obsolete I guess, ignored in evaluation
+
+
+%-------------------------------------
+
+
+% ./hyperref/hyperref.sty
+
+  \long\def\@footnotetext#1{%
+    \H@@footnotetext{%
+      \ifHy at nesting
+        \expandafter\ltx at firstoftwo
+      \else
+        \expandafter\ltx at secondoftwo
+      \fi
+      {%
+        \expandafter\hyper@@anchor\expandafter{%
+          \Hy at footnote@currentHref
+        }{\ignorespaces #1}%
+      }{%
+        \Hy at raisedlink{%
+          \expandafter\hyper@@anchor\expandafter{%
+            \Hy at footnote@currentHref
+          }{\relax}%
+        }%
+        \let\@currentHref\Hy at footnote@currentHref
+        \let\@currentlabelname\@empty
+        \ignorespaces #1%
+      }%
+    }%
+  }%
+
+
+Handling of anchors (in nested context) I guess. This needs to be
+married with the anchor setting that the tagging currently does and
+the latter improved/adjusted
+
+
+%-------------------------------------
+
+% ./biblatex-gb7714-2015/gb7714-2015ms.bbx ./biblatex-gb7714-2015/gb7714-2015mx.bbx ...
+
+    \long\def\@footnotetext##1{\insert\footins{%
+    \reset at font\footnotesize
+    \interlinepenalty\interfootnotelinepenalty
+    \splittopskip\footnotesep
+    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+    \hsize\columnwidth \@parboxrestore
+    \protected at edef\@currentlabel{%
+       \csname p at footnote\endcsname\@thefnmark
+    }%
+    \color at begingroup
+    \leftskip \footbibmargin%增加的左侧缩进
+      \@makefntext{%
+        \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox%
+        }%
+    \color at endgroup}}%
+
+fits the structure
+%-------------------------------------
+
+
+% ./amscls/amsbook.cls ./amscls/amsproc.cls ./amscls/amsart.cls ...
+
+\long\def\@footnotetext#1{%
+  \insert\footins{%
+    \normalfont\footnotesize
+    \interlinepenalty\interfootnotelinepenalty
+    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
+    \floatingpenalty\@MM \hsize\columnwidth
+    \@parboxrestore \parindent\normalparindent \sloppy
+    \protected at edef\@currentlabel{%
+      \csname p at footnote\endcsname\@thefnmark}%
+    \@makefntext{%
+      \rule\z@\footnotesep\ignorespaces#1\unskip\strut\par}}}
+
+fits the structure
+%-------------------------------------
+
+
+% ./umich-thesis/umich-thesis.cls
+
+% change LaTeX's footnotes to get vertical spacing correct
+\skip\footins \baselinestretch2\skip\footins
+\long\def\@footnotetext#1{%
+  \insert\footins{%
+    \def\baselinestretch {\setspace at singlespace}%
+    \reset at font\footnotesize
+    \interlinepenalty\interfootnotelinepenalty
+    \splittopskip\footnotesep
+    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+    \hsize\columnwidth
+    \@parboxrestore
+    \vskip 1.2\baselineskip
+    \protected at edef\@currentlabel{%
+      \csname p at footnote\endcsname\@thefnmark
+    }%
+    \color at begingroup
+      \@makefntext{%
+        \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+    \color at endgroup}}
+
+fits the structure
+%-------------------------------------
+
+
+% ./nostarch/nostarch.cls
+
+\long\def\@footnotetext#1{\insert\footins{%
+    \reset at font\footnotesize
+    \interlinepenalty\interfootnotelinepenalty
+    \splittopskip\footnotesep
+    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+    \hsize\columnwidth \@parboxrestore
+    \protected at edef\@currentlabel{%
+       \csname p at footnote\endcsname\@thefnmark
+    }%
+    \color at begingroup
+      \@makefntext{%
+        \rule\z@{13.5pt}\ignorespaces#1}%
+    \color at endgroup}}%
+
+fixed \footsep, probably very old
+fits the structure
+%-------------------------------------
+
+
+
+% ./coursepaper/coursepaper.cls
+
+\long\def\@footnotetext#1{%
+  \insert\footins{%
+    \def\baselinestretch {1}%
+    \reset at font\footnotesize
+    \interlinepenalty\interfootnotelinepenalty
+    \splittopskip\footnotesep
+    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+    \hsize\columnwidth
+    \@parboxrestore
+    \protected at edef\@currentlabel{%
+      \csname p at footnote\endcsname\@thefnmark
+    }%
+    \color at begingroup
+      \@makefntext{%
+        \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+    \color at endgroup}}
+
+fits the structure
+%-------------------------------------
+
+
+
+% ./ucthesis/ucthesis.cls
+
+% Single-space footnotes.
+\long\def\@footnotetext#1{\insert\footins{\ssp\reset at font\footnotesize
+    \interlinepenalty\interfootnotelinepenalty
+    \splittopskip\footnotesep
+    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+    \hsize\columnwidth \@parboxrestore
+   \edef\@currentlabel{\csname p at footnote\endcsname\@thefnmark}\@makefntext
+    {\rule{\z@}{\footnotesep}\ignorespaces
+      #1\strut}}}
+
+fits the structure
+%-------------------------------------
+
+
+
+% ./jura/jura.cls
+
+\long\def\@footnotetext#1{\insert\footins{%
+    \linespread{\J at FootnoteSpread}\reset at font\footnotesize
+    \interlinepenalty\interfootnotelinepenalty
+    \splittopskip\footnotesep
+    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+    \hsize\columnwidth \@parboxrestore
+    \protected at edef\@currentlabel{%
+       \csname p at footnote\endcsname\@thefnmark
+    }%
+    \color at begingroup
+      \@makefntext{%
+        \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+    \color at endgroup}}%
+
+fits the structure
+%-------------------------------------
+
+
+% ./asaetr/asaesub.sty
+
+2.09
+
+%-------------------------------------
+
+
+% ./lineno/fnlineno.sty
+
+%% |\FNLN@@text| stores the `\@footnotetext' found, 
+%% we might check if it is `\FNLN at ltx@fntext' ... %% TODO
+\let\FNLN@@text\@footnotetext
+\def\@footnotetext{%
+    \ifLineNumbers  \expandafter \FNLN at text
+    \else           \expandafter \FNLN@@text
+    \fi}
+
+
+\def \FNLN at text {%                      %% 2010/12/31 arg read later
+    \vadjust{\penalty-\FNLN at M@swap at codepen}%
+%% Standard \LaTeX's `\@footnotetext' expands `\@thefnmark' 
+%% to produce the footnote mark at the page bottom, 
+%% right after it has been determined for the mark 
+%% in the main text. \emph{Here} the footnote text 
+%% will be typeset only when \emph{other} footnote marks
+%% may have been formed for typesetting the main text 
+%% paragraph before. 
+%% %%% (TODO clearer wording)
+%% In the \strong{footnote list} 
+%% macro |\FNLN at list|, the (\dqtd{`&\protect'ed})
+%% \emph{current} expansion <mark> of `\@thefnmark' 
+%% is stored as an item preceding the footnote text 
+%% <text>. One footnote entry in `\FNLN at list' 
+%% thus has the form \lq`<mark>\@lt<text>\@lt'\rq.
+%% \LaTeX's internal `\g at addto@macro' is used to \emph{append} 
+%% an entry to the list (at the right). The OTR will later 
+%% take the entries from the left of the list. 
+%% 
+%% The argument of the auxiliary/temporary `\@tempa' 
+%% will contain the footnote text and thus must be able to 
+%% carry `\par' tokens. We therefore need a `\long' version of 
+%% `\protected at edef':
+   \let\@@protect\protect
+   \let\protect\@unexpandable at protect
+   \afterassignment\restore at protect
+   \long \edef \@tempa ##1{%
+        \noexpand\g at addto@macro \noexpand\FNLN at list {%
+            \@thefnmark \noexpand\@lt ##1\noexpand \@lt}}%
+%% ... issuing 
+%%     \lq`\g at addto@macro\FNLN at list{<mark>\elt<text>\@lt}'\rq\ ...
+   \@tempa                              %% reads arg
+}
+%% Here we initialize |\FNLN at list|:
+\let\FNLN at list\@empty
+
+
+
+probably continues working but needs separate checking
+
+%-------------------------------------
+
+
+
+% ./jurabib/jurabib.sty
+
+      \long\def\@footnotetext#1{%
+           \Orig at tabularx@footnotetext{%
+              \jb at fntrue
+              #1%
+              \setcounter{jb at cites@in at footnote}{0}%
+           }%
+      }%
+
+      \let\jbsaved at footnotetext\@footnotetext
+      \long\def\@footnotetext#1{%
+         \begingroup
+          \jb at fntrue
+          \jbsaved at footnotetext{#1}%
+          \setcounter{jb at cites@in at footnote}{0}%
+         \endgroup
+      }%
+
+
+first is table notes, second
+fits the structure
+%-------------------------------------
+
+
+
+% ./york-thesis/york-thesis.cls
+
+\long\def\@footnotetext#1{%
+ \insert\footins{%
+  \def\baselinestretch {1}%
+  \reset at font\footnotesize
+  \interlinepenalty\interfootnotelinepenalty
+  \splittopskip\footnotesep
+  \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+  \hsize\columnwidth
+  \@parboxrestore
+  \protected at edef\@currentlabel{%
+    \csname p at footnote\endcsname\@thefnmark}%
+  \color at begingroup
+    \@makefntext{%
+      \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+  \color at endgroup}}
+
+fits the structure
+%-------------------------------------
+
+
+% ./ucdavisthesis/ucdavisthesis.cls
+
+\long\def\@footnotetext#1{\insert\footins{\renewcommand\baselinestretch{1}
+    \footnotesize
+    \interlinepenalty\interfootnotelinepenalty
+    \splittopskip\footnotesep
+    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+    \hsize\columnwidth \@parboxrestore
+   \edef\@currentlabel{\csname p at footnote\endcsname\@thefnmark}\@makefntext
+    {\rule{\z@}{\footnotesep}\ignorespaces
+      #1\strut}\renewcommand\baselinestretch{\@spacing}}}
+
+looks old ...
+fits the structure
+%-------------------------------------
+
+
+% ./ledmac/afoot.sty
+
+fairly old and buggy in some aspects
+
+%%% Make the LaTeX \cs{footnote} catcode-safe, like in Plain TeX.
+
+\def \@footnotetext {%        new, do not yet read footnote text
+  \insert \footins \bgroup
+  \ifx \footglue \undefined %  prepare normal footnote
+    \interlinepenalty \interfootnotelinepenalty \floatingpenalty \@MM
+    \splittopskip \footnotesep \splitmaxdepth \dp \strutbox
+  \else
+    \global\long\def \@makefntext ##1{{$^{\@thefnmark }$}##1\nobreak }%
+    \setbox0=\hbox \bgroup % fnpara.sty is present
+    \floatingpenalty=20000 \footnotesize
+  \fi
+  \edef\@currentlabel{\csname p at footnote\endcsname\@thefnmark}%
+  \a at fntext }
+
+
+%-------------------------------------
+
+
+% ./toptesi/toptesi.sty
+
+
+\long\def\@footnotetext#1{\insert\footins{\linespread{1}\footnotesize
+    \interlinepenalty\interfootnotelinepenalty
+    \splittopskip\footnotesep
+    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+    \hsize\columnwidth \@parboxrestore
+   \edef\@currentlabel{\csname p at footnote\endcsname\@thefnmark}%
+   \@makefntext{\rule{\z@}{\footnotesep}\ignorespaces#1\strut}}}
+
+
+fits the structure
+%-------------------------------------
+
+
+% ./gb4e/gb4e.sty
+
+\let\@gbsaved at footnotetext=\@footnotetext
+\long\def\@footnotetext#1{%
+    \@noftnotefalse\setcounter{fnx}{0}%
+    \@gbsaved at footnotetext{#1}%
+    \@noftnotetrue}
+
+fits the structure
+%-------------------------------------
+
+
+
+% ./koma-script/scrlttr2.cls ./koma-script/scrextend.sty ./koma-script/scrreprt.cls ...
+
+same bug as footmisc: the @prepare is in the wrong place
+
+fits the structure
+%-------------------------------------
+
+
+
+% ./tabu/tabu.sty
+
+not checked what that does
+
+
+%-------------------------------------
+
+
+% ./uwthesis/uwthesis.cls
+
+does chapter notes -- ignore for now
+
+%-------------------------------------
+
+
+% ./tools/multicol.sty
+
+\long\def\mult at footnotetext#1{\begingroup
+         \columnwidth\textwidth
+         \orig at footnotetext{#1}\endgroup}
+
+
+fits the structure, but need to think what makes sense here as this a
+temporary redefinition for the environment only
+
+%-------------------------------------
+
+
+% ./fancyvrb/fancyvrb.sty
+
+\long\def\V at footnotetext{%
+  \afterassignment\V@@footnotetext
+  \let\@tempa}
+\def\V@@footnotetext{%
+  \insert\footins\bgroup
+  \csname reset at font\endcsname
+  \footnotesize
+  \interlinepenalty\interfootnotelinepenalty
+  \splittopskip\footnotesep
+  \splitmaxdepth\dp\strutbox
+  \floatingpenalty \@MM
+  \hsize\columnwidth
+  \@parboxrestore
+  \def\@currentcounter{footnote}%
+  \edef\@currentlabel{\csname p at footnote\endcsname\@thefnmark}%
+  \@makefntext{}%
+  \rule{\z@}{\footnotesep}%
+  \bgroup
+  \aftergroup\V@@@footnotetext
+  \ignorespaces}
+\def\V@@@footnotetext{\strut\egroup}
+
+
+another one of the footnote commands that do not read they argument as an argument
+
+%-------------------------------------
+
+
+% ./savefnmark/savefnmark.sty
+
+obsolete
+
+%-------------------------------------
+
+
+% ./changebar/changebar.sty
+
+\let\ltx at footnotetext\@footnotetext
+\long\def\cb at footnotetext#1{%
+  \cb at trace@stack{end footnote on page \the\c at page}%
+  \cb at pop\cb at currentstack
+  \ifnum\cb at topleft=\cb at nil
+    \ltx at footnotetext{#1}%
+  \else
+    \cb at push\cb at currentstack
+    \edef\cb at temp{\the\cb at curbarwd}%
+    \ltx at footnotetext{\cb at start[\cb at temp]#1\cb at end}%
+  \fi}
+\let\@footnotetext\cb at footnotetext
+
+
+% ./eledmac/eledmac.sty
+
+\apptocmd{\@footnotetext}{\m at mmf@prepare}{}{}
+\pretocmd{\@footnotetext}{%
+  \ifnumberedpar@
+    \edtext{}{\l at dbfnote{#1}}%
+  \else
+  }{}{}
+\apptocmd{\@footnotetext}{\fi}{}{}%
+
+
+% ./yafoot/dblfnote.sty
+
+\long\def\dfn at footnotetext#1{{\setbox\dfn at boxa\vbox{
+        \let\insert\dfn at gobble
+        \columnwidth\DFNcolumnwidth \hbadness\c at DFNsloppiness
+        \def\@makefnmark{\smash{\dfn at makefnmark}}
+        \dfn at latex@footnotetext{#1}\par \boxmaxdepth\dfn at fnmaxdp}%
+        \dfn at dima\ht\dfn at boxa \advance\dfn at dima\dp\dfn at boxa
+        \ifdim\dfn at dima>\z@\else
+                \dfn at dima1sp\relax
+                \setbox\dfn at boxa\vbox{\vbox to1sp{\unvbox\dfn at boxa\vfil}}\fi
+        \global\setbox\dfn at ins\vbox{\boxmaxdepth\dfn at fnmaxdp
+                \ifvoid\dfn at ins\else
+                        \unvbox\dfn at ins \allowbreak \nointerlineskip \fi
+                \ifdfn at allowcbreak \unvbox \else \box \fi \dfn at boxa}%
+        \setbox\dfn at boxa\copy\dfn at ins
+        \dfn at split{.5\ht\dfn at boxa}\dfn at boxa\dfn at boxb\dfn at fnmaxdp\footnotesep
+        \advance\@tempdima\@tempdimb \@tempdimb\@tempdima
+        \advance\@tempdima-\dfn at fnht \global\dfn at fnht\@tempdimb
+        \insert\footins{\floatingpenalty\@MM \vbox to\@tempdima{}}%
+        \xdef\dfn at list{\dfn at list\@elt{\number\dfn at dima}{\number\@tempdima}}}}
+\let\dfn at latex@footnotetext\@footnotetext
+\let\@footnotetext\dfn at footnotetext
+
+
+% ./ftnxtra/ftnxtra.sty
+
+not checked what this does
+
+
+% ./acmart/acmart.cls
+
+\if at ACM@sigchiamode
+\long\def\@footnotetext#1{\marginpar{%
+    \reset at font\small
+    \interlinepenalty\interfootnotelinepenalty
+    \protected at edef\@currentlabel{%
+       \csname p at footnote\endcsname\@thefnmark
+    }%
+    \color at begingroup
+      \@makefntext{%
+        \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+    \color at endgroup}}%
+\fi
+
+
+% ./memoir/memoir.cls
+
+ this needs some further analysis
+
+```


Property changes on: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-footnotetext.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-kern-kern.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-kern-kern.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-kern-kern.md	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,88 @@
+# Packages that use double \kern's
+
+Scan of TeXlive 2022  for checking ... may not be longer accurate and may contain a few false positives
+(definitely contains bogus entries right now)
+
+
+```
+
+      \ifdim\lastkern>\z@\ifdim\lastkern<5sp\relax
+./bxjscls/bxjsja-minimal.def
+
+
+
+    \ifdim\lastkern=-3sp \unkern
+      \ifdim\lastkern=3sp \kern-3sp
+    {\kern\MT at outer@kern\kern3sp\kern-3sp\relax}%
+./microtype/letterspace.sty
+
+
+    \ifdim\lastkern=-3sp \unkern
+      \ifdim\lastkern=3sp \kern-3sp
+    {\kern\MT at outer@kern\kern3sp\kern-3sp\relax}%
+./microtype/microtype-pdftex.def
+
+ 
+    \ifdim\lastkern=-3sp \unkern
+      \ifdim\lastkern=3sp \kern-3sp
+    {\kern\MT at outer@kern\kern3sp\kern-3sp\relax}%
+./microtype/microtype-luatex.def
+
+
+
+\providecommand*{\multiplefootnotemarker}{3sp}
+./eledmac/eledmac.sty
+
+
+
+\providecommand*{\multiplefootnotemarker}{3sp}
+./reledmac/reledmac.sty
+
+
+\edef\CJK at kern{\kern -2sp\kern 2sp}
+\edef\CJK at CJK{\kern -1sp\kern 1sp}
+./cjk/texinput/CJK.sty
+
+
+\edef\ruby at kern{\kern -5sp\kern 5sp}
+./cjk/texinput/ruby.sty
+
+
+%     hyphenation between pinyin syllables. Values 1sp-3sp are already used
+\edef\py at sp{\kern -4sp\kern 4sp}
+./cjk/texinput/pinyin.sty
+
+
+\providecommand*{\multiplefootnotemarker}{3sp}
+./tufte-latex/tufte-common.def
+
+
+
+\newcommand*{\multiplefootnotemarker}{3sp}
+./memoir/memoir.cls
+
+
+\providecommand*{\multiplefootnotemarker}{3sp}
+./parnotes/parnotes.sty
+
+
+\providecommand*{\multiplefootnotemarker}{3sp}
+./lwarp/lwarp-footmisc.sty
+
+
+  \bgroup \kern-3sp\kern3sp % kerns so I can test for beginning of list
+./examdesign/examdesign.cls
+
+
+    \kern-1sp \kern1sp }
+    \kern-2sp \kern2sp }
+    \kern-3sp \kern3sp }
+    \kern-4sp \kern4sp }
+./polyglossia/gloss-korean.ldf
+
+
+
+\NewDocumentCommand \@sidenotes at multisign { } {3sp}
+./sidenotes/sidenotes.sty
+
+```


Property changes on: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-kern-kern.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-makefntext.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-makefntext.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-makefntext.md	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,1751 @@
+# Packages that alter \@makefntext ...
+
+Scan of TeXlive 2022  for checking ... may not be longer accurate and may contain a few false positives
+
+```
+
+% ./footmisc/footmisc.sty
+
+% latex def (used with para option)
+
+
+
+  \long\def\@makefntext#1{%
+    \ifFN at hangfoot
+      \bgroup
+      \setbox\@tempboxa\hbox{%
+        \ifdim\footnotemargin>0pt
+          \hb at xt@\footnotemargin{\@makefnmark\hss}%
+        \else
+          \@makefnmark
+        \fi
+      }%
+      \leftmargin\wd\@tempboxa
+      \rightmargin\z@
+      \linewidth \columnwidth
+      \advance \linewidth -\leftmargin
+      \parshape \@ne \leftmargin \linewidth
+      \footnotesize
+      \@setpar{{\@@par}}%
+      \leavevmode
+      \llap{\box\@tempboxa}%
+      \parskip\hangfootparskip\relax
+      \parindent\hangfootparindent\relax
+    \else
+      \parindent1em
+      \noindent
+      \ifdim\footnotemargin>\z@
+        \hb at xt@ \footnotemargin{\hss\@makefnmark}%
+      \else
+        \ifdim\footnotemargin=\z@
+          \llap{\@makefnmark}%
+        \else
+          \llap{\hb at xt@ -\footnotemargin{\@makefnmark\hss}}%
+        \fi
+      \fi
+    \fi
+    \footnotelayout#1%
+    \ifFN at hangfoot
+      \par\egroup
+    \fi
+  }
+
+
+
+
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/aastex/aastex631.cls
+---------------------------------------------------------
+\def\@makefntext#1{\hsize=\columnwidth\mbox{}\hspace*{3mm}\@makefnmark~#1}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/paper/paper.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hbox to1.8em{\hss$\m at th^{\@thefnmark}$}##1}%
+...
+  \long\def\@makefntext#1{%
+        \leftskip 2.0em%
+        \noindent
+        \hbox to 0em{\hss\@makefnmark\kern 0.25em}#1}
+...
+  \long\def\@makefntext#1{%
+      \parindent 1em%
+      \noindent
+      \hbox to 1.8em{\hss\@makefnmark\kern 0.25em}#1}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/revtex4-1/aip4-1.rtx
+---------------------------------------------------------
+\def\@makefntext#1{%
+ \def\baselinestretch{1}%
+ \leftskip1em%
+ \parindent1em%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/revtex4-1/aps4-1.rtx
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+ \def\baselinestretch{1}%
+ \leftskip1em%
+ \parindent1em%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/revtex4-1/revtex4-1.cls
+---------------------------------------------------------
+\def\@makefntext#1{%
+  \def\baselinestretch{1}%
+  \parindent1em%
+  \noindent
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/smflatex/smfart.cls
+---------------------------------------------------------
+\def\@makefntext{\parindent0pt\sloppy\indent\@makefnmark}
+\hfuzz=1pt \vfuzz=\hfuzz
+\def\sloppy{\tolerance9999 \emergencystretch 3em\relax}
+\setcounter{topnumber}{4}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/smflatex/smfbook.cls
+---------------------------------------------------------
+\def\@makefntext{\parindent0pt\sloppy\indent\@makefnmark}
+\hfuzz=1pt \vfuzz=\hfuzz
+\def\sloppy{\tolerance9999 \emergencystretch 3em\relax}
+\setcounter{topnumber}{4}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/scrlttr2.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{%
+      \raggedfootnote
+      \leftskip #2
+      \l at addto@macro\@trivlist{%
+...
+    \long\def\@makefntext##1{%
+      \setlength{\@tempdimc}{#3}%
+      \def\@tempa{#1}\ifx\@tempa\@empty
+        \@setpar{\@@par
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/scrextend.sty
+---------------------------------------------------------
+    \long\def\@makefntext##1{%
+      \raggedfootnote
+      \leftskip #2
+      \l at addto@macro\@trivlist{%
+...
+    \long\def\@makefntext##1{%
+      \setlength{\@tempdimc}{#3}%
+      \def\@tempa{#1}\ifx\@tempa\@empty
+        \@setpar{\@@par
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/scrreprt.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{%
+      \raggedfootnote
+      \leftskip #2
+      \l at addto@macro\@trivlist{%
+...
+    \long\def\@makefntext##1{%
+      \setlength{\@tempdimc}{#3}%
+      \def\@tempa{#1}\ifx\@tempa\@empty
+        \@setpar{\@@par
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/scrartcl.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{%
+      \raggedfootnote
+      \leftskip #2
+      \l at addto@macro\@trivlist{%
+...
+    \long\def\@makefntext##1{%
+      \setlength{\@tempdimc}{#3}%
+      \def\@tempa{#1}\ifx\@tempa\@empty
+        \@setpar{\@@par
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/koma-script/scrbook.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{%
+      \raggedfootnote
+      \leftskip #2
+      \l at addto@macro\@trivlist{%
+...
+    \long\def\@makefntext##1{%
+      \setlength{\@tempdimc}{#3}%
+      \def\@tempa{#1}\ifx\@tempa\@empty
+        \@setpar{\@@par
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/uafthesis/uafthesis.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+    \parindent 1em%
+    \noindent
+    \hbox to 1.8em{\hss\@makefnmark}#1}
+...
+   \edef\@currentlabel{\csname p at footnote\endcsname\@thefnmark}\@makefntext
+    {\rule{\z@}{\footnotesep}\ignorespaces
+      #1\strut}}}
+
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/uwthesis/uwthesis.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{\parindent 1em\noindent \hangindent\parindent
+ \def\baselinestretch{1.0}\normalfont
+ \hb at xt@1.8em{\hss\@makefnmark}#1}
+ 
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/uwa-letterhead/uwa-letterhead.sty
+---------------------------------------------------------
+        \long\def\@makefntext##1{\parindent 1em\noindent
+                \hb at xt@1.8em{%
+                        \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+        \global\@topnum\z@
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/onrannual/onrannual.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+    \newpage
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/thuthesis/thuthesis.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+  \begingroup
+    % 序号取消上标
+    \def\@makefnmark{\hbox{\normalfont\@thefnmark}}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/gaceta/gaceta.cls
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/jpsj/jpsj2.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{%\vskip2\p@ 
+	        \hangindent8\p@ \hangafter1 \noindent
+            \hb at xt@1em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/gmutils/gmtypos.sty
+---------------------------------------------------------
+  \ampulexdef#1{\long\def\@makefntext}%
+  \if at twocolumn{\gmu at ATfootnotes\if at twocolumn}% Ampulex redefinition
+  % of \incs{maketitle} for \pk{mwcls}.
+}
+...
+  \long\pdef\@makefntext##1{%
+    \ifdefined\@parindent \parindent\@parindent
+    \else \parindent 1em\relax
+    \fi
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/resphilosophica/resphilosophica.cls
+---------------------------------------------------------
+\def\@makefntext{\noindent\@makefnmark
+  \if at enddoc\else
+    \immediate\write\@mainaux%
+    {\string\xdef\string\lastfootnote at page{\the\c at page}}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/tools/ftnright.sty
+---------------------------------------------------------
+\long\def\@makefntext#1{\parindent 1em
+   \noindent\hbox to 2em{}%
+   \llap{\@thefnmark.\,\,}#1}
+\setlength{\skip\footins}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/elegantnote/elegantnote.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+         \hb at xt@1.8em{%
+           \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+    \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/ntgclass/rapport1.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent\z@
+         \def\labelitemi{\textendash}\@revlabeltrue
+         \leavevmode\@textsuperscript{\@thefnmark}\kern1em\relax ##1}
+    \renewcommand*\thefootnote{\@fnsymbol\c at footnote}%
+...
+    \long\def\@makefntext{\@xmakefntext{%
+      \@textsuperscript{\normalfont\@thefnmark}}}%
+    \if at twocolumn
+      \ifnum \col at number=\@ne
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/ntgclass/brief.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+  \noindent\hb at xt@\leftmargini{\normalfont\@thefnmark.\hfil}#1}
+\newcommand*\dutchbrief{%
+  \def\uwbrieftekst{Uw brief van}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/ntgclass/boek.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent\z@
+         \def\labelitemi{\textendash}\@revlabeltrue
+         \leavevmode\@textsuperscript{\@thefnmark}\kern1em\relax ##1}
+    \renewcommand*\thefootnote{\@fnsymbol\c at footnote}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/ntgclass/rapport3.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent\z@
+         \def\labelitemi{\textendash}\@revlabeltrue
+         \leavevmode\@textsuperscript{\@thefnmark}\kern1em\relax ##1}
+    \renewcommand*\thefootnote{\@fnsymbol\c at footnote}%
+...
+    \long\def\@makefntext{\@xmakefntext{%
+      \@textsuperscript{\normalfont\@thefnmark}}}%
+    \if at twocolumn
+      \ifnum \col at number=\@ne
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/ntgclass/boek3.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent\z@
+         \def\labelitemi{\textendash}\@revlabeltrue
+         \leavevmode\@textsuperscript{\@thefnmark}\kern1em\relax ##1}
+    \renewcommand*\thefootnote{\@fnsymbol\c at footnote}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/ntgclass/artikel2.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent\z@
+         \def\labelitemi{\textendash}\@revlabeltrue
+         \leavevmode\@textsuperscript{\@thefnmark}\kern1em\relax ##1}
+    \renewcommand*\thefootnote{\@fnsymbol\c at footnote}%
+...
+    \long\def\@makefntext##1{\parindent\z@
+      \def\labelitemi{\textendash}%
+      \leavevmode\hb at xt@.5\unitindent{%
+        \@textsuperscript{\normalfont\@thefnmark}\hfil}##1}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/ntgclass/artikel3.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent\z@
+         \def\labelitemi{\textendash}\@revlabeltrue
+         \leavevmode\@textsuperscript{\@thefnmark}\kern1em\relax ##1}
+    \renewcommand*\thefootnote{\@fnsymbol\c at footnote}%
+...
+    \long\def\@makefntext{\@xmakefntext{%
+      \@textsuperscript{\normalfont\@thefnmark}}}%
+    \if at twocolumn
+      \ifnum \col at number=\@ne
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/ntgclass/artikel1.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent\z@
+         \def\labelitemi{\textendash}\@revlabeltrue
+         \leavevmode\@textsuperscript{\@thefnmark}\kern1em\relax ##1}
+    \renewcommand*\thefootnote{\@fnsymbol\c at footnote}%
+...
+    \long\def\@makefntext{\@xmakefntext{%
+      \@textsuperscript{\normalfont\@thefnmark}}}%
+    \if at twocolumn
+      \ifnum \col at number=\@ne
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/cdpbundl/letteracdp.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+    \noindent
+    \hangindent 5\p@
+    \hb at xt@5\p@{\hss\@makefnmark}#1}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/courseoutline/courseoutline.cls
+---------------------------------------------------------
+\setlength {\evensidemargin}{0.0in}	% right margin  1.0 inch
+\setlength {\textwidth}{6.5in}	 	% right margin  1.0 inch
+\setlength {\footnotesep}{14pt}	 	% baseline skip for fn's 1st line
+\setlength {\headheight}{0.2in}	 	% make room for header
+\setlength {\headsep}{0.2in}		 	% modest header separation
+\setlength {\parskip}{0.2in}		 	% set a paragraph skip
+\setlength {\parindent}{0.0in}	 	% no para indents
+%
+% redefine the titlematter
+%
+\renewcommand\maketitle{\par
+  \begingroup
+    \renewcommand\thefootnote{\@fnsymbol\c at footnote}%
+    \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+      \newpage
+      \global\@topnum\z@   % Prevents figures from going at top of page.
+      \@maketitle
+    \thispagestyle{empty}\@thanks
+  \endgroup
+  \setcounter{footnote}{0}%
+  \global\let\thanks\relax
+  \global\let\maketitle\relax
+  \global\let\@maketitle\relax
+  \global\let\@thanks\@empty
+  %
+  \global\let\university\@empty
+  \global\let\department\@empty
+  \global\let\coursename\@empty
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/stellenbosch/ustitle.sty
+---------------------------------------------------------
+        \long\def\@makefntext##1{\parindent 1em\noindent
+                \hb at xt@1.8em{%
+                    \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+        \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/chextras/chextras.sty
+---------------------------------------------------------
+ \long\def\@makefntext#1{\settowidth\@tempdima{.\kern\marginparsep}
+ \parindent\z@
+ \advance\parindent-\@tempdima
+ \rule\z@\footnotesep
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/aiaa/aiaa-tc.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+    \newpage
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/oberdiek/enparen.sty
+---------------------------------------------------------
+    \long\def\@makefntext##1{%
+      \enparen at org@makefntext{%
+        \enparenBeginContext{footnote}%
+        ##1%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/cleveref/cleveref.sty
+---------------------------------------------------------
+\long\def\@makefntext{%
+  \cref at constructprefix{footnote}{\cref at result}%
+  \protected at edef\cref at currentlabel{%
+    [footnote][\arabic{footnote}][\cref at result]%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/ametsoc/ametsoc.cls
+---------------------------------------------------------
+     \long\def\@makefntext##1{\parindent 1em\footnotesize\noindent
+            \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1
+     \vskip1sp
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/combine/combine.cls
+---------------------------------------------------------
+  \long\def\@makefntext##1{\parindent 1em\noindent
+    \hb at xt@1.8em{%
+      \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+  \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/active-conf/active-conf.cls
+---------------------------------------------------------
+      \long\def\@makefntext##1{\parindent 1em\noindent##1}%
+      \@note
+      \setcounter{footnote}{0}
+      \global\def\note##1{%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/iso/isov2.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+    \parindent 1em%
+    \noindent
+    \hbox to 1.8em{\hss\@makefnmark}#1}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/elegantpaper/elegantpaper.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@0.1em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+    \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/fnpara/fnpara.sty
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+%    \parindent 1em%
+%    \noindent
+%    \hb at xt@1.8em{\hss\@makefnmark}#1
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/bxjscls/bxjsarticle.cls
+---------------------------------------------------------
+      \long\def\@makefntext##1{\advance\leftskip 3\jsZw
+        \parindent 1\jsZw\noindent
+        \llap{\@textsuperscript{\normalfont\@thefnmark}\hskip0.3\jsZw}##1}%
+      \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/bxjscls/bxjsbook.cls
+---------------------------------------------------------
+      \long\def\@makefntext##1{\advance\leftskip 3\jsZw
+        \parindent 1\jsZw\noindent
+        \llap{\@textsuperscript{\normalfont\@thefnmark}\hskip0.3\jsZw}##1}%
+      \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/bxjscls/bxjsslide.cls
+---------------------------------------------------------
+      \long\def\@makefntext##1{\advance\leftskip 3\jsZw
+        \parindent 1\jsZw\noindent
+        \llap{\@textsuperscript{\normalfont\@thefnmark}\hskip0.3\jsZw}##1}%
+      \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/bxjscls/bxjsreport.cls
+---------------------------------------------------------
+      \long\def\@makefntext##1{\advance\leftskip 3\jsZw
+        \parindent 1\jsZw\noindent
+        \llap{\@textsuperscript{\normalfont\@thefnmark}\hskip0.3\jsZw}##1}%
+      \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/lettre/lettre.cls
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/titlefoot/titlefoot.sty
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+    \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/revtex/aip4-2.rtx
+---------------------------------------------------------
+\def\@makefntext#1{%
+ \def\baselinestretch{1}%
+ \leftskip1em%
+ \parindent1em%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/revtex/aps4-2.rtx
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+ \def\baselinestretch{1}%
+ \leftskip1em%
+ \parindent1em%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/revtex/revtex4-2.cls
+---------------------------------------------------------
+\def\@makefntext#1{%
+  \def\baselinestretch{1}%
+  \parindent1em%
+  \noindent
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/revtex/sor4-2.rtx
+---------------------------------------------------------
+\def\@makefntext#1{%
+ \def\baselinestretch{1}%
+ \leftskip1em%
+ \parindent1em%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/revtex/aapm4-2.rtx
+---------------------------------------------------------
+\def\@makefntext#1{%
+ \def\baselinestretch{1}%
+ \leftskip1em%
+ \parindent1em%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/lni/lni.cls
+---------------------------------------------------------
+ \long\def\@makefntext##1{%
+ \@setpar{\@@par
+ \@tempdima = \hsize
+ \advance\@tempdima -1em
+...
+\long\def\@makefntext#1{%
+    \parindent \fnindent%
+    \leftskip \fnindent% Einrückung vor der footnotemark
+    \noindent
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/arabtex/arabrep.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{\hss\@makefnmark}##1}%
+    \if at twocolumn
+      \ifnum \col at number=\@ne
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/arabtex/arabrep1.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{\hss\@makefnmark}##1}%
+    \if at twocolumn
+      \ifnum \col at number=\@ne
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/llncs/llncs.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+    \parindent \fnindent%
+    \leftskip \fnindent%
+    \noindent
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/frankenstein/blkcntrl.sty
+---------------------------------------------------------
+\defcommand\@makefntext [1] {%
+  \setlength\parindent{\@ne em}%
+  \noindent
+  \hb at xt@ 1.8em{\hss\@makefnmark}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/frankenstein/blkcntrl.stq
+---------------------------------------------------------
+\defcommand\@makefntext [1] {%
+  \setlength\parindent{\@ne em}%
+  \noindent
+  \hb at xt@ 1.8em{\hss\@makefnmark}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/cmpj/cmpj2.sty
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+    \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/cmpj/cmpj3.sty
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+    \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/cmpj/cmpj.sty
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+    \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/pracjourn/pracjourn.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+    \newpage
+...
+\def\@makefntext#1{%
+  \parindent 0em\relax
+  \makebox[1.5em][l]{\normalfont\footnotesize\@thefnmark.}#1}
+\def\@ifx at empty#1{% Implicit #2#3
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/extsizes/extbook.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+    \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/extsizes/extletter.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+    \noindent
+    \hangindent 5\p@
+    \hb at xt@5\p@{\hss\@makefnmark}#1}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/extsizes/extarticle.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+    \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/extsizes/extproc.cls
+---------------------------------------------------------
+     \long\def\@makefntext##1{\parindent 1em\noindent
+             \hb at xt@1.8em{%
+                 \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+   \twocolumn[\@maketitle]%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/extsizes/extreport.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+    \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/h2020proposal/h2020proposal.cls
+---------------------------------------------------------
+  \long\def\@makefntext##1{\parindent 1em\noindent
+    \hb at xt@1.8em{%
+      \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+  \newpage
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.bbx
+---------------------------------------------------------
+    \long\def\@makefntext##1{%增加了脚注标记与正文的间隔
+    \parindent 1em\noindent \hb at xt@ 0em{\hss \@makefnmark\makebox[\footbiblabelsep]{}}##1}
+
+    }
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015mx.bbx
+---------------------------------------------------------
+    \long\def\@makefntext##1{%增加了脚注标记与正文的间隔
+    \parindent 1em\noindent \hb at xt@ 0em{\hss \@makefnmark\makebox[\footbiblabelsep]{}}##1}
+
+    }
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.bbx
+---------------------------------------------------------
+    \long\def\@makefntext##1{%增加了脚注标记与正文的间隔
+    \parindent 1em\noindent \hb at xt@ 0em{\hss \@makefnmark\makebox[\footbiblabelsep]{}}##1}
+
+    }
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.bbx
+---------------------------------------------------------
+    \long\def\@makefntext##1{%增加了脚注标记与正文的间隔
+    \parindent 1em\noindent \hb at xt@ 0em{\hss \@makefnmark\makebox[\footbiblabelsep]{}}##1}
+
+    }
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/suftesi/suftesi.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+    \if at twocolumn
+...
+     \long\def\@makefntext##1{\parindent 1em\noindent
+             \hb at xt@1.8em{%
+                 \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+     \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/mwcls/mwrep.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{
+        \parindent\@parindent
+        \@textsuperscript{\normalfont\@thefnmark}\enspace##1}%
+    \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/mwcls/mwart.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{
+        \parindent\@parindent
+        \@textsuperscript{\normalfont\@thefnmark}\enspace##1}%
+    \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/mwcls/mwbk.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{
+        \parindent\@parindent
+        \@textsuperscript{\normalfont\@thefnmark}\enspace##1}%
+    \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/tugboat/ltugboat.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{\parindent 1em\noindent\hb at xt@2em{}%
+  \llap{\@makefnmark}\null$\mskip5mu$#1}
+
+%% \long\def\@makefntext#1{\parindent 1em
+...
+  \def\@makefntext##1{##1}%
+  \footnotetext{\noindent #1#2}%
+  \endgroup
+}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/ptptex/ptptex.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+\parindent 1.5em\noindent \footnotesize %
+\hbox to 2.5em{\hss$^{\@thefnmark}$}\hskip3\p@#1}
+\gdef\@thanks{}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/aguplus/aguplus.sty
+---------------------------------------------------------
+         \long\def\@makefntext##1{##1}
+         \footnotetext{{\parindent=1em\indent
+             \let\@elt=\par\@titlenote}}
+       \fi
+...
+         \long\def\@makefntext##1{##1}
+         \footnotetext{{\parindent=10pt\indent
+             \parskip=6pt\let\@elt=\par\@titlenote}}
+       \fi
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/aguplus/aguplus.cls
+---------------------------------------------------------
+         \long\def\@makefntext##1{##1}
+         \footnotetext{{\parindent=1em\indent
+             \let\@elt=\par\@titlenote}}
+       \fi
+...
+         \long\def\@makefntext##1{##1}
+         \footnotetext{{\parindent=10pt\indent
+             \parskip=6pt\let\@elt=\par\@titlenote}}
+       \fi
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/protocol/protocol.cls
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/cje/cje.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{%\parindent 1em
+            \noindent
+%            \hb at xt@1.8em{%
+%                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+...
+\long\def\@makefntext#1{\raggedright\@setpar{\@@par\@tempdima \hsize
+ \advance\@tempdima-\@footindent
+ \parshape \@ne \@footindent \@tempdima}\par
+ \noindent \hbox to \z@{\hss\@thefnmark\enskip}#1}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/tufte-latex/tufte-common.def
+---------------------------------------------------------
+\long\def\@makefntext#1{\@textsuperscript{\@tufte at sidenote@font\tiny\@thefnmark}\,\footnotelayout#1}
+
+% Set the in-text footnote mark in the same typeface as the body text itself.
+\def\@makefnmark{\hbox{\@textsuperscript{\normalfont\footnotesize\@thefnmark}}}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/amscls/amsdtx.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hbox to1.8em{\hss$\m at th^{\@thefnmark}$}##1}%
+    \if at twocolumn
+      \ifnum \col at number=\@ne
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/amscls/amsbook.cls
+---------------------------------------------------------
+\def\@makefntext{\indent\@makefnmark}
+\long\def\@footnotetext#1{%
+  \insert\footins{%
+    \normalfont\footnotesize
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/amscls/amsproc.cls
+---------------------------------------------------------
+\def\@makefntext{\indent\@makefnmark}
+\long\def\@footnotetext#1{%
+  \insert\footins{%
+    \normalfont\footnotesize
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/amscls/amsart.cls
+---------------------------------------------------------
+\def\@makefntext{\indent\@makefnmark}
+\long\def\@footnotetext#1{%
+  \insert\footins{%
+    \normalfont\footnotesize
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/quantumarticle/quantumarticle.cls
+---------------------------------------------------------
+	\long\def\@makefntext##1{\parindent 1em\noindent
+	\hb at xt@1.8em{%
+	\hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+	\ifbool{@twocolumn}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/ltxmisc/iagproc.cls
+---------------------------------------------------------
+   \long\def\@makefntext##1{\parindent 1em\noindent
+           \hb at xt@1.8em{%
+               \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+ \twocolumn[\@maketitle]%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/acmart/acmart.cls
+---------------------------------------------------------
+\def\@makefntext{\noindent\@makefnmark}
+\if at ACM@sigchiamode
+\long\def\@footnotetext#1{\marginpar{%
+    \reset at font\small
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/memoir/memoir.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\makethanksmark ##1}
+    \if at twocolumn
+      \ifnum \col at number=\@ne
+        \@maketitle
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/footnotebackref/footnotebackref.sty
+---------------------------------------------------------
+% than redefine the \@makefntext and \@makefnmark
+% The \@makefnmark macro is redefined in the space of
+% the \@makefntext macro
+% So the footnote numbers in the main text are not influenced
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/bangtex/barticle.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+    \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/bangtex/bletter.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+    \noindent
+    \hangindent 5\p@
+    \hb at xt@5\p@{\hss\@makefnmark}#1}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/bangtex/bbook.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{%
+                \hss\@textsuperscript{\sbng\@thefnmark}}##1}%
+    \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/elbioimp/elbioimp.cls
+---------------------------------------------------------
+    \def \@makefntext ##1{\noindent
+      \small \@thefnmark. \it ##1}
+    \renewcommand{\thempfootnote}%
+      {\arabic{mpfootnote}}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/ebsthesis/ebsthesis.cls
+---------------------------------------------------------
+  \long\def\@makefntext#1{%
+    \bgroup
+      \setbox\@tempboxa\hbox{%
+      \ifdim\footnotemargin>0pt
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/coursepaper/coursepaper.cls
+---------------------------------------------------------
+		\setlength {\evensidemargin}{0.5in}	 % right margin  1.5 inch
+        \setlength {\textwidth}{5.5in}	 % right margin  1.5 inch
+        \spacing{2}						 % double spacing for final
+        \renewenvironment{quote}			 % redef as single spaced
+			{\oldquote\spacing{1}}
+			{\oldendquote\spacing{2}}
+		\renewenvironment{quotation}		 % redef as single spaced
+			{\oldquotation\spacing{1}}
+			{\oldendquotation\spacing{2}} 
+		\renewenvironment{verse}		     % redef as single spaced
+			{\oldquotation\spacing{1}}
+			{\oldendquotation\spacing{2}} 
+}
+\setlength {\footnotesep}{14pt}			  % baseline skip for fn's 1st line
+\setlength {\headheight}{0.2in}			  % make room for header
+\setlength {\headsep}{0.2in}				  % modest header separation
+\setlength {\parskip}{0.2in}				  % set a paragraph skip
+\setlength {\parindent}{0.2in}			  % I hate unindented first lines
+\renewenvironment{bibliography}[1]		  % automatically enter toc line
+	{\addcontentsline{toc}{chapter}{Bibliography}\oldbibliography {#1}}
+	{\oldendbibliography}
+%
+% Make footnotes single spaced
+%
+%			code shamelessly stolen from setspace.sty 
+%				written by Geoffrey Tobin <G.Tobin at latrobe.edu.au>
+%
+\long\def\@footnotetext#1{%
+  \insert\footins{%
+    \def\baselinestretch {1}%
+    \reset at font\footnotesize
+    \interlinepenalty\interfootnotelinepenalty
+    \splittopskip\footnotesep
+    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+    \hsize\columnwidth
+    \@parboxrestore
+    \protected at edef\@currentlabel{%
+      \csname p at footnote\endcsname\@thefnmark
+    }%
+    \color at begingroup
+      \@makefntext{%
+        \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+    \color at endgroup}}
+%
+% redefine the titlematter
+%
+\renewcommand\maketitle{\par
+  \begingroup
+    \renewcommand\thefootnote{\@fnsymbol\c at footnote}%
+    \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+      \newpage
+      \global\@topnum\z@   % Prevents figures from going at top of page.
+      \@maketitle
+    \thispagestyle{empty}\@thanks
+  \endgroup
+  \setcounter{footnote}{0}%
+  \global\let\thanks\relax
+  \global\let\maketitle\relax
+  \global\let\@maketitle\relax
+  \global\let\@thanks\@empty
+  \global\let\@author\@empty
+  \global\let\@date\@empty
+  \global\let\@title\@empty
+  %
+  \global\let\@studentnumber\@empty
+  \global\let\@coursenumber\@empty
+  \global\let\@coursename\@empty
+  \global\let\@coursesection\@empty
+  \global\let\@instructor\@empty
+  \global\let\@college\@empty
+  %
+  \global\let\title\relax
+  \global\let\author\relax
+  \global\let\date\relax
+  \global\let\and\relax
+}
+%
+\def\@maketitle{%
+  \newpage
+  \null
+  \vskip 2em%
+  \begin{flushleft}%
+  	\begin{spacing}{1}%
+    {\sffamily \LARGE \@title \par}%
+    \vskip 2em%
+    {\sffamily \large\lineskip .75em\@author}\\%
+    \sffamily \@studentnumber%
+    \vskip 1em%
+    \sffamily \@date
+    \vskip 3em%
+    \sffamily \@college\\%
+    \sffamily \@coursenumber\hskip 6pt\@coursesection\hskip 6pt%
+			\@coursename\\%
+    \sffamily For: \@instructor%
+    \par%
+    \end{spacing}%
+  \end{flushleft}\hrule\vskip 1em\par
+  \par
+  \vskip 1.5em}
+%
+% make section titles less obnoxious
+%
+\renewcommand\section{\@startsection {section}{1}{\z@}%
+                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
+                                   {2.3ex \@plus.2ex}%
+                                   {\normalfont\large\bfseries}}
+\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
+                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
+                                     {1.5ex \@plus .2ex}%
+                                     {\normalfont\normalsize\bfseries}}
+\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
+                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
+                                     {1.5ex \@plus .2ex}%
+                                     {\normalfont\normalsize\bfseries}}
+\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
+                                    {3.25ex \@plus1ex \@minus.2ex}%
+                                    {-1em}%
+                                    {\normalfont\normalsize\bfseries}}
+\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
+                                       {3.25ex \@plus1ex \@minus .2ex}%
+                                       {-1em}%
+                                      {\normalfont\normalsize\bfseries}}
+%
+% Set up headers
+%
+\def\ps at myheadings{%
+    \let\@oddfoot\@empty\let\@evenfoot\@empty
+    \def\@evenhead{\thepage -- \slshape\leftmark\hfil}%
+    \def\@oddhead{\hfil{\slshape\rightmark} -- \thepage}%
+    \let\@mkboth\@gobbletwo
+    \let\sectionmark\@gobble
+    \let\subsectionmark\@gobble
+    }
+%
+% Position the abstract depending on presence of titlepage
+%
+\if at titlepage
+  \renewenvironment{abstract}{%
+	  \titlepage
+      \null\vfil
+      \@beginparpenalty\@lowpenalty
+      \begin{center}%
+        \bfseries \abstractname
+        \@endparpenalty\@M
+      \end{center}}%
+     {\par\vfil\null\endtitlepage}
+\fi
+%
+% change some names
+%
+\renewcommand\contentsname{Table of Contents}
+\renewcommand\refname{Bibliography}
+%
+%	\epigraph{text}{byline}
+%
+\newcommand{\epigraph}[2]{\begin{flushright}\begin{minipage}{4in}%
+			\spacing{1}#1\begin{flushright}#2\end{flushright}%
+			\hrule\end{minipage}\vskip 12pt\end{flushright}}
+%
+%% End of file `coursepaper.cls'.
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/kotex-utf/contrib/dhucsfn.sty
+---------------------------------------------------------
+  \long\def\@makefntext#1{
+    \settowidth{\foot at parindent}{\fn at markstyle}
+    \@setpar{\@@par\@tempdima \hsize
+      \advance\@tempdima-\foot at parindent
+...
+  \long\def\@makefntext#1{%
+    \hbox{\fn at markstyle\hskip\footnumbersep #1}
+  }%
+}
+...
+  \long\def\@makefntext#1{%
+    \fn at markstyle\ifdim\footnumbersep=\z@\else~\fi #1
+  }%
+}
+...
+  \long\def\@makefntext#1{
+    \settowidth{\foot at parindent}{\reset at font 각주}
+    \settowidth{\footnumbersep}{\reset at font 주}
+    \divide\footnumbersep by2
+...
+  \long\def\@makefntext#1{
+    \settowidth{\leftskip}{\reset at font 각주}
+    \settowidth{\foot at parindent}{\fn at markstyle}
+    \settowidth{\footnumbersep}{\reset at font 주}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/ucthesis/ucthesis.cls
+---------------------------------------------------------
+%          \long\def\@makefntext#1{\@setpar{\@@par\@tempdima \hsize
+%             \advance\@tempdima-10pt\parshape \@ne 10pt \@tempdima}\par
+%             \parindent 1em\noindent
+%             \hbox to \z@{\hss$\m at th^{\@thefnmark}$}#1}
+...
+\long\def\@makefntext#1{\parindent 1em\noindent
+            \hbox to 1.8em{\hss$\m at th^{\@thefnmark}$}#1}
+
+% \@makefnmark : A macro to generate the footnote marker that goes
+...
+   \edef\@currentlabel{\csname p at footnote\endcsname\@thefnmark}\@makefntext
+    {\rule{\z@}{\footnotesep}\ignorespaces
+      #1\strut}}}
+ 
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/apa/apa.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{\parindent 1em\noindent
+           \hb at xt@1.8em{%
+           \hss\@textsuperscript{\normalfont{\tiny\@thefnmark}\hspace{1.5pt}}}#1}%
+
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/uestcthesis/uestcthesis.cls
+---------------------------------------------------------
+\def\@makefntext #1{\ifFN at hangfoot \bgroup \setbox \@tempboxa \hbox {\ifdim
+\footnotemargin >0pt \hb at xt@ \footnotemargin {\hbox { \normalfont \@thefnmark}
+\hss }\else \hbox { \normalfont \@thefnmark} \fi }\leftmargin \wd \@tempboxa
+\rightmargin \z@ \linewidth \columnwidth \advance \linewidth -\leftmargin
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/gmdoc/gmdoc.sty
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+      \hb at xt@1.8em{%
+        \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+    \if at twocolumn \twocolumn [\@maketitle ]%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/titling/titling.sty
+---------------------------------------------------------
+      \long\def\@makefntext##1{\makethanksmark ##1}
+    \null\vfil
+    \vskip 60\p@
+    \vspace*{\droptitle}
+...
+      \long\def\@makefntext##1{\makethanksmark ##1}
+      \if at twocolumn
+        \ifnum \col at number=\@ne
+          \@maketitle
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/chletter/chletter.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{\noindent\hb at xt@\z@{\hss\@makefnmark}#1}
+\def\fromname{\@author}
+\def\fromsig{\@author}
+\let\fromlocation\@empty
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/jurarsp/jurarsp.sty
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+  \rsp at fntrue%
+  \@setpar{\@@par
+  \@tempdima = \hsize
+...
+/usr/local/texlive/2021/texmf-dist/tex/latex/kluwer/klunote.sty
+---------------------------------------------------------
+% \long\def\@makefntext#1{\parindent 1em\noindent
+%  \hbox to 1.5em{\hss$^{\@thefnmark}$}\hskip0.5em\footnotesize#1}
+% \def\@makefnmark{\hbox{$^{\@thefnmark}\m at th$}}
+% SK: reimplemented with \textsuperscript, following LaTeX format
+...
+\long\def\@makefntext#1{\parindent 1em\noindent
+ \hbox to 1.5em{\hss\textsuperscript{\@thefnmark}}%
+   \hskip0.5em\footnotesize#1}
+\def\@makefnmark{\hbox{\textsuperscript{\@thefnmark}}}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/kluwer/kluwer.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{\parindent 1em\noindent
+ \hbox to 1.5em{\hss\textsuperscript{\@thefnmark}}%
+   \hskip0.5em\footnotesize#1}
+\def\@makefnmark{\hbox{\textsuperscript{\@thefnmark}}}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/asaetr/asaesub.sty
+---------------------------------------------------------
+   \edef\@currentlabel{\csname p at footnote\endcsname\@thefnmark}\@makefntext
+    {\rule{\z@}{\footnotesep}\ignorespaces
+      #1\strut}}}
+
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/asaetr/asaetr.sty
+---------------------------------------------------------
+\long\def\@makefntext#1{\parindent 1em\noindent 
+ \hbox to 1.8em{\hss$^{\@thefnmark}$}#1}
+
+
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/refman/refrep.cls
+---------------------------------------------------------
+  \long\def\@makefntext##1{%
+       \@setpar{\@@par
+          \@tempdima = \hsize
+          \advance\@tempdima -1em
+...
+      \long\def\@makefntext##1{%
+         \@setpar{\@@par
+            \@tempdima = \hsize
+            \advance\@tempdima -1em
+...
+\long\def\@makefntext#1{%
+   \@setpar{\@@par
+      \@tempdima = \hsize
+      \advance\@tempdima -1em
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/refman/refart.cls
+---------------------------------------------------------
+  \long\def\@makefntext##1{%
+       \@setpar{\@@par
+          \@tempdima = \hsize
+          \advance\@tempdima -1em
+...
+      \long\def\@makefntext##1{%
+         \@setpar{\@@par
+            \@tempdima = \hsize
+            \advance\@tempdima -1em
+...
+\long\def\@makefntext#1{%
+   \@setpar{\@@par
+      \@tempdima = \hsize
+      \advance\@tempdima -1em
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/lwarp/lwarp-footnote.sty
+---------------------------------------------------------
+\long\def\@makefntext#1{\textsuperscript{\@thefnmark}~#1}
+
+\LWR at ProvidesPackagePass{footnote}[1997/01/28]
+
+...
+\long\def\@makefntext#1{\textsuperscript{\@thefnmark}~{#1}}
+
+\def\spewnotes{%
+  \endgroup%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/lwarp/lwarp.sty
+---------------------------------------------------------
+\long\def\@makefntext#1{\textsuperscript{\@thefnmark}~{#1}}
+\def\@makefnmark{%
+    \textsuperscript{\@thefnmark}%
+}
+...
+\long\def\@makefntext##1{%
+\textsuperscript{\@thefnmark}~%
+{##1}%
+}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/lwarp/lwarp-titling.sty
+---------------------------------------------------------
+    \long\def\@makefntext##1{%
+        \makethanksmark~%
+        {##1}%
+    }% \@makefntext
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/afthesis/afthesis.cls
+---------------------------------------------------------
+   \edef\@currentlabel{\csname p at footnote\endcsname\@thefnmark}\@makefntext
+    {\rule{\z@}{\footnotesep}\ignorespaces
+      #1\strut}}}
+
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/ijmart/ijmart.cls
+---------------------------------------------------------
+  \long\def\@makefntext##1{\noindent\hangindent=2em\hangafter=1
+    \hb at xt@2em{%
+      \hss\@textsuperscript{\normalfont\footnotesize\@thefnmark\space}}##1}%
+  \def\footnoterule{\kern-3pt\hrule width 2in\kern 2.6pt}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/oup-authoring-template/oup-authoring-template.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 3mm\noindent
+        \if at traditional\if at small\@hangfrom{{\normalfont\@thefnmark}\enskip}\else\@textsuperscript{\normalfont\@thefnmark}\fi\else\@textsuperscript{\normalfont\@thefnmark}\fi
+      ##1}%
+    \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/akletter/akletter.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+    \noindent
+    \hangindent 5\p@
+    \hb at xt@5\p@{\hss\@makefnmark}#1}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/revtex4/aps.rtx
+---------------------------------------------------------
+\def\@makefntext#1{%
+ \def\baselinestretch{1}%
+ \reset at font
+ \footnotesize
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/revtex4/revtex4.cls
+---------------------------------------------------------
+\def\@makefntext#1{%
+  \def\baselinestretch{1}%
+  \reset at font\footnotesize
+  \parindent 1em%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/hitreport/hitreport.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+  \begingroup
+    % 序号取消上标
+    \def\@makefnmark{\hbox{\normalfont\@thefnmark}}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/footnotehyper/footnotehyper.sty
+---------------------------------------------------------
+      \def\FNH at prefntext{\@makefntext{}}%
+      \iffootnotehyperwarn
+        \PackageInfo{footnotehyper}%
+        {Using the \string\@makefntext{} approach (see doc).\FNH at msgbk
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/basque-book/basque-book.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+    \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/dinbrief/dinbrief.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+  \noindent
+  \hangindent 5pt%
+  \hbox  to 5pt{\hss $^{\@thefnmark}$}#1}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/beamer/beamerbaseframecomponents.sty
+---------------------------------------------------------
+\def\@makefntext#1{%
+  \def\insertfootnotetext{#1}%
+  \def\insertfootnotemark{\@makefnmark}%
+  \usebeamertemplate***{footnote}}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/ucdavisthesis/ucdavisthesis.cls
+---------------------------------------------------------
+   \edef\@currentlabel{\csname p at footnote\endcsname\@thefnmark}\@makefntext
+    {\rule{\z@}{\footnotesep}\ignorespaces
+      #1\strut}\renewcommand\baselinestretch{\@spacing}}}
+\ps at plain                   % 'plain' page style
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/computational-complexity/cclayout.sty
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/footmisx/footmisx.sty
+---------------------------------------------------------
+  \long\def\@makefntext#1{\leavevmode
+    \@makefnmark\nobreak
+    \hskip.5em\relax#1%
+  }
+...
+  \long\def\@makefntext#1{%
+    \ifFN at hangfoot
+      \bgroup
+      \setbox\@tempboxa\hbox{%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/amsdtx.hyp
+---------------------------------------------------------
+    \long\def\@makefntext##1{%
+      \hyper at currentfnmark%
+      \bgroup%
+        \edef\@currenthyper{\hyper at current@fnmark}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/slides.hyp
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+  \bgroup%
+    \hyper at currentfnmark%
+    \edef\@currenthyper{\hyper at current@fnmark}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/book.hyp
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+  \bgroup%
+    \hyper at currentfnmark%
+    \edef\@currenthyper{\hyper at current@fnmark}%
+...
+    \long\def\@makefntext##1{%
+      \hyper at currentfnmark%
+      \bgroup%
+        \edef\@currenthyper{\hyper at current@fnmark}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/ltxguide.hyp
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+  \bgroup%
+    \hyper at currentfnmark%
+    \edef\@currenthyper{\hyper at current@fnmark}%
+...
+    \long\def\@makefntext##1{%
+      \hyper at currentfnmark%
+      \bgroup%
+        \edef\@currenthyper{\hyper at current@fnmark}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/ltnews.hyp
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+  \bgroup%
+    \hyper at currentfnmark%
+    \edef\@currenthyper{\hyper at current@fnmark}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/doc.hyp
+---------------------------------------------------------
+      \long\def\@makefntext##1{%
+        \hyper at currentfnmark%
+        \bgroup
+          \edef\@currenthyper{\hyper at current@fnmark}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/ftnright.hyp
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+  \hyper at currentfnmark%
+  \bgroup%
+    \edef\@currenthyper{\hyper at current@fnmark}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/letter.hyp
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+  \bgroup%
+    \hyper at currentfnmark%
+    \edef\@currenthyper{\hyper at current@fnmark}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/amsbook.hyp
+---------------------------------------------------------
+\long\def\@makefntext#1{\indent%
+  \hyper at currentfnmark%
+  \bgroup%
+    \edef\@currenthyper{\hyper at current@fnmark}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/ltxdoc.hyp
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+  \bgroup%
+    \hyper at currentfnmark%
+    \edef\@currenthyper{\hyper at current@fnmark}%
+...
+    \long\def\@makefntext##1{%
+      \hyper at currentfnmark%
+      \bgroup%
+        \edef\@currenthyper{\hyper at current@fnmark}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/proc.hyp
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+  \bgroup%
+    \hyper at currentfnmark%
+    \edef\@currenthyper{\hyper at current@fnmark}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/amsart.hyp
+---------------------------------------------------------
+\long\def\@makefntext#1{\indent%
+  \hyper at currentfnmark%
+  \bgroup%
+    \edef\@currenthyper{\hyper at current@fnmark}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/amsproc.hyp
+---------------------------------------------------------
+\long\def\@makefntext#1{\indent%
+  \hyper at currentfnmark%
+  \bgroup%
+    \edef\@currenthyper{\hyper at current@fnmark}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/article.hyp
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+  \bgroup%
+    \hyper at currentfnmark%
+    \edef\@currenthyper{\hyper at current@fnmark}%
+...
+    \long\def\@makefntext##1{%
+      \hyper at currentfnmark%
+      \bgroup%
+        \edef\@currenthyper{\hyper at current@fnmark}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/hyper/report.hyp
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+  \bgroup%
+    \hyper at currentfnmark%
+    \edef\@currenthyper{\hyper at current@fnmark}%
+...
+    \long\def\@makefntext##1{%
+      \hyper at currentfnmark%
+      \bgroup%
+        \edef\@currenthyper{\hyper at current@fnmark}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/hitec/hitec.cls
+---------------------------------------------------------
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+      \newpage
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/emulateapj/emulateapj.cls
+---------------------------------------------------------
+\def\@makefntext#1{\mbox{}\hspace*{3mm}\@makefnmark~#1}
+
+\def\notetoeditor#1{}%   % We do not need notes to editor in the preprint
+\def\placetable#1{}%   % We do not need notes to editor in the preprint
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/ledmac/afoot.sty
+---------------------------------------------------------
+  \long\def\@makefntext#1{{$^{\@thefnmark}$}#1\nobreak }
+\fi
+
+%%% Make the LaTeX \cs{footnote} catcode-safe, like in Plain TeX.
+...
+    \global\long\def \@makefntext ##1{{$^{\@thefnmark }$}##1\nobreak }%
+    \setbox0=\hbox \bgroup % fnpara.sty is present
+    \floatingpenalty=20000 \footnotesize
+  \fi
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/footmisc/footmisc.sty
+---------------------------------------------------------
+  \long\def\@makefntext#1{\leavevmode
+    \@makefnmark\nobreak
+    \hskip.5em\relax#1%
+  }
+...
+  \long\def\@makefntext#1{%
+    \ifFN at hangfoot
+      \bgroup
+      \setbox\@tempboxa\hbox{%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/footmisc/footmisc-2011-06-06.sty
+---------------------------------------------------------
+  \long\def\@makefntext#1{\leavevmode
+    \@makefnmark\nobreak
+    \hskip.5em\relax#1%
+  }
+...
+  \long\def\@makefntext#1{%
+    \ifFN at hangfoot
+      \bgroup
+      \setbox\@tempboxa\hbox{%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/base/book.cls
+---------------------------------------------------------
+      \long\def\@makefntext##1{\parindent 1em\noindent
+              \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+      \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/base/slides.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{
+    \noindent
+    \hangindent 10\p@
+    \hb at xt@10\p@{\hss\@makefnmark}#1}
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/base/doc.sty
+---------------------------------------------------------
+      \long\def\@makefntext##1{\parindent 1em\noindent
+            \hbox to1.8em{\hss$\m at th^{\@thefnmark}$}##1}%
+      \if at twocolumn \twocolumn [\@maketitle ]%
+      \else \newpage \global \@topnum \z@ \@maketitle \fi
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/base/proc.sty
+---------------------------------------------------------
+     \long\def\@makefntext##1{\parindent 1em\noindent
+             \hb at xt@1.8em{%
+                 \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+   \twocolumn[\@maketitle]%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/base/proc.cls
+---------------------------------------------------------
+     \long\def\@makefntext##1{\parindent 1em\noindent
+             \hb at xt@1.8em{%
+                 \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+   \twocolumn[\@maketitle]%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/base/doc-v3beta.sty
+---------------------------------------------------------
+      \long\def\@makefntext##1{\parindent 1em\noindent
+            \hbox to1.8em{\hss$\m at th^{\@thefnmark}$}##1}%
+      \if at twocolumn \twocolumn [\@maketitle ]%
+      \else \newpage \global \@topnum \z@ \@maketitle \fi
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/base/article.cls
+---------------------------------------------------------
+      \long\def\@makefntext##1{\parindent 1em\noindent
+              \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+      \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/base/report.cls
+---------------------------------------------------------
+      \long\def\@makefntext##1{\parindent 1em\noindent
+              \hb at xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+      \if at twocolumn
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/twoinone/2in1.sty
+---------------------------------------------------------
+\long\def\@makefntext##1{\parindent 1em\noindent
+\hb at xt@1.8em{%
+\hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+\@maketitle
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/ltxtools/ltxtools-review.sty
+---------------------------------------------------------
+  \long\def\@makefntext##1{\rule\z@\footnotesep\parindent1em\noindent
+    \hb at xt@2em{\hss\@textsuperscript
+      {\normalfont\textcolor{#1}{\@thefnmark}}}%
+    \hspace{2\p@}\ignorespaces\textcolor{#1}{##1}%
+...
+  \long\def\@makefntext##1{%
+    \rule\z@\footnotesep\parindent1em\noindent
+    \hb at xt@0em{\hss\@textsuperscript{\normalfont\color{#1}\@thefnmark}}%
+    \hspace{2\p@}\color{#1}\ignorespaces##1%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/skeyval/skeyval-testclass.cls
+---------------------------------------------------------
+  \long\def\@makefntext##1{%
+    \parindent1em\relax\noindent
+    \hb at xt@1.8em{\hss\@textsuperscript{%
+      \normalfont\skv at fnsymbol\@thefnmark}%
+...
+---------------------------------------------------------
+/usr/local/texlive/2021/texmf-dist/tex/latex/newlfm/newlfm.cls
+---------------------------------------------------------
+\long\def\@makefntext#1{%
+\noindent \hangindent 5\p@%
+\hb at xt@5\p@{\hss\@makefnmark}#1}%
+\renewcommand{\thefigure}{\@arabic\c at figure}%
+...
+---------------------------------------------------------
+
+```


Property changes on: trunk/Master/texmf-dist/doc/latex-dev/latex-lab/usage-of-makefntext.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-bib.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-bib.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-bib.dtx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,343 @@
+% \iffalse meta-comment
+%
+%% File: latex-lab-bib.dtx (C) Copyright 2023 LaTeX Project
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version.  The latest version
+% of this license is in the file
+%
+%    https://www.latex-project.org/lppl.txt
+%
+%
+% The development version of the bundle can be found below
+%
+%    https://github.com/latex3/latex2e/required/latex-lab
+%
+% for those people who are interested or want to report an issue.
+%
+%<*driver>
+\documentclass{l3doc}
+\EnableCrossrefs
+\CodelineIndex
+\begin{document}
+  \DocInput{latex-lab-bib.dtx}
+\end{document}
+%</driver>
+%
+% \fi
+%
+% \title{The \textsf{latex-lab-bib} package\\
+% Changes and additions to the kernel related to tagging and links in citations and 
+% bibliography entries}
+% \author{\LaTeX{} Project\thanks{Initial implementation done by Ulrike Fischer}}
+% \date{Version 0.80 2023-05-10}
+%
+% \maketitle
+%
+% \newcommand{\xt}[1]{\textsl{\textsf{#1}}}
+% \newcommand{\TODO}[1]{\textbf{[TODO:} #1\textbf{]}}
+% \newcommand{\docclass}{document class \marginpar{\raggedright document class
+% customizations}}
+%
+% \providecommand\hook[1]{\texttt{#1}}
+%
+% \begin{abstract}
+% \end{abstract}
+%
+% \section{Introduction}
+%
+% The followings contains small changes to improve tagging of
+% bibliography entries and citations. 
+% 
+% The tagging of the bibliography is actually quite straightforward:
+% A bibliography is typically a list with a heading and the sec and block tagging
+% code handles that. 
+% 
+% There are here only two problems: 
+% 
+% \begin{itemize}
+% \item The structure number of the \texttt{LI} element
+% create by a \cs{bibitem} must be recorded somehow to allow to reference it in 
+% a \cs{cite}. 
+% \item \pkg{hyperref} redefines the item command and so breaks the list structure
+% see \url{https://github.com/latex3/latex2e/discussions/1010#discussioncomment-5565418}
+% \end{itemize}
+% 
+% Both problems are rather easy to resolve, but it must be checked if other packages 
+% interfere again by redefining the commands.
+% 
+% More difficult is the tagging of citation commands. Citations should be inside 
+% a Reference structure and contain a /Ref entry pointing to the relevant 
+% item in the bibliography. For simple citations like 
+% \enquote{[1]} or \enquote{Doody (2023)} this is easy, but it is not obvious how
+% to handle combined citations like \enquote{Doody (2003,2018)} (or even compressed citations
+% like \enquote{[1-3]}). The implementation follows here the links: whatever hyperref would
+% link is set as the reference.
+% 
+% An additional problem are the various packages trying to improve citation commands
+% which all should be checked. Currently only natbib has been tried. 
+% 
+% The biblatex package isn't handled yet.  
+% 
+% 
+% \section{Implementation}
+%    \begin{macrocode}
+%<*package>
+%<@@=tag>
+%    \end{macrocode}
+%    \begin{macrocode}
+\ProvidesExplPackage {latex-lab-testphase-bib} {2023-05-18} {0.8}
+  {Code related to the tagging of bibliography and cite command}
+%    \end{macrocode}
+% We need at least the block tagging code.
+%    \begin{macrocode}
+\RequirePackage{latex-lab-testphase-block-tagging}  
+%    \end{macrocode}
+%
+% At first we suppress the patches from hyperref. This will only work with the next
+% hyperref!
+%    \begin{macrocode}
+\def\hyper at nopatch@bib{}
+%    \end{macrocode}
+
+% \begin{macro}{\@extra at binfo,\@extra at b@citeb}
+% These are taken from hyperref, they are for chapterbib compability (and also
+% signal to chapterbib not to change the citation commands)
+%    \begin{macrocode}
+\providecommand*\@extra at binfo{}%
+\providecommand\@extra at b@citeb{}
+%    \end{macrocode}
+% \end{macro}
+% 
+% \begin{variable}{\l_@@_bib_target_tl}
+% Items should add a target, to avoid that user code
+% interferes we don't rely on \cs{@currentHref}
+%    \begin{macrocode}
+\tl_new:N\l_@@_bib_target_tl
+%    \end{macrocode}
+% \end{variable}
+
+%\subsection{Handling the bibliography}
+% \begin{macro}{\lbibitem}
+% The item command if an optional argument is use. 
+% 
+% We only prepend some code. 
+% If we had already generic hooks with arguments 
+% we could probably use them \ldots
+%    \begin{macrocode}
+\def\@lbibitem[#1]#2{%
+%    \end{macrocode}
+% we store the target name for the following code.
+%    \begin{macrocode}
+  \tl_set:Nx\l_@@_bib_target_tl{cite.#2\@extra at b@citeb}
+%    \end{macrocode}
+% The target is added at the begin of the paragraph.
+%    \begin{macrocode}
+  \AddToHookNext{para/begin}{\makebox[0pt][r]{\MakeLinkTarget*{\l_@@_bib_target_tl}\hspace{\leftmargin}}}
+  \item[\@biblabel{#1}\hfill]\if at filesw
+      {\let\protect\noexpand
+       \immediate
+       \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
+%    \end{macrocode}
+% we make a copy to be able to reinstate the definition. This is e.g.
+% currently needed with hyperref.
+%    \begin{macrocode}
+\let\@kernel at copy@lbibitem\@lbibitem       
+%    \end{macrocode}
+% \end{macro}
+% 
+% \begin{macro}{\@bibitem}
+% Similar for bibitem. 
+% TODO: If hyperref is loaded we will get a second target from the refstepcounter,
+% but this is ignored for now. 
+%    \begin{macrocode}
+\def\@bibitem#1{
+  \tl_set:Nx\l_@@_bib_target_tl{cite.#1\@extra at b@citeb}%
+  \AddToHookNext{para/begin}{\makebox[0pt][r]{\MakeLinkTarget*{\l_@@_bib_target_tl}\hspace{\leftmargin}}}
+  \item\if at filesw \immediate\write\@auxout
+       {\string\bibcite{#1}{\the\value{\@listctr}}}\fi\ignorespaces}
+\let\@kernel at copy@bibitem\@bibitem           
+%    \end{macrocode}
+% \end{macro}
+% 
+% TODO The LI-structure should set a label, we redefine the internal command locally for 
+% now, but perhaps this need a receipe? 
+% 
+%    \begin{macrocode}
+\AddToHook{env/thebibliography/begin}
+  {\cs_set:Npn \__block_list_item_begin:
+    { \tagstructbegin{tag=\LItag,label=\l_@@_bib_target_tl}}
+  }
+%    \end{macrocode}
+%
+% \subsection{Handling citation commands}
+% We redefine similar to hyperref the \cs{bibcite} command to inject link and
+% structure. Even if it looks a bit odd it is now used for many years and so 
+% hopefully compatible with various packages. But differently to hyperref we use
+% the new hooks with arguments.
+% TODO: consider name. Perhaps use the generic names?
+%    \begin{macrocode}
+\NewMirroredHookPairWithArguments{bibcite/before}{bibcite/after}{2}  
+\def\bibcite#1#2{%
+   \@newl at bel{b}{#1\@extra at binfo}{%
+      \UseHookWithArguments{bibcite/before}{2}{#1}{#2}
+       #2
+      \UseHookWithArguments{bibcite/after}{2}{#1}{#2} 
+       }%
+     }% 
+\let\@kernel at copy@bibcite\bibcite         
+%    \end{macrocode}
+% Now we add the tagging structure.
+% TODO: the ref key should expand its argument directly!
+%    \begin{macrocode}
+\AddToHookWithArguments{bibcite/before}
+  {
+    \tag_mc_end_push:
+    \exp_args:Nx\tagstructbegin{tag=Reference,ref=cite.#1\@extra at b@citeb}
+    \tagmcbegin{}
+  }
+\AddToHookWithArguments{bibcite/after}[tag]
+  {
+    \tag_mc_end:
+    \tagstructend
+    \tag_mc_begin_pop:n{}
+  }
+%    \end{macrocode}
+% At last the code for hyperref, the link will be inside the reference, but
+% this can be changed with a rule.
+%    \begin{macrocode}
+\AddToHook{package/hyperref/after}
+ {
+%    \end{macrocode}
+% the next hyperref will allow to suppress the bib patches, but with older
+% versions we muss reinstated them. 
+%    \begin{macrocode}
+   \@ifpackagelater{hyperref}{2023-05-01}{}
+    {
+      \@ifpackageloaded{natbib}{}
+       {\let\@lbibitem\@kernel at copy@lbibitem
+        \let\@bibitem\@kernel at copy@bibitem
+        \let\bibcite\@kernel at copy@bibcite}
+    }
+   \AddToHookWithArguments{bibcite/before}{\hyper at linkstart{cite}{cite.#1\@extra at b@citeb}}
+   \AddToHookWithArguments{bibcite/after}{\hyper at linkend}
+ }
+%    \end{macrocode}
+%
+% \subsection{Natbib support}
+%  natbib offers various hooks that can be used. The main problem is
+%  to coordinate with the hyperref use of the same hooks.
+%  We also have to add something at the begin of \cs{@lbibitem}. 
+%  As generic hooks with arguments aren't available yet, we have to copy the definition
+%  
+%    \begin{macrocode}
+\AddToHook{package/natbib/after}
+  {
+    \def\hyper at natanchorstart#1{\MakeLinkTarget*{#1}}
+    \def\@lbibitem[#1]#2{%
+      \tl_set:Nx\l__tag_bib_target_tl{cite.#2\@extra at b@citeb}
+      \if\relax\@extra at b@citeb\relax\else
+        \@ifundefined{br@#2\@extra at b@citeb}{}{%
+         \@namedef{br@#2}{\@nameuse{br@#2\@extra at b@citeb}}%
+        }%
+      \fi
+      \@ifundefined{b@#2\@extra at b@citeb}{%
+       \def\NAT at num{}%
+      }{%
+       \NAT at parse{#2}%
+      }%
+      \def\NAT at tmp{#1}%
+      \expandafter\let\expandafter\bibitemOpen\csname NAT at b@open@#2\endcsname
+      \expandafter\let\expandafter\bibitemShut\csname NAT at b@shut@#2\endcsname
+      \@ifnum{\NAT at merge>\@ne}{%
+       \NAT at bibitem@first at sw{%
+        \@firstoftwo
+       }{%
+        \@ifundefined{NAT at b*@#2}{%
+         \@firstoftwo
+        }{%
+         \expandafter\def\expandafter\NAT at num\expandafter{\the\c at NAT@ctr}%
+         \@secondoftwo
+        }%
+       }%
+      }{%
+       \@firstoftwo
+      }%
+      {%
+       \global\advance\c at NAT@ctr\@ne
+       \@ifx{\NAT at tmp\@empty}{\@firstoftwo}{%
+        \@secondoftwo
+       }%
+       {%
+        \expandafter\def\expandafter\NAT at num\expandafter{\the\c at NAT@ctr}%
+        \global\NAT at stdbsttrue
+       }{}%
+       \bibitem at fin
+       \item[\hfil\NAT at anchor{#2}{\NAT at num}]%
+       \global\let\NAT at bibitem@first at sw\@secondoftwo
+       \NAT at bibitem@init
+      }%
+      {%
+       \NAT at anchor{#2}{}%
+       \NAT at bibitem@cont
+       \bibitem at fin
+      }%
+      \@ifx{\NAT at tmp\@empty}{%
+        \NAT at wrout{\the\c at NAT@ctr}{}{}{}{#2}%
+      }{%
+        \expandafter\NAT at ifcmd\NAT at tmp(@)(@)\@nil{#2}%
+      }%
+    }%
+%    \end{macrocode}
+% we redefine the hook to use latex hooks.
+%    \begin{macrocode}
+    \NewMirroredHookPairWithArguments{natbib/linkstart}{natbib/linkend}{1}  
+    \renewcommand\hyper at natlinkstart[1]{\UseHookWithArguments{natbib/linkstart}{1}{#1}}
+    \renewcommand\hyper at natlinkend{\UseHookWithArguments{natbib/linkend}{1}{}}
+    \AddToHookWithArguments{natbib/linkstart}
+      {
+         \leavevmode
+         \tag_mc_end_push:
+         \exp_args:Nx\tagstructbegin{tag=Reference,ref=cite.#1\@extra at b@citeb}
+         \tagmcbegin{}
+      } 
+    \AddToHook{natbib/linkend}
+      {  
+       \tag_mc_end:
+       \tagstructend
+       \tag_mc_begin_pop:n{}
+      }
+  }     
+%    \end{macrocode}
+% if hyperref is loaded we have to repeat the definition
+% 
+%    \begin{macrocode}
+\AddToHook{package/hyperref/after}
+ {
+    \renewcommand\hyper at natlinkstart[1]{\UseHookWithArguments{natbib/linkstart}{1}{#1}}
+    \renewcommand\hyper at natlinkend{\UseHookWithArguments{natbib/linkend}{1}{}}
+    \AddToHookWithArguments{natbib/linkstart}
+      {
+         \Hy at backout{#1}%
+         \hyper at linkstart{cite}{cite.#1}%
+         \def\hyper at nat@current{#1}
+      } 
+    \AddToHook{natbib/linkend}
+      {  
+       \hyper at linkend
+      }
+ }
+%    \end{macrocode}
+%    \begin{macrocode}
+%</package>
+%    \end{macrocode}
+%    \begin{macrocode}
+%<*latex-lab>
+\ProvidesFile{bib-latex-lab-testphase.ltx}
+        [2023-05-18 v0.8 code related to the tagging of bib and citations]
+
+\RequirePackage{latex-lab-testphase-bib}
+
+%</latex-lab>
+%    \end{macrocode}


Property changes on: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-bib.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-block-tagging.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-block-tagging.dtx	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-block-tagging.dtx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -26,8 +26,8 @@
 % \fi
 %
 
-\def\ltblocksversion{v0.8a}
-\def\ltblocksdate{2023/03/08}
+\def\ltblocksversion{v0.8c}
+\def\ltblocksdate{2023/05/16}
 
 %
 % \title{Prototype reimplementation of \LaTeXe{}'s block environments using templates}
@@ -1066,6 +1066,11 @@
 \AddToHook{begindocument/before}{
   \RenewDocumentEnvironment{verbatim}{ !O{} }
     { \UseInstance{blockenv}{verbatim} {#1}
+%    \end{macrocode}
+%    This is the part of the code where \env{verbatim}
+%    and\env{verbatim*} differ.
+%    \begin{macrocode}
+      \@setupverbinvisiblespace\frenchspacing\@vobeyspaces
       \@xverbatim
     }
     { \endblockenv }
@@ -1088,7 +1093,15 @@
 %
 %
 %  \begin{macro}{\legacyverbatimsetup}
-%    
+%
+%    This code resembles the \LaTeXe{} verbatim implementation with a
+%    slight twist: in \LaTeXe{} each code line was a paragraph using
+%    \cs{leftskip}=\cs{@totalleftmargin}. This was possible because
+%    the whole environment was implemented as a trivlist. As this is
+%    no longer the case setting \cs{leftskip} would alter the layout
+%    of a surrounding list. So instead we need to make sure that the
+%    paragraph end is executed in a group so that any parshape setup
+%    is preserved.
 %    \begin{macrocode}
 %<@@=>  
 \def\legacyverbatimsetup{%
@@ -1096,10 +1109,10 @@
   \@tempswafalse
   \def\par{%
     \if at tempswa
-      \leavevmode \null \@@par\penalty\interlinepenalty
+      \leavevmode \null {\@@par}\penalty\interlinepenalty
     \else
       \@tempswatrue
-      \ifhmode\@@par\penalty\interlinepenalty\fi
+      \ifhmode{\@@par}\penalty\interlinepenalty\fi
     \fi}%
   \let\do\@makeother \dospecials
   \obeylines \verbatim at font \@noligs
@@ -1109,8 +1122,6 @@
 %    \begin{macrocode}
   \tl_set:Nn \l__tag_para_main_tag_tl {codeline}
   \tagtool{paratag=Code}%   oder faster: \tl_set:Nn\l__tag_para_tag_tl{Code}      
-  \@setupverbinvisiblespace
-  \frenchspacing \@vobeyspaces
 }
 %<@@=block>  
 %    \end{macrocode}
@@ -1279,32 +1290,126 @@
 % \subsubsection{Theorem-like environments}
 %
 % Theorem-like environments are defined in \LaTeX{} with the help of
-% \cs{newtheorem} declarations. Internally they use a list with a
-% single item. For now we keep this approach and only add appropriate
-% tagging support wihtin the internal commands.
+% \cs{newtheorem} declarations. Internally they used a list with a
+% single item. Using lists was convenient back then, but in a tagged
+% document you end up with a strange structure. We therefore alter the
+% mechanism.
 %
 %
+%  \begin{macro}{\newtheorem}
+%    This is a slightly streamlined version of \cs{newtheorem}, but it
+%    still uses a lot of the 2e code for now. Eventually this will change.
+%    \begin{macrocode}
+\RenewDocumentCommand \newtheorem { m O{#1} m o }
+{
+  \expandafter\@ifdefinable\csname #1\endcsname
+    {
+      \str_if_eq:nnTF{#1}{#2}
+         {
+           \@definecounter {#2}
+           \IfNoValueTF {#4}
+             {  % @ynthm
+               \tl_gset:cx { the #2 }
+                  {
+                    \@thmcounter{#2}
+                  }
+             }
+             {  % @xnthm
+               \@newctr{#1}[#4]
+               \tl_gset:cx { the #2 }
+                  {
+                    \expandafter\noexpand\csname the#4\endcsname
+                    \@thmcountersep
+                    \@thmcounter{#2}
+                  }
+             }
+         }
+         {  % @othm
+           \@ifundefined{c@#2}
+              { \@nocounterr{#2} }
+              {
+                \tl_gset:cn { the #1 }
+                   { \UseName { the #2 } }
+              }
+         }
+      \global\@namedef{#1}   { \@thm{#2}{#3} }
+      \global\@namedef{end#1}{ \@endtheorem  }
+    }
+}
+%    \end{macrocode}
+%  \end{macro}
+%
 %  \begin{macro}{\@begintheorem,\@opargbegintheorem}
 %
-%    We use \struct{theorem-like} as the structure name and rollmap it
-% to a list (\struct{L}).
+%    The \cs{@thm} command expands to either \cs{@beginthorem} or
+%    \cs{@opargbegintheorem}. For the moment we stick with this as it
+%    will help with the transion. But instead of using a
+%    \env{trivlist} we use a blockenv and some tagging for the title
+%    (as a Caption).
+%
 %    \begin{macrocode}
-\tag_if_active:T {
-  \tagpdfsetup{add-new-tag={tag=theorem-like,role=L}}
+\def\@begintheorem#1#2{
+  \UseInstance{blockenv}{theorem}{}
+  \tagpdfparaOff
+  \textbf{
+    \tag_struct_begin:n{tag=Caption}
+      \tag_mc_begin:n {}
+        #1\
+      \tag_mc_end:
+      \tag_struct_begin:n{tag=Lbl}
+        \tag_mc_begin:n {}
+          #2
+        \tag_mc_end:
+      \tag_struct_end:
+    \tag_struct_end:
+  }
+  \tagpdfparaOn
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
+  \@@_start_para_structure_unconditionally:n { \PARALABEL }
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
+  \itshape
+  \hskip\labelsep
+  \ignorespaces
 }
+\def\@opargbegintheorem#1#2#3{
+  \UseInstance{blockenv}{theorem}{}
+  \tagpdfparaOff
+  \textbf{
+    \tag_struct_begin:n{tag=Caption}
+      \tag_mc_begin:n {}
+        #1\
+      \tag_mc_end:
+      \tag_struct_begin:n{tag=Lbl}
+        \tag_mc_begin:n {}
+          #2
+        \tag_mc_end:
+      \tag_struct_end:
+      \tag_mc_begin:n {}
+        \ (#3)
+      \tag_mc_end:
+    \tag_struct_end:
+  }
+  \tagpdfparaOn
 %    \end{macrocode}
-%
-%    With that done, we only have to tell the \env{trivlist} what
-%    \key{tag-name} it should use.
+%    
 %    \begin{macrocode}
-\def\@begintheorem#1#2{\trivlist[tag-name=theorem-like]%
-   \item[\hskip \labelsep{\bfseries #1\ #2}]\itshape}
+  \@@_start_para_structure_unconditionally:n { \PARALABEL }
 %    \end{macrocode}
 %    
 %    \begin{macrocode}
-\def\@opargbegintheorem#1#2#3{\trivlist[tag-name=theorem-like]
-      \item[\hskip \labelsep{\bfseries #1\ #2\ (#3)}]\itshape}
+  \itshape
+  \hskip\labelsep
+  \ignorespaces
+}
 %    \end{macrocode}
+%    
+%    \begin{macrocode}
+\def\@endtheorem{\endblockenv}
+%    \end{macrocode}
 %  \end{macro}
 %
 %
@@ -1569,8 +1674,18 @@
 %    So this is for now always done. Probably \cs{l_@@_topsepadd_skip} above
 %    should be added only if the paragraph ends here and not if it
 %    continues, so this need some further cleanup.\fmi{decide}
+    %    \begin{macrocode}
+  \bool_if:NTF \l_@@_standalone_bool  
+%    \end{macrocode}
+%    It is possible that \texttt{@endpe} is true because a
+%    displayblock has just ended before we end the standalone
+%    displayblock and in that casevthere is no outer
+%    \struct{text-unit} so we have to explicitly set \texttt{@endpe}
+%    back to false to prevent it from closing a structure later that
+%    isn't there.
 %    \begin{macrocode}
-  \legacy_if_gset_true:n { @endpe }
+    { \legacy_if_gset_false:n { @endpe } }
+    { \legacy_if_gset_true:n  { @endpe } }
 }
 %    \end{macrocode}
 %
@@ -1577,7 +1692,6 @@
 %  \end{macro}
 %
 %
-%
 %  \begin{macro}{\__kernel_displayblock_end:}
 %    The kernel hook for tagging at the end of the block.
 %    \begin{macrocode}
@@ -1589,10 +1703,18 @@
 %
 %
 %
+%  \begin{macro}{\l_@@_standalone_bool}
+%    
+%    \begin{macrocode}
+\bool_new:N       \l_@@_standalone_bool
+\bool_set_false:N \l_@@_standalone_bool
+%    \end{macrocode}
+%  \end{macro}
 %
 %
 %
 %
+%
 % \subsubsection{Implementation of para templates \ldots}
 %
 %  \begin{template}{para std}
@@ -2393,6 +2515,32 @@
 %    \end{macrocode}
 %  \end{macro}
 %
+%  \begin{macro}{\@@_recipe_standalone:}
+%    
+%    The \texttt{standalone} recipe produces a block that ensures that
+%    a previous \texttt{text-unit} ends and that after the block a new
+%    \texttt{text-unit} starts.
+%    \begin{macrocode}
+\cs_new:Npn \@@_recipe_standalone: {
+  \cs_set_eq:NN \__kernel_displayblock_beginpar_hmode:w
+                                              \prg_do_nothing:
+  \cs_set_eq:NN \__kernel_displayblock_beginpar_vmode:
+                                              \prg_do_nothing:
+  \cs_set_eq:NN \__kernel_displayblock_begin: \@@_inner_begin:
+  \cs_set_eq:NN \__kernel_displayblock_end:   \@@_inner_end:
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
+  \bool_set_true:N \l_@@_standalone_bool
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
+  \tl_if_empty:NTF \l_@@_tag_name_tl
+     { \tl_set:Nn    \l_@@_tag_inner_tag_tl {Sect}            }
+     { \tl_set_eq:NN \l_@@_tag_inner_tag_tl \l_@@_tag_name_tl }
+}
+%    \end{macrocode}
+%  \end{macro}
 %
 %  \begin{macro}{\@@_recipe_standard:}
 %    The \texttt{standard} recipe does the following:
@@ -2680,7 +2828,35 @@
 % }
 %    \end{macrocode}
 %
+
+%    
+%    \begin{macrocode}
+\DeclareInstance{blockenv}{theorem}{display}
+{
+  env-name       = theorem-like,
+  tag-name       = theorem-like,
+  tag-class      = ,
+  tagging-recipe = standalone,
+  inner-level-counter  = ,
+  level-increase = false,
+  setup-code     = ,
+  block-instance = displayblock ,
+%  inner-instance-type = innerblock ,
+%  inner-instance = theorem,
+}
+%    \end{macrocode}
 %
+% We use \struct{theorem-like} as the structure name and rollmap it
+% to a \struct{Sect} because that can hold a \struct{Caption}.
+%    \begin{macrocode}
+\tag_if_active:T {
+  \tagpdfsetup{add-new-tag={tag=theorem-like,role=Sect}}
+}
+%    \end{macrocode}
+%
+%
+%
+%
 % \subsubsection{Verbatim instances}
 %
 %  \begin{instance}{blockenv verbatim}
@@ -2707,7 +2883,7 @@
   inner-level-counter  = ,
   level-increase = false,
   setup-code     = ,
-  block-instance = displayblock ,
+  block-instance = verbatimblock ,
   inner-instance = ,
   final-code     = \legacyverbatimsetup ,
 }
@@ -2840,8 +3016,44 @@
 \DeclareInstanceCopy{block}{displayblock-6}{displayblock-0}
 %    \end{macrocode}
 %  \end{instance}
+%
+%
+%
+% \subsubsection{Verbatim instances}
+%
+%  Verbatim instances have there own levels so that one can specify
+%  specific indentations or vertical separations between line.
 %  
-%  
+%  \begin{instance}{block verbatimblock-0,
+%                   block verbatimblock-1,
+%                   block verbatimblock-2,
+%                   block verbatimblock-3,
+%                   block verbatimblock-4,
+%                   block verbatimblock-5,
+%                   block verbatimblock-6 }
+%
+%    \begin{macrocode}
+\DeclareInstance{block}{verbatimblock-0}{display}
+  {
+    leftmargin      = 0pt ,
+    parindent       = 0pt ,
+    par-skip        = 0pt ,
+  } 
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\DeclareInstanceCopy{block}{verbatimblock-1}{verbatimblock-0}
+\DeclareInstanceCopy{block}{verbatimblock-2}{verbatimblock-0}
+\DeclareInstanceCopy{block}{verbatimblock-3}{verbatimblock-0}
+\DeclareInstanceCopy{block}{verbatimblock-4}{verbatimblock-0}
+\DeclareInstanceCopy{block}{verbatimblock-5}{verbatimblock-0}
+\DeclareInstanceCopy{block}{verbatimblock-6}{verbatimblock-0}
+%    \end{macrocode}
+%  \end{instance}
+%
+%
+%
+%
 % \subsubsection{Quote/quotationblock instances}
 %
 %  Quote and quotation are not flattened, i.e., they change levels,
@@ -2868,6 +3080,8 @@
 %    \end{macrocode}
 %  \end{instance}
 %  
+%
+%  
 %  \begin{instance}{block quotationblock-1,
 %                   block quotationblock-2,
 %                   block quotationblock-3,
@@ -3147,7 +3361,6 @@
 %    then have to avoid adding another \texttt{text-unit}.
 %    \begin{macrocode}
       {
-%    \typeout{-->G1~ (\int_use:N \l_@@_flattened_level_int)}
         \int_compare:nNnT \l_@@_flattened_level_int < 2
             {
               \int_gincr:N \g__tag_para_main_begin_int
@@ -3217,7 +3430,7 @@
              \bool_if:NF \l__tag_para_flattened_bool
                {
                  \@@_debug_typeout:n{Structure-end~
-                       \l__tag_para_main_tag_tl\space after~ list \on at line }
+                   \l__tag_para_main_tag_tl\space after~ displayblock \on at line }
                  \int_gincr:N \g__tag_para_main_end_int      
                  \tag_struct_end: %text-unit
                }
@@ -3256,33 +3469,67 @@
 %    case we only start a new MC (because the \struct{text} tag is still open from
 %    before the list --- one of the reasons why lists are always put
 %    \enquote{inside} paragraphs.
+%
+%    We do this in a separate command, because it is needed elsewhere too.
 %    \begin{macrocode}
-           \@@_debug_typeout:n
-              { @endpe = \legacy_if:nTF { @endpe }{true}{false}
-                \on at line }
-           \legacy_if:nF { @endpe }
-             {
-               \bool_if:NF \l__tag_para_flattened_bool
-                  {
-                    \int_gincr:N \g__tag_para_main_begin_int
-                    \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl}
-                  }
-              }
-           \int_gincr:N \g__tag_para_begin_int
-           \@@_debug_typeout:n{increment~ P \on at line }
-           \tag_struct_begin:n
-               {
-                  tag=\l__tag_para_tag_tl
-                 ,attribute-class=\l_tag_para_attr_class_tl
-               }
-           \__tag_check_para_begin_show:nn {green}{\PARALABEL}    
-           \tag_mc_begin:n {}
+           \@@_start_para_structure:n { \PARALABEL }
          }
      }
 }
 %    \end{macrocode}
 %    
+%    
+%  \begin{macro}{\@@_start_para_structure:n}
+%    
 %    \begin{macrocode}
+\cs_new_protected:Npn \@@_start_para_structure:n #1 {
+   \@@_debug_typeout:n
+      { @endpe = \legacy_if:nTF { @endpe }{true}{false}
+        \on at line }
+   \legacy_if:nF { @endpe }
+     {
+       \bool_if:NF \l__tag_para_flattened_bool
+          {
+            \int_gincr:N \g__tag_para_main_begin_int
+            \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl}
+          }
+      }
+   \int_gincr:N \g__tag_para_begin_int
+   \@@_debug_typeout:n{increment~ P \on at line }
+   \tag_struct_begin:n
+       {
+          tag=\l__tag_para_tag_tl
+         ,attribute-class=\l_tag_para_attr_class_tl
+       }
+   \__tag_check_para_begin_show:nn {green}{#1}    
+   \tag_mc_begin:n {}
+}
+%    \end{macrocode}
+%    The same code, but without testing \texttt{@endpe}. This is not
+%    needed in the standalong e case and wrong inside lists.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_start_para_structure_unconditionally:n #1 {
+   \bool_if:NF \l__tag_para_flattened_bool
+       {
+         \int_gincr:N \g__tag_para_main_begin_int
+         \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl}
+       }
+   \int_gincr:N \g__tag_para_begin_int
+   \@@_debug_typeout:n{increment~ P \on at line }
+   \tag_struct_begin:n
+       {
+          tag=\l__tag_para_tag_tl
+         ,attribute-class=\l_tag_para_attr_class_tl
+       }
+   \__tag_check_para_begin_show:nn {green}{#1}    
+   \tag_mc_begin:n {}
+}
+%    \end{macrocode}
+%  \end{macro}
+%    
+%    
+%    
+%    \begin{macrocode}
 \tag_if_active:T {
 %  \tagpdfsetup{add-new-tag={tag=text-unit,role=Part}}
 }
@@ -3400,25 +3647,7 @@
 \cs_set:Npn \__kernel_list_label_after: {
    \bool_if:NT \l__tag_para_bool
      {
-       \bool_if:NF \l__tag_para_flattened_bool
-            {
-%              \typeout{-->G3}
-              \int_gincr:N \g__tag_para_main_begin_int 
-              \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl}
-            }
-       \int_gincr:N \g__tag_para_begin_int
-       \@@_debug_typeout:n{increment~ P \on at line }
-       \tag_struct_begin:n {
-          tag=\l__tag_para_tag_tl
-         ,attribute-class=\l_tag_para_attr_class_tl
-       }
-       \bool_if:NT \l__tag_para_show_bool
-            {
-              \tag_mc_begin:n {artifact}
-              \llap {\color_select:n {blue}\tiny Li-\int_use:N \g__tag_para_begin_int \ }
-              \tag_mc_end:
-            }
-       \tag_mc_begin:n {tag=P}
+       \@@_start_para_structure_unconditionally:n { LI- }
      }
 }
 %    \end{macrocode}

Added: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-float.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-float.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-float.dtx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,492 @@
+% \iffalse meta-comment
+%
+%% File: latex-lab-float.dtx (C) Copyright 2023 LaTeX Project
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version.  The latest version
+% of this license is in the file
+%
+%    https://www.latex-project.org/lppl.txt
+%
+%
+% The development version of the bundle can be found below
+%
+%    https://github.com/latex3/latex2e/required/latex-lab
+%
+% for those people who are interested or want to report an issue.
+%
+%<*driver>
+\documentclass{l3doc}
+\EnableCrossrefs
+\CodelineIndex
+\begin{document}
+  \DocInput{latex-lab-float.dtx}
+\end{document}
+%</driver>
+%
+% \fi
+%
+%
+% \title{The \textsf{latex-lab-floats} package\\
+% Tagging of floats }
+% \author{\LaTeX{} Project\thanks{Initial implementation done by Ulrike Fischer}}
+% \date{v0.8 2023-05-17}
+%
+% \maketitle
+%
+% \newcommand{\xt}[1]{\textsl{\textsf{#1}}}
+% \newcommand{\TODO}[1]{\textbf{[TODO:} #1\textbf{]}}
+% \newcommand{\docclass}{document class \marginpar{\raggedright document class
+% customizations}}
+%
+% \providecommand\hook[1]{\texttt{#1}}
+% \begin{documentation}
+% \begin{abstract}
+% The following code implements a first draft for the tagging of float 
+% environments
+% \end{abstract}
+% 
+% 
+% \section{Introduction}
+% 
+% The code here handle the tagging of float environments. 
+% 
+% Figures (and tables) are in \LaTeX{} typically typeset in float environments. 
+% These are boxes which can \emph{float} away to special float areas on the pages, 
+% e.g., to the top or the bottom of a page or to special float pages.
+% If the rules allow it they can also be placed in the main text stream (\enquote{here}).  
+% Floats can also be collected at the end of the document. 
+% In either case  the order within each type of floats 
+% (e.g., figures, tables, algorithms, etc.) is preserved.
+% 
+% A special type, called a H-float, (provided by the float package)
+% is always placed in the main text stream and does not
+% necessarly preserve the order with normal floats of the same type: It is basically
+% a minipage with a caption.
+% 
+% Floats typically contain a figure (or a table, etc.) and a caption, 
+% but more complex constructions with subfigures,
+% copyright statements, sources or additional description are possible too.
+% 
+% In the \LaTeX{} source a float is normally more or less at the place of 
+% the first call-out, but when preparing a document for print the code 
+% is sometimes moved to place floats in a more visually pleasing way.
+% 
+% \section{Tagging}
+% 
+% Floats (with the exception of H-floats) do not belong into the text stream, they
+% are \enquote{consultation objects}: Readers must be able to choose if and when they read the float.
+% Floats have captions, the PDF rules require that a \texttt{Caption} is the first or last
+% structure in its parent structure. 
+% This poses some challenges on a good tagging.
+% 
+% In PDF~2.0 there is the suitable \texttt{Aside} tag which hopefully will 
+% be handled correctly regarding the reading order once processor actually support
+% PDF~2.0. But in PDF~1.7 we rolemap it to \texttt{Note} and this doesn't lead to 
+% a good reading order. The code therefore collect the float structures and moves
+% them to a \texttt{Sect} the end of the document or the chapter 
+% (H-floats once they are handled will not be moved).
+% 
+% To fulfill the requirement that a \texttt{Caption} should be at the begin or end, we always
+% move it to the begin of the structure. If a float has two captions the author
+% has to insert a command which splits the float in two.
+% 
+% Subfigures and subcaptions are currently not handled, but will be implemented
+% as simple \texttt{Part} with their own \texttt{Caption}.    
+% 
+% \section{Links}
+% The code disable the caption patches from hyperref. It will add an anchor at the
+% begin of the float or a split. It changes caption so that a link to a caption label
+% will go to the begin of the float.
+% 
+% \section{Tools}
+% 
+% The code add two keys for the \cs{tagtool} command
+% 
+% \begin{description}
+% \item[flush-floats]  This will flush out the collected floats sofar (currently
+% table and figure. The value is a sectioning level, e.g. \texttt{section} or \texttt{chapter},
+% the floats will then inserted as a \texttt{Sect} of this level (all \texttt{Sect} of smaller or equal
+% level are closed). The key then starts a new container for following floats.
+% If no value is given, the \texttt{Sect} is at the document level. The code automatically
+% flush all open floats at the end of the document.
+% 
+% \item[split-float] This can be used inside a float if there are two captions.
+% It will only work reasonably well if the content of the float parts are in a sensible order
+% and can be separated by this command. More complex setups with tabulars will need more
+% thoughts
+% 
+%  \end{description} 
+%                                    
+%  
+%    \begin{macrocode}
+%<@@=tag>
+%<*package>
+%    \end{macrocode}
+% \end{documentation}
+% \begin{implementation}
+% \section{Implementation} 
+%    \begin{macrocode}
+\ProvidesExplPackage {latex-lab-testphase-float} {2023-04-28} {0.8}
+  {Code related to the tagging of floats}
+%    \end{macrocode}
+% \subsection{Variables}
+% We rolemap to Aside, and float sections to Sect
+% 
+%    \begin{macrocode}
+\tagpdfsetup{add-new-tag=float/Aside}
+\tagpdfsetup{add-new-tag=figures/Sect}
+\tagpdfsetup{add-new-tag=tables/Sect}
+%    \end{macrocode}
+%
+% \begin{variable}{
+%  \g_@@_float_sect_prop,
+%  \g_@@_float_types_seq
+%   }
+% These variables will hold the structure number for the float container  
+% and the list of float types. Currently only figure and table are supported
+% TODO: interface to declare new float types.
+%    \begin{macrocode}
+\prop_new:N \g_@@_float_sect_prop
+\seq_new:N  \g_@@_float_types_seq
+\seq_gput_right:Nn \g_@@_float_types_seq {figure}
+\seq_gput_right:Nn \g_@@_float_types_seq {table}
+%    \end{macrocode}
+% \end{variable}
+% 
+% \begin{variable}{\g_@@_float_sect_bool}
+% With this boolean float collection is switched on and off.
+% Currently it is always on and set globally. 
+% TODO: think if an interface is needed.
+% TODO: would a local variable make more sense?
+%    \begin{macrocode}
+\bool_new:N       \g_@@_float_sect_bool
+\bool_gset_true:N  \g_@@_float_sect_bool
+%    \end{macrocode}
+% \end{variable}
+% 
+% 
+%\subsection{Moving float structures}
+% 
+% Currently it is for all float types or none.
+% Probably we will need some more options here to select some float types.
+% 
+% \begin{macro}{\@@_float_init_collect:}
+% This initializes a container structure for every float type.
+% It can be used more than once in a document, this allows to have e.g.
+% chapter wise containers.
+%    \begin{macrocode}
+\cs_new_protected:Npn\@@_float_init_collect:
+  { 
+    \bool_if:NT\g_@@_float_sect_bool
+      {
+        \seq_map_inline:Nn\g_@@_float_types_seq
+          {
+            \tag_struct_begin:n{tag=##1s,stash}
+            \prop_gput:Nnx\g_@@_float_sect_prop {##1-struct}{\int_use:N\c at g__tag_struct_abs_int} 
+            \tag_struct_end:
+          }  
+      }   
+  }
+%    \end{macrocode}
+% \end{macro}
+% 
+% 
+% \begin{macro}{\@@_float_stop_sect:}
+% This pushes out the floats. For every type is checks if there is actually
+% a float of this type and then writes out the container structure.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_float_stop_sect:
+  {
+    \bool_if:NT\g_@@_float_sect_bool
+     {
+      \seq_map_inline:Nn\g_@@_float_types_seq
+        {
+          \prop_get:NnNT\g_@@_float_sect_prop{##1-used}\l_@@_tmpa_tl
+            {
+              \exp_args:Ne
+              \tag_struct_use_num:n{\prop_item:Nn\g_@@_float_sect_prop{##1-struct}}
+              \prop_gremove:Nn \g_@@_float_sect_prop{##1-used}
+            }  
+        }  
+     }   
+  } 
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{flush-floats}
+% This is a key for \cs{tagtool} to flush out the collected floats. 
+% The value allows to set to which level the create Sect contains. 
+% So \texttt{section} will close all previous Sect until the section level
+% and create a new section.
+%    \begin{macrocode}
+\keys_define:nn { tag / tool} 
+ {
+   flush-floats .code:n = 
+     {
+       \keys_set:nn {tag / tool} {sec-stop=#1}
+       \@@_float_stop_sect:
+       \@@_float_init_collect:
+     },
+   flush-float .default:n = Document  
+ }
+%    \end{macrocode}
+% \end{macro}
+% We need at least one pair
+%    \begin{macrocode}
+\AddToHook{begindocument/end}[latex-lab/float]
+  {\@@_float_init_collect:}
+\AddToHook{tagpdf/finish/before}[latex-lab/float]
+  {\par\__tag_sec_end:n{-10}\@@_float_stop_sect:}
+\DeclareHookRule{tagpdf/finish/before}{latex-lab/float}{before}{tagpdf}
+%    \end{macrocode}
+% \subsection{Splitting floats}
+% \begin{macro}{split-float}
+% TODO: check if the target affect spacing!! 
+%    \begin{macrocode}
+\keys_define:nn { tag / tool}
+  {
+   split-float .code:n = 
+    { 
+      \@@_float_end:
+      \@@_float_begin:
+      \MakeLinkTarget[tagstructure]{g__tag_struct_abs_int}
+    }  
+ }
+%    \end{macrocode}
+% \end{macro}
+ 
+% \subsection{Patching}
+% \begin{macro}{\@@_float_stop_par:,\@@_float_start_par:}
+% if a float is in a par, we need commands to stop and restart the P-mc
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_float_stop_par:
+  {
+    \tag_mc_end:
+    \bool_if:NF \g_@@_float_sect_bool
+     { 
+      \tag_struct_end:
+     }  
+  }
+\cs_new_protected:Npn \@@_float_start_par:
+  {
+    \bool_if:NF \g_@@_float_sect_bool
+     { 
+      \tag_struct_begin:n{tag=text}%
+     }
+   \tag_mc_begin:n{tag=P}    
+  }
+ 
+%    \end{macrocode}
+% \end{macro}
+% These commands are the main commands to start and end the float tagging.
+% 
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_float_begin:
+ {%
+%    \end{macrocode}
+% We test if the float structure should be included directly or move to a dedicated section.
+%    \begin{macrocode}
+  \bool_if:NTF\g_@@_float_sect_bool
+   {
+     \exp_args:Ne
+     \tag_struct_begin:n{tag=float,parent=0\prop_item:No\g_@@_float_sect_prop{\@captype-struct}}%
+     \prop_gput:Nxx \g_@@_float_sect_prop {\@captype-used}{true}
+   }
+   {
+     \tag_struct_begin:n{tag=float}
+   }
+     \tl_set:Nx\@current at float@struct{\tag_get:n{struct_num}}%
+     \typeout{Float structure: \@current at float@struct}   
+ }
+
+\cs_new_protected:Npn\@@_float_end:{\tag_struct_end:} %end Aside
+
+%    \end{macrocode}
+% This patches the main command \cs{@xfloat}.
+% There is a : in the code, so we disable expl3 syntax
+%    \begin{macrocode}
+\ExplSyntaxOff
+\def\@xfloat #1[#2]{%
+  \@nodocument
+  \def \@captype {#1}%
+   \def \@fps {#2}%
+   \@onelevel at sanitize \@fps
+   \def \reserved at b {!}%
+   \ifx \reserved at b \@fps
+     \@fpsadddefault
+   \else
+     \ifx \@fps \@empty
+       \@fpsadddefault
+     \fi
+   \fi
+   \ifhmode
+     \@bsphack
+%    \end{macrocode}
+% If the float is in hmode we have to interrupt the P 
+%    \begin{macrocode}
+     \@nameuse{@@_float_stoppar:} %<---end P     
+     \@floatpenalty -\@Mii
+   \else
+     \@floatpenalty-\@Miii
+   \fi
+  \ifinner
+     \@parmoderr\@floatpenalty\z@
+  \else
+    \@next\@currbox\@freelist
+      {%
+       \@tempcnta \sixt@@@@n
+       \expandafter \@tfor \expandafter \reserved at a
+         \expandafter :\expandafter =\@fps
+         \do
+          {%
+           \if \reserved at a h%
+             \ifodd \@tempcnta
+             \else
+               \advance \@tempcnta \@ne
+             \fi
+           \else\if \reserved at a t%
+             \@setfpsbit \tw@
+           \else\if \reserved at a b%
+             \@setfpsbit 4%
+           \else\if \reserved at a p%
+             \@setfpsbit 8%
+           \else\if \reserved at a !%
+             \ifnum \@tempcnta>15
+               \advance\@tempcnta -\sixt@@@@n\relax
+             \fi
+           \else
+             \@latex at error{Unknown float option `\reserved at a'}%
+             {Option `\reserved at a' ignored and `p' used.}%
+             \@setfpsbit 8%
+           \fi\fi\fi\fi\fi
+           }%
+       \@tempcntb \csname ftype@\@captype \endcsname
+       \multiply \@tempcntb \@xxxii
+       \advance \@tempcnta \@tempcntb
+       \global \count\@currbox \@tempcnta
+       }%
+    \@fltovf
+  \fi
+%    \end{macrocode}
+% This starts the structure for the float.
+%    \begin{macrocode}
+  \@nameuse{@@_float_begin:}%
+  \global \setbox\@currbox
+    \color at vbox
+      \normalcolor
+      \vbox \bgroup
+        \hsize\columnwidth
+        \@parboxrestore
+        \@floatboxreset
+%    \end{macrocode}
+% We add a target for links. TODO: check that it doesn't affect spacing!!
+%    \begin{macrocode}
+        \MakeLinkTarget[tagstructure]{g__tag_struct_abs_int}%
+}%
+%    \end{macrocode}
+%  The end code of the float ...
+%    \begin{macrocode}
+\def\end at float{%
+  \@endfloatbox
+  \@nameuse{@@_float_end:}%
+  \ifnum\@floatpenalty <\z@
+    \@largefloatcheck
+    \@cons\@currlist\@currbox
+    \ifnum\@floatpenalty <-\@Mii
+      \penalty -\@Miv
+      \@tempdima\prevdepth
+      \vbox{}%
+      \prevdepth\@tempdima
+      \penalty\@floatpenalty
+    \else
+      \vadjust{\penalty -\@Miv \vbox{}\penalty\@floatpenalty}\@Esphack
+      \@nameuse{@@_float_start_par:} %restart P safe here??
+    \fi
+  \fi
+}
+\ExplSyntaxOn
+%    \end{macrocode}
+%
+% \subsection{Handling captions}
+% 
+% To avoid that hyperref interferes we disable its patches:
+%    \begin{macrocode}
+\def\hyper at nopatch@caption{}
+%    \end{macrocode}
+% As we will use the structure number in the target, we need to provide a
+% theH-representation. (Once the kernel will create
+% theH-representation generally this will be provided automatically, as tagpdf uses
+% \cs{newcounter})
+%    \begin{macrocode}
+\providecommand\theHg__tag_struct_abs_int{\int_use:N\c at g__tag_struct_abs_int}
+%    \end{macrocode}
+
+% \begin{macro}{\@makecaption}
+% \cs{@makecaption} is defined by the classes so we overwrite it for now
+% at begin document.
+%    \begin{macrocode}
+\AddToHook{begindocument}
+  {
+    \long\def\@makecaption#1#2{%
+      \vskip\abovecaptionskip
+      \xdef\@currentHref{tagstructure.\@current at float@struct}%
+%    \end{macrocode}
+% we don't want tagging when storing the caption for the singleline check
+%    \begin{macrocode}
+      \tag_stop:n{caption}
+      \sbox\@tempboxa{#1:~#2}%
+      \tag_start:n{caption} 
+%    \end{macrocode}
+% we stop paratagging. TODO: check 
+%    \begin{macrocode}
+      \tagtool{para=false}
+      \tag_struct_begin:n{tag=Caption,parent=\@current at float@struct}
+%    \end{macrocode}
+% move the caption to the begin of the float structure:
+%    \begin{macrocode}
+     \seq_gpop_right:cN {g__tag_struct_kids_\@current at float@struct _seq}\l_@@_tmpa_tl
+     \seq_gput_left:cV  {g__tag_struct_kids_\@current at float@struct _seq}\l_@@_tmpa_tl  
+      \ifdim \wd\@tempboxa >\hsize
+        \tag_struct_begin:n{tag=Lbl}
+        \tag_mc_begin:n{}
+          #1:~ 
+        \tag_mc_end:
+        \tag_struct_end:
+        \tag_mc_begin:n{}  
+          #2\par
+        \tag_mc_end:  
+      \else
+%    \end{macrocode}
+% we don't reuse the box as it doesn't contain tagging, but set the text explicitly.
+%    \begin{macrocode}
+          \global \@minipagefalse
+        \hb at xt@\hsize{\hfil
+         \tag_struct_begin:n{tag=Lbl}
+          \tag_mc_begin:n{}
+           #1:~ 
+          \tag_mc_end:
+         \tag_struct_end:
+         \tag_mc_begin:n{}  
+          #2\par
+         \tag_mc_end:\hfil}%
+       \fi
+       \tag_struct_end: %caption
+      \vskip\belowcaptionskip}
+  }  
+%    \end{macrocode}
+% \end{macro}
+%   
+%    \begin{macrocode}
+%</package>  
+%    \end{macrocode}
+
+%    \begin{macrocode}
+%<*latex-lab>
+\ProvidesFile{float-latex-lab-testphase.ltx}
+        [2023-04-30 v0.8 code related to the tagging of floats]
+\RequirePackage{latex-lab-testphase-float}
+%</latex-lab>
+%    \end{macrocode}
+% \end{implementation}


Property changes on: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-float.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -1324,7 +1324,7 @@
 %
 % \begin{macro}{\footnotetext}
 %    \begin{macrocode}
-\DeclareDocumentCommand\footnotetext {om}
+\DeclareDocumentCommand\footnotetext {o+m}
   {
     \fnote_set_fnmark:nn {#1} \@mpfn
     \@footnotetext {#2}
@@ -1335,7 +1335,7 @@
 %
 % \begin{macro}{\footnote}
 %    \begin{macrocode}
-\DeclareDocumentCommand\footnote {om}
+\DeclareDocumentCommand\footnote {o+m}
   {
     \fnote_step_fnmark:nn {#1} \@mpfn
     \cs_set_eq:NN \@@_footnotemark_finish: \prg_do_nothing:

Added: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-graphic.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-graphic.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-graphic.dtx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,1073 @@
+% \iffalse meta-comment
+%
+%% File: latex-lab-graphic.dtx (C) Copyright 2022-2023 LaTeX Project
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version.  The latest version
+% of this license is in the file
+%
+%    https://www.latex-project.org/lppl.txt
+%
+%
+% The development version of the bundle can be found below
+%
+%    https://github.com/latex3/latex2e/required/latex-lab
+%
+% for those people who are interested or want to report an issue.
+%
+%<*driver>
+\documentclass{l3doc}
+\EnableCrossrefs
+\CodelineIndex
+\begin{document}
+  \DocInput{latex-lab-graphic.dtx}
+\end{document}
+%</driver>
+%
+% \fi
+%
+%
+% \title{The \textsf{latex-lab-graphic} package\\
+% Tagging of included graphics }
+% \author{\LaTeX{} Project\thanks{Initial implementation done by Ulrike Fischer}}
+% \date{v0.8 2023-04-07}
+%
+% \maketitle
+%
+% \newcommand{\xt}[1]{\textsl{\textsf{#1}}}
+% \newcommand{\TODO}[1]{\textbf{[TODO:} #1\textbf{]}}
+% \newcommand{\docclass}{document class \marginpar{\raggedright document class
+% customizations}}
+%
+% \providecommand\hook[1]{\texttt{#1}}
+% \begin{documentation}
+% \begin{abstract}
+% The following code implements a first draft for the tagging of graphics
+% included with \cs{includegraphics}.
+% \end{abstract}
+% 
+% 
+% \section{Introduction}
+% 
+% The code here handle the tagging of pictures included with \cs{includegraphics}
+% and the picture environment. Pictures drawn with \texttt{l3draw} or \texttt{tikz} 
+% or similar packages aren't handled yet.
+% 
+% Tagging of graphics included with \cs{includegraphics} is at a first glance trivial:
+% They are either only decorations, in which case they should be in a \texttt{artifact} 
+% MC-chunk or (in pdf 2.0) tagged as an \texttt{Artifact} structure, 
+% or they are meaningful and then they should be tagged as a \texttt{Figure}.
+% Such a graphic is a simple box and no other content can interfere so adding the 
+% structure commands shouldn't pose much problems.
+%  
+% But things are actually not so easy. 
+% 
+% At first there are two ways to add a graphic
+% to a structure: similar to text as a marked content item (by surrounding 
+% it with \cs{tagmcbegin} and \cs{tagmcend}) or by referencing the XObject 
+% with an OBJR object (similar to a link annotation). Which method is more sensible 
+% (and if it actually matters) is unknown but should be tested. 
+% Currently the first method is used as the second require changes in the backend files.
+%  
+%  
+% At second---and this is actually a \emph{much} larger problem---a 
+% \texttt{Figure} structure should have an attribute with an \texttt{BBox} entry.
+% The value of a \texttt{BBox} is an array of four numbers that gives the 
+% coordinates of the left, bottom, right, and top edges 
+% of the structure element’s bounding box. That is the rectangle that completely encloses
+% its \emph{visible} content so not necessarly the TeX bounding box: 
+% if \texttt{viewport} or \texttt{trim} is used and the
+% graphic is not clipped, the visible content can be larger. 
+%  
+% Getting the \texttt{BBox} is quite straightforward for a graphic that is 
+% used once as is. But graphics can be trimmed, scaled, reflected, rotated and reused
+% in various ways. This transformations typically involve a mix of \TeX{} commands
+% like shifting a box or changing the bounding box and backend commands like
+% inserting a pdfliteral with a transformation matrix and
+% and not in all cases getting the \texttt{BBox} is possible 
+% without rewriting large parts of the graphics/x packages. Problematic are
+%  \begin{itemize}
+%  \item manipulations through external box commands 
+%  (\cs{rotatebox}, \cs{reflectbox}, \cs{scalebox}). The current implementation
+%  in the graphics/x packages do not pass the transformation matrix in way 
+%  that allows to track the changes for the \texttt{BBox} 
+%  of an included graphic: sometimes
+%  the values are set to late (after the box is already stored), and often the
+%  values are not grouped and can leak out from earlier uses of the commands.
+%  
+%  \item some combination of keys in the optional argument of \cs{includegraphics}.
+%  Examples are \texttt{origin} and multiple calls to \texttt{scale} 
+%  and \texttt{angle}) as they internally call the box commands.
+%  Examples of failing combinations can be found in the test file 
+%  \texttt{graphic-faults}.
+%  
+%  \item graphics that are stored in a box and reused: to get the \texttt{BBox} 
+%  one has to set a label that stores the position with \cs{pdfsavepos}, 
+%  and if a box is reused one gets multiply defined labels. 
+%  One possible solution here is to make
+%  use of the new delayed \cs{pdfliteral}. It allows to change the label names
+%  in the shipout, but this requires careful tracking the box usages 
+%  and so various kernel changes.
+%  \end{itemize}
+%  
+%  
+%  
+%  \section{Restrictions and Todos}
+%  Correct tagging is currently 
+%  implemented only for simple \cs{includegraphics} and the keys
+%  \texttt{viewport}, \texttt{trim}, 
+%  \texttt{scale} and \texttt{angle} (used at most once). 
+%  
+%  Not supported
+%  \begin{itemize}
+%  \item graphics inside \cs{rotatebox}, \cs{reflectbox}, \cs{scalebox}. 
+%  
+%  TODO: A new implementation with \texttt{l3graphics} and \texttt{l3box} is 
+%  probably needed here.
+%  
+%  \item  multiple uses of the \texttt{scale} and \texttt{angle} keys
+%   
+%  \item multiple use of graphics stored in boxes. For such graphics automated tagging
+%  should be probably deactivated when storing the content 
+%  and tagging should be added around the \cs{usebox}. (How to 
+%  proceed when content is saved in boxes needs generally more testing).    
+%  \end{itemize}
+%  
+%  
+%  \section{Additional keys}
+%  The code defines additional keys for \cs{includegraphics}:
+%  
+%  \begin{description}
+%  \item[\texttt{tag}] with the values
+%   \begin{description}
+%    \item[\texttt{artifact}] When used the graphic will be tagged as artifact. This doesn't
+%     require a \texttt{BBox} and so works also in some of the not yet supported cases described
+%     above.
+%   \item[\texttt{false}] When used tagging will be stopped completly. It is then the 
+%   responsability of the surrounding code to add appropriate tagging commands.
+%   \item[\meta{name}] Other values will be used as tag names in the structure. If the tag is not
+%   known as a structure tag you will get an warning from tagpdf. The default name is currently
+%   \texttt{Figure}
+%   \end{description}   
+%  \item[\texttt{actualtext}] This allows to add an /ActualText to the structure. 
+%  This is useful for small graphics that represent single chars or a short word like a 
+%  logo. If \texttt{actualtext} is used, the graphics is not enclosed in \texttt{Figure}
+%  structure but in a \texttt{Span} structure and no \texttt{/BBox} attribute is added.
+%  This in accordance with (the draft of) PDF/UA-2 but violates perhaps PDF/UA-1.
+%  \item[\texttt{correct-BBox}] If the calculated \texttt{/BBox} values are wrong
+%  they can be correct with this key. It expects four dimensions that are added to the 
+%  \texttt{/BBox} values. 
+%  \item[\texttt{debug}] The value \texttt{BBox} will show the calculated  \texttt{/BBox} 
+%  as a half transparent red rectangle. 
+%  \end{description}
+%  
+%  The code also redefines the \texttt{alt} key to actually add its values
+%  as an alternative text. If no \texttt{alt} value is given, a warning is issued 
+%  and the file name of the graphic is used.
+%  
+%    \begin{macrocode}
+%<@@=tag>
+%<*package>
+%    \end{macrocode}
+% \end{documentation}
+% \begin{implementation}
+% \section{Implementation} 
+%    \begin{macrocode}
+\ProvidesExplPackage {latex-lab-testphase-graphic} {2023-04-07} {0.8}
+  {Code related to the tagging of graphics}
+%    \end{macrocode}
+% We load l3opacity for the debug code
+%    \begin{macrocode}
+\RequirePackage{l3opacity}
+%    \end{macrocode}
+%
+%\subsection{Saving the position}
+% We need a replacement for zref-savepos. This uses l3ref which loaded 
+% by the pdfmanagement/tagpdf.
+%
+% TODO: this is perhaps needed in other places too and should be moved to
+% l3ref!!
+%    \begin{macrocode}
+\ref_attribute_gset:nnnn{xpos}{0}{shipout}{\int_use:N\tex_lastxpos:D}
+\ref_attribute_gset:nnnn{ypos}{0}{shipout}{\int_use:N\tex_lastypos:D}
+%    \end{macrocode}
+
+% \begin{macro}{\@@_graphic_savepos:n}
+% this is the command which stores the position. It uses 
+% two savepos in case bidi needs it (see zref-savepos).
+%    \begin{macrocode}
+\cs_new_protected:Npn\@@_graphic_savepos:n #1
+ {
+  \tex_savepos:D 
+  \ref_label:nn{#1}{xpos,ypos,abspage}
+  \tex_savepos:D 
+ }
+\cs_generate_variant:Nn \@@_graphic_savepos:n {e}
+%    \end{macrocode}
+% \end{macro}
+%
+% \subsection{Variables}
+% \begin{variable}{\l_@@_graphic_debug_bool}
+% A boolean for debug code
+%    \begin{macrocode}
+\bool_new:N \l_@@_graphic_debug_bool
+\keys_define:nn { document / metadata }
+  {
+    debug / BBox .code:n = { \bool_set_true:N \l_@@_graphic_debug_bool }
+  }  
+%    \end{macrocode}
+% \end{variable}
+% \begin{variable}{\g_@@_graphic_int}
+% This is used to get unique labels in the savepos code.
+%    \begin{macrocode}
+\int_new:N\g_@@_graphic_int
+%    \end{macrocode}
+% \end{variable}
+
+% \begin{variable}
+% {
+%  \g_@@_graphic_lx_tl,
+%  \g_@@_graphic_ly_tl,
+%  \g_@@_graphic_ux_tl,
+%  \g_@@_graphic_uy_tl,
+%  \l_@@_graphic_bboxcorr_seq
+%  \l_@@_graphic_bboxcorr_bool
+% }
+% This commands will hold the calculated BBox values. Local variables
+% would probably work too, but global variables can be easier retrieved
+% in tests and debugging code ... 
+%    \begin{macrocode}
+\tl_new:N \g_@@_graphic_lx_tl
+\tl_new:N \g_@@_graphic_ly_tl
+\tl_new:N \g_@@_graphic_ux_tl
+\tl_new:N \g_@@_graphic_uy_tl
+\seq_new:N\l_@@_graphic_bboxcorr_seq
+\bool_new:N\l_@@_graphic_bboxcorr_bool
+%    \end{macrocode}
+% \end{variable}
+% \begin{variable}{\l_@@_graphic_currentlabel_tl}
+% This holds the label name of the savepos.
+%    \begin{macrocode}
+\tl_new:N \l_@@_graphic_currentlabel_tl
+%    \end{macrocode}
+% \end{variable}
+
+% \begin{variable}
+%  {
+%   \l_@@_graphic_alt_tl,
+%   \l_@@_graphic_alt_dft_tl,   
+%   \l_@@_graphic_actual_tl,
+%   \l_@@_graphic_struct_tl,
+%   \l_@@_graphic_artifact_bool,
+%   \l_@@_graphic_BBox_bool  
+%  }
+% Variables for the alt text, the actualtext and the structure tag.
+%    \begin{macrocode}
+\tl_new:N \l_@@_graphic_alt_tl
+\tl_new:N \l_@@_graphic_alt_dflt_tl
+\tl_set:Nn \l_@@_graphic_alt_dflt_tl {\Gin at base\Gin at ext}
+\tl_new:N \l_@@_graphic_actual_tl
+\tl_new:N \l_@@_graphic_struct_tl
+\tl_set:Nn\l_@@_graphic_struct_tl {Figure}
+\bool_new:N\l_@@_graphic_artifact_bool
+\bool_new:N\l_@@_graphic_BBox_bool
+\bool_set_true:N\l_@@_graphic_BBox_bool
+%    \end{macrocode}
+% \end{variable}
+
+% \begin{variable}
+%  {
+%    \l_@@_graphic_sin_fp 
+%   ,\l_@@_graphic_cos_fp
+%   ,\l_@@_graphic_scale_fp
+%   ,\l_@@_graphic_lxly_fp
+%   ,\l_@@_graphic_lxuy_fp
+%   ,\l_@@_graphic_uxly_fp
+%   ,\l_@@_graphic_uxuy_fp
+%   ,\l_@@_graphic_ux_fp
+%   ,\l_@@_graphic_ly_fp
+%   ,\l_@@_graphic_lx_fp
+%   ,\l_@@_graphic_uy_fp
+%   ,\l_@@_graphic_trim_ux_fp
+%   ,\l_@@_graphic_trim_ly_fp
+%   ,\l_@@_graphic_trim_lx_fp
+%   ,\l_@@_graphic_trim_uy_fp
+%  }
+% A bunch of fp-variables (we don't use tl-vars, 
+% to avoid to have to take care about minus signs everwhere) 
+%    \begin{macrocode}
+\fp_new:N\l_@@_graphic_sin_fp 
+\fp_new:N\l_@@_graphic_cos_fp
+\fp_new:N\l_@@_graphic_lxly_fp
+\fp_new:N\l_@@_graphic_lxuy_fp
+\fp_new:N\l_@@_graphic_uxly_fp
+\fp_new:N\l_@@_graphic_uxuy_fp
+\fp_new:N\l_@@_graphic_ux_fp
+\fp_new:N\l_@@_graphic_ly_fp
+\fp_new:N\l_@@_graphic_lx_fp
+\fp_new:N\l_@@_graphic_uy_fp
+%    \end{macrocode}
+% this holds the scale value. Currently this only the one from
+% \cs{Gin at scalex} 
+%    \begin{macrocode}
+\fp_new:N\l_@@_graphic_scale_fp
+%    \end{macrocode}
+% the follow variables hold the four trim values (or the equivalent calculated 
+% values if viewport is used.
+%    \begin{macrocode}
+\fp_new:N\l_@@_graphic_trim_ux_fp
+\fp_new:N\l_@@_graphic_trim_ly_fp
+\fp_new:N\l_@@_graphic_trim_lx_fp
+\fp_new:N\l_@@_graphic_trim_uy_fp
+%    \end{macrocode}
+% \end{variable}
+% 
+%\subsection{Tagging commands}
+%
+% \begin{macro}{\Gin at tag@struct at begin}
+% The command to start the tagging. 
+%    \begin{macrocode}
+\msg_new:nnn {tag}{alt-text-missing}
+  {
+    Alternative~text~for~graphic~is~missing.\\
+    Using~'#1'~instead
+  }
+\cs_new_protected:Npn\Gin at tag@struct at begin
+ {
+   \tag_if_active:T
+    {
+      \tag_mc_end_push: 
+%    \end{macrocode}
+% we don't open a structure for artifacts to make it easier to use
+% graphics in saveboxes. 
+%    \begin{macrocode}
+      \bool_if:NTF\l_@@_graphic_artifact_bool
+       {
+         \tag_mc_begin:n{artifact}
+       }
+       {
+         \tl_if_empty:NTF\l_@@_graphic_actual_tl
+           {
+             \tl_if_empty:NT\l_@@_graphic_alt_tl         
+               {
+                 \msg_warning:nnx{tag}{alt-text-missing}{\l_@@_graphic_alt_dflt_tl}
+                 \tl_set:Nx\l_@@_graphic_alt_tl {\l_@@_graphic_alt_dflt_tl}
+               }
+             \tag_struct_begin:n
+               {
+                tag=\l_@@_graphic_struct_tl,
+                alt=\l_@@_graphic_alt_tl,
+               }
+           }
+           {
+             \tag_struct_begin:n
+               {
+                 tag=Span,
+                 actualtext=\l_@@_graphic_actual_tl,
+               }
+             \bool_set_false:N\l_@@_graphic_BBox_bool
+           }  
+        \tag_mc_begin:n{}
+       }  
+    }   
+ }
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\Gin at tag@struct at end}
+%    \begin{macrocode}
+\cs_new_protected:Npn\Gin at tag@struct at end
+ {
+   \tag_if_active:T
+    {
+     \tag_mc_end:
+     \bool_if:NF\l_@@_graphic_artifact_bool
+      {
+        \tag_struct_end:
+      }  
+     \tag_mc_begin_pop:n{}
+    }
+ }  
+%    \end{macrocode}
+% \end{macro}
+%
+% \subsection{Patching graphics commands}
+% All changes are currently done in \cs{Gin at setfile}.
+%    \begin{macrocode}
+\AddToHook{package/graphics/after}
+ {
+  \def\Gin at setfile#1#2#3{%  
+  \ifx\\#2\\\Gread at false\fi
+  \ifGin at bbox\else
+    \ifGread@
+      \csname Gread@%
+         \expandafter\ifx\csname Gread@#1\endcsname\relax
+           eps%
+         \else
+           #1%
+         \fi
+      \endcsname{\Gin at base#2}%
+    \else
+      \Gin at nosize{#3}%
+    \fi
+  \fi
+  \Gin at viewport@code
+  \Gin at nat@height\Gin at ury bp%
+  \advance\Gin at nat@height-\Gin at lly bp%
+  \Gin at nat@width\Gin at urx bp%
+  \advance\Gin at nat@width-\Gin at llx bp%
+  \Gin at req@sizes
+  \expandafter\ifx\csname Ginclude@#1\endcsname\relax
+    \Gin at drafttrue
+    \expandafter\ifx\csname Gread@#1\endcsname\relax
+      \@latex at error{Can not include graphics of type: #1}\@ehc
+      \global\expandafter\let\csname Gread@#1\endcsname\@empty
+    \fi
+  \fi
+  \leavevmode
+%    \end{macrocode}
+% Here the tagging begins. We want to catch also the draft box, 
+% and for luatex tagging must be started before the \cs{setbox}.
+%    \begin{macrocode}
+  \Gin at tag@struct at begin %NEW
+  \ifGin at draft
+      \hb at xt@\Gin at req@width{%
+        \vrule\hss
+        \vbox to \Gin at req@height{%
+           \hrule \@width \Gin at req@width
+           \vss
+           \edef\@tempa{#3}%
+           \rlap{ \ttfamily\expandafter\strip at prefix\meaning\@tempa}%
+           \vss
+           \hrule}%
+        \hss\vrule}%
+  \else
+    \@addtofilelist{#3}%
+    \ProvidesFile{#3}[Graphic file (type #1)]%
+    \setbox\z@\hbox{\csname Ginclude@#1\endcsname{#3}}%
+    \dp\z@\z@
+    \ht\z@\Gin at req@height
+    \wd\z@\Gin at req@width
+%    \end{macrocode}
+% This the main command to calculate the BBox values.
+%    \begin{macrocode}
+  \Gin at tag@bbox at attribute %new
+  \box\z@
+%    \end{macrocode}
+% and here the tagging stops.
+%    \begin{macrocode}
+  \Gin at tag@struct at end %new
+  \fi}
+ }  
+%    \end{macrocode}
+%
+% \subsection{Additional keys for the graphics command}
+% TODO: this is a bit temporary and will perhaps need more refinement.
+% we also ensure that graphicx is loaded for the keyval support.
+%    \begin{macrocode}
+\AddToHook{package/graphicx/after}[latex-lab]
+  {
+    \define at key{Gin}{alt}       {\tl_set:Nx\l_@@_graphic_alt_tl{\text_purify:n{#1}}}
+    \define at key{Gin}{artifact}[]
+      {
+        \bool_set_true:N \l_@@_graphic_artifact_bool
+        \bool_set_false:N \l_@@_graphic_BBox_bool
+      }
+    \define at key{Gin}{actualtext}
+     {
+       \tl_set:Nx\l_@@_graphic_actual_tl{\text_purify:n{#1}}
+       \bool_set_false:N \l_@@_graphic_BBox_bool
+     }
+    \define at key{Gin}{correct-BBox}
+      {
+        \bool_set_true:N \l_@@_graphic_bboxcorr_bool
+        \seq_set_split:Nnn\l_@@_graphic_bboxcorr_seq{~}{#1~0pt~0pt~0pt~0pt}
+      }
+    \define at key{Gin}{tag}
+      {
+        \str_case:nnF {#1}
+          {
+            {artifact}
+            {
+               \bool_set_true:N \l_@@_graphic_artifact_bool
+               \bool_set_false:N \l_@@_graphic_BBox_bool
+            }
+            {false}{\tag_stop:}
+          }
+          {\tl_set:Nn\l_@@_graphic_struct_tl{#1}}
+      }  
+  }
+\AddToHook{package/graphics/after}[latex-lab]
+  {\RequirePackage{graphicx}}  
+%    \end{macrocode}
+% For picture and other environments we need a similar set of keys.
+% TODO: redefine \cs{includegraphics} to make use of these here??
+%    \begin{macrocode}
+\keys_define:nn{tag/picture}
+   {
+     ,alt .code:n =  
+        {\tl_set:Nx\l_@@_graphic_alt_tl{\text_purify:n{#1}}}
+     ,artifact .code:n = 
+        {
+          \bool_set_true:N \l_@@_graphic_artifact_bool
+          \bool_set_false:N \l_@@_graphic_BBox_bool
+        }
+     ,actualtext .code:n = 
+        {
+          \tl_set:Nx\l_@@_graphic_actual_tl{\text_purify:n{#1}}
+          \bool_set_false:N \l_@@_graphic_BBox_bool
+        }
+     ,correct-BBox .code:n = 
+      {
+        \bool_set_true:N \l_@@_graphic_bboxcorr_bool
+        \seq_set_split:Nnn\l_@@_graphic_bboxcorr_seq{~}{#1~0pt~0pt~0pt~0pt}
+      }
+    ,tag .code:n = 
+      {
+        \str_case:nnF {#1}
+          {
+            {artifact}
+            {
+               \bool_set_true:N \l_@@_graphic_artifact_bool
+               \bool_set_false:N \l_@@_graphic_BBox_bool
+            }
+            {false}{\tag_stop:}
+          }
+          {\tl_set:Nn\l_@@_graphic_struct_tl{#1}}
+      }     
+   }          
+%    \end{macrocode}
+%
+% \subsection{Calculating the BBox}
+% 
+% \begin{macro}{\@@_graphic_get_trim:}
+% Graphics can be trimmed with the trim and the viewport key.
+% If the graphic is not clipped the values must be taken into
+% account when rotating.
+% If viewport is used we have to calculate the trim.
+% 
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_graphic_get_trim:
+ { 
+   \legacy_if:nTF {Gin at clip} 
+%    \end{macrocode}
+% Setting to 0 is not strictly needed but looks cleaner.
+%    \begin{macrocode}
+    {
+      \fp_zero:N\l_@@_graphic_trim_lx_fp
+      \fp_zero:N\l_@@_graphic_trim_ly_fp
+      \fp_zero:N\l_@@_graphic_trim_ux_fp
+      \fp_zero:N\l_@@_graphic_trim_uy_fp 
+    } 
+    { 
+      \fp_set:Nn \l_@@_graphic_trim_lx_fp {\l_@@_graphic_scale_fp*\Gin at vllx}
+      \fp_set:Nn \l_@@_graphic_trim_ly_fp {\l_@@_graphic_scale_fp*\Gin at vlly}
+      \fp_set:Nn \l_@@_graphic_trim_ux_fp {\l_@@_graphic_scale_fp*\Gin at vurx}
+      \fp_set:Nn \l_@@_graphic_trim_uy_fp {\l_@@_graphic_scale_fp*\Gin at vury}   
+      \cs_if_exist:NT \Gin at ollx
+        {
+         \fp_set:Nn \l_@@_graphic_trim_ux_fp {\l_@@_graphic_scale_fp* (\Gin at ourx-(\Gin at urx)) }     
+         \fp_set:Nn \l_@@_graphic_trim_uy_fp {\l_@@_graphic_scale_fp* (\Gin at oury-(\Gin at ury)) }     
+        }
+    }         
+ }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_graphic_get_scale:}
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_graphic_get_scale: 
+ {
+   \fp_set:Nn \l_@@_graphic_scale_fp { \Gin at scalex }
+ }
+%    \end{macrocode}
+% \end{macro}
+% 
+% \begin{macro}{\@@_graphic_applyangle:nnnn}
+% This takes the current BBox and rotates it according to the use angle.
+% This is the most laborious code, as we have to take also the trim values into 
+% account. We have to compare the values after the rotation to find the right corners
+% for the BBox. Not sure, if this is the most effective code,
+% the l3draw package has similar code to calculate a rotation,
+% this can perhaps be reused ...
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_graphic_applyangle:nnnn #1#2#3#4 %lx,ly,ux,uy
+ {
+   \bool_lazy_and:nnT 
+     {\cs_if_exist_p:N \Grot at angle } 
+     {! \int_compare_p:nNn { \Grot at angle }={0}}
+     { 
+       \fp_set:Nn \l_@@_graphic_sin_fp  { sind(\Grot at angle) }
+       \fp_set:Nn \l_@@_graphic_cos_fp  { cosd(\Grot at angle) }   
+       \fp_set:Nn \l_@@_graphic_lx_fp {#1}    
+       \fp_set:Nn \l_@@_graphic_ly_fp {#2}
+       \fp_set:Nn \l_@@_graphic_ux_fp {#3}
+       \fp_set:Nn \l_@@_graphic_uy_fp {#4}  
+%    \end{macrocode}
+%  get the x coordinates (cos,-sin)
+%    \begin{macrocode}
+       \fp_set:Nn\l_@@_graphic_lxly_fp 
+        { 
+          -\l_@@_graphic_trim_lx_fp *  \l_@@_graphic_cos_fp 
+          +\l_@@_graphic_trim_ly_fp *  \l_@@_graphic_sin_fp 
+        } 
+       \fp_set:Nn\l_@@_graphic_lxuy_fp 
+        { 
+          (-\l_@@_graphic_trim_lx_fp) * \l_@@_graphic_cos_fp 
+          +
+           (\l_@@_graphic_uy_fp-\l_@@_graphic_ly_fp-\l_@@_graphic_trim_ly_fp) 
+            * (-\l_@@_graphic_sin_fp) 
+        } 
+       \fp_set:Nn\l_@@_graphic_uxly_fp 
+        { 
+          (\l_@@_graphic_ux_fp-\l_@@_graphic_lx_fp-\l_@@_graphic_trim_lx_fp) 
+           * \l_@@_graphic_cos_fp 
+          +
+          (\l_@@_graphic_trim_ly_fp) * (\l_@@_graphic_sin_fp) 
+        }  
+       \fp_set:Nn\l_@@_graphic_uxuy_fp 
+        { 
+          (\l_@@_graphic_ux_fp-\l_@@_graphic_lx_fp-\l_@@_graphic_trim_lx_fp) 
+            *  \l_@@_graphic_cos_fp 
+         +
+          (\l_@@_graphic_uy_fp-\l_@@_graphic_ly_fp-\l_@@_graphic_trim_ly_fp) 
+            * (-\l_@@_graphic_sin_fp) 
+        }  
+       \tl_gset:Nx\g_@@_graphic_lx_tl 
+         { 
+          \fp_eval:n
+            {
+              min 
+               ( 
+                 \l_@@_graphic_lxly_fp,
+                 \l_@@_graphic_lxuy_fp, 
+                 \l_@@_graphic_uxly_fp, 
+                 \l_@@_graphic_uxuy_fp, 
+               )
+               +\l_@@_graphic_lx_fp
+               +\l_@@_graphic_trim_lx_fp
+            }
+         }    
+       \tl_gset:Nx\g_@@_graphic_ux_tl 
+         { 
+           \fp_eval:n
+             {
+               max 
+                ( 
+                  \l_@@_graphic_lxly_fp,
+                  \l_@@_graphic_lxuy_fp, 
+                  \l_@@_graphic_uxly_fp, 
+                  \l_@@_graphic_uxuy_fp 
+                )
+                +\l_@@_graphic_lx_fp
+                +\l_@@_graphic_trim_lx_fp                 
+             }
+         }
+%    \end{macrocode}
+% get the y coordinates (sin,cos)
+%    \begin{macrocode}
+       \fp_set:Nn\l_@@_graphic_lxly_fp 
+        { 
+           -\l_@@_graphic_trim_lx_fp *  \l_@@_graphic_sin_fp 
+           -\l_@@_graphic_trim_ly_fp *  \l_@@_graphic_cos_fp  
+        }   
+       \fp_set:Nn\l_@@_graphic_lxuy_fp 
+        { 
+          - \l_@@_graphic_trim_lx_fp *  \l_@@_graphic_sin_fp 
+          +
+          (\l_@@_graphic_uy_fp-\l_@@_graphic_ly_fp-\l_@@_graphic_trim_ly_fp) 
+            * \l_@@_graphic_cos_fp 
+        } 
+       \fp_set:Nn\l_@@_graphic_uxly_fp 
+        { 
+          (\l_@@_graphic_ux_fp-\l_@@_graphic_lx_fp-\l_@@_graphic_trim_lx_fp) 
+            * \l_@@_graphic_sin_fp 
+          - \l_@@_graphic_trim_ly_fp * \l_@@_graphic_cos_fp 
+        }  
+       \fp_set:Nn\l_@@_graphic_uxuy_fp 
+        { 
+          (\l_@@_graphic_ux_fp-\l_@@_graphic_lx_fp-\l_@@_graphic_trim_lx_fp) 
+            * \l_@@_graphic_sin_fp 
+         +
+          (\l_@@_graphic_uy_fp-\l_@@_graphic_ly_fp-\l_@@_graphic_trim_ly_fp) 
+            * \l_@@_graphic_cos_fp 
+        }   
+       \tl_gset:Nx\g_@@_graphic_ly_tl 
+         { 
+          \fp_eval:n
+            {
+              min 
+               ( 
+                 \l_@@_graphic_lxly_fp,
+                 \l_@@_graphic_lxuy_fp, 
+                 \l_@@_graphic_uxly_fp, 
+                 \l_@@_graphic_uxuy_fp 
+               ) 
+              + \l_@@_graphic_ly_fp + \l_@@_graphic_trim_ly_fp 
+            }
+         }        
+       \tl_gset:Nx\g_@@_graphic_uy_tl 
+         { 
+           \fp_eval:n
+             {
+               max 
+                ( 
+                  \l_@@_graphic_lxly_fp,
+                  \l_@@_graphic_lxuy_fp, 
+                  \l_@@_graphic_uxly_fp, 
+                  \l_@@_graphic_uxuy_fp, 
+                ) 
+               + \l_@@_graphic_ly_fp + \l_@@_graphic_trim_ly_fp 
+             }
+         }           
+     }      
+ }  
+\cs_generate_variant:Nn\@@_graphic_applyangle:nnnn {VVVV}
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@@_graphic_applycorr:NNNN}
+% This command is used to add at the end the correction values. Quite dump ...
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_graphic_applycorr:NNNN #1 #2 #3 #4
+ {
+  \bool_if:NT\l_@@_graphic_bboxcorr_bool
+    {
+     \tl_set:Nx #1
+       { 
+         \fp_eval:n 
+          {
+           #1
+           + 
+           \dim_to_decimal_in_bp:n {\seq_item:Nn \l_@@_graphic_bboxcorr_seq {1} } 
+          }
+       }
+     \tl_set:Nx #2
+       { 
+         \fp_eval:n 
+          {
+           #2
+           + 
+           \dim_to_decimal_in_bp:n {\seq_item:Nn \l_@@_graphic_bboxcorr_seq {2} } 
+          }
+       }
+     \tl_set:Nx #3
+       { 
+         \fp_eval:n 
+          {
+           #3
+           + 
+           \dim_to_decimal_in_bp:n {\seq_item:Nn \l_@@_graphic_bboxcorr_seq {3} } 
+          }
+       }
+     \tl_set:Nx #4
+       { 
+         \fp_eval:n 
+          {
+           #4
+           + 
+           \dim_to_decimal_in_bp:n {\seq_item:Nn \l_@@_graphic_bboxcorr_seq {4} } 
+          }
+       } 
+     }  
+  }              
+%    \end{macrocode}
+% \end{macro}
+% 
+% \begin{macro}{\Gin at tag@bbox at attribute}
+% This is the main command to calculate and set the Bbox attribute
+%    \begin{macrocode}
+\cs_new_protected:Npn \Gin at tag@bbox at attribute
+  {  
+%    \end{macrocode}
+% the attribute is only needed if tagging is active and there is not artifact.
+%    \begin{macrocode}
+  \bool_lazy_all:nT
+    {
+      {\tag_if_active_p:}
+      {!\l_@@_graphic_artifact_bool}
+      {\l_@@_graphic_BBox_bool}
+    }
+    {
+      \fp_set:Nn \l_@@_graphic_scale_fp { \Gin at scalex }
+      \@@_graphic_get_trim:
+      \int_gincr:N\g_@@_graphic_int
+      \tl_set:Nx\l_@@_graphic_currentlabel_tl {_@@_graphic_\int_use:N \g_@@_graphic_int}
+      \@@_graphic_savepos:e { \l_@@_graphic_currentlabel_tl }
+      \tl_gset:Nx\g_@@_graphic_lx_tl
+        {
+          \dim_to_decimal_in_bp:n 
+            { \@@_ref_value:enn {\l_@@_graphic_currentlabel_tl}{xpos}{0}sp }
+        }  
+      \tl_gset:Nx\g_@@_graphic_ly_tl
+        {
+          \dim_to_decimal_in_bp:n 
+            { \@@_ref_value:enn {\l_@@_graphic_currentlabel_tl}{ypos}{0}sp }
+        } 
+      \tl_gset:Nx\g_@@_graphic_ux_tl
+          {
+            \fp_eval:n 
+             { 
+               \g_@@_graphic_lx_tl
+               + 
+               \dim_to_decimal_in_bp:n { \Gin at req@width }
+             }  
+          }         
+       \tl_gset:Nx\g_@@_graphic_uy_tl
+          {
+            \fp_eval:n 
+             {
+               \g_@@_graphic_ly_tl
+               + 
+                \dim_to_decimal_in_bp:n  { \Gin at req@height }
+             }  
+          }
+%    \end{macrocode}
+% If the graphics is not clipped we must add the trim values.
+%    \begin{macrocode}     
+      \legacy_if:nF {Gin at clip}          
+        {            
+          \tl_gset:Nx\g_@@_graphic_ux_tl
+            {
+              \fp_eval:n 
+                {
+                  \g_@@_graphic_ux_tl                       
+                  + 
+                  \l_@@_graphic_trim_ux_fp
+                }  
+            }
+          \tl_gset:Nx\g_@@_graphic_lx_tl
+            {
+              \fp_eval:n 
+                {
+                  \g_@@_graphic_lx_tl              
+                   - 
+                  \l_@@_graphic_trim_lx_fp
+                }  
+            }  
+          \tl_gset:Nx\g_@@_graphic_uy_tl
+            {
+              \fp_eval:n 
+                {
+                  \g_@@_graphic_uy_tl           
+                  + 
+                  \l_@@_graphic_trim_uy_fp
+                }  
+            }                                   
+          \tl_gset:Nx\g_@@_graphic_ly_tl
+            {
+              \fp_eval:n 
+                {
+                  \g_@@_graphic_ly_tl              
+                  - 
+                  \l_@@_graphic_trim_ly_fp
+                }  
+            }                                          
+        } 
+%    \end{macrocode}
+% If there is an angle we now rotate the values.
+%    \begin{macrocode}
+      \@@_graphic_applyangle:VVVV 
+        \g_@@_graphic_lx_tl
+        \g_@@_graphic_ly_tl
+        \g_@@_graphic_ux_tl
+        \g_@@_graphic_uy_tl 
+%    \end{macrocode}
+% At last we have to add the correction values
+%    \begin{macrocode}
+      \@@_graphic_applycorr:NNNN
+        \g_@@_graphic_lx_tl
+        \g_@@_graphic_ly_tl
+        \g_@@_graphic_ux_tl
+        \g_@@_graphic_uy_tl 
+%    \end{macrocode}
+%    \begin{macrocode}
+    \bool_if:NT\l_@@_graphic_debug_bool
+     {
+       \@@_graphic_show_bbox:VVVVne
+        \g_@@_graphic_lx_tl
+        \g_@@_graphic_ly_tl
+        \g_@@_graphic_ux_tl
+        \g_@@_graphic_uy_tl
+        {red}
+        {\int_use:N\g_@@_graphic_int}
+     }
+%    \end{macrocode}
+% Now we add the attribute. We do it manually as it had to be delayed until now.
+% The structure and the mc must be open earlier, before the \cs{setbox}  (at least
+% for luatex it has to). TODO: think about interface if more attributes are needed.
+%    \begin{macrocode}
+      \@@_prop_gput:cnx
+         { g_@@_struct_\int_eval:n {\c at g_@@_struct_abs_int}_prop }
+         { A } 
+         {
+           << 
+             /O /Layout /BBox~
+             [
+              \g_@@_graphic_lx_tl\c_space_tl
+              \g_@@_graphic_ly_tl\c_space_tl
+              \g_@@_graphic_ux_tl\c_space_tl
+              \g_@@_graphic_uy_tl
+             ]
+           >>   
+         } 
+    }         
+  } 
+%    \end{macrocode}
+% \end{macro}
+% \subsection{Support for the picture environment}
+% 
+% \begin{macro}{\picture at tag@bbox at attribute}
+% Picture needs a similar command to calculate the bbox. But here we stay simple
+% and use simply the size of the picbox.
+% 
+%    \begin{macrocode}
+\newcommand\picture at tag@bbox at attribute
+ {
+   \bool_lazy_all:nT
+    {
+      {\tag_if_active_p:}
+      {!\l_@@_graphic_artifact_bool}
+      {\l_@@_graphic_BBox_bool}
+    }
+    {
+      \int_gincr:N\g_@@_graphic_int
+      \tl_set:Nx\l_@@_graphic_currentlabel_tl {_@@_graphic_\int_use:N \g_@@_graphic_int}
+      \@@_graphic_savepos:e { \l_@@_graphic_currentlabel_tl }
+      \tl_gset:Nx \g_@@_graphic_lx_tl 
+        { 
+          \dim_to_decimal_in_bp:n 
+          { \@@_ref_value:enn {\l_@@_graphic_currentlabel_tl}{xpos}{0}sp  } 
+        }
+      \tl_gset:Nx \g_@@_graphic_ly_tl 
+        { 
+          \dim_to_decimal_in_bp:n 
+          { \@@_ref_value:enn {\l_@@_graphic_currentlabel_tl}{ypos}{0}sp - \dp\@picbox } 
+        }  
+      \tl_gset:Nx \g_@@_graphic_ux_tl 
+        { 
+          \dim_to_decimal_in_bp:n 
+           {
+             \g_@@_graphic_lx_tl bp + \wd\@picbox        
+           }  
+        }     
+      \tl_gset:Nx \g_@@_graphic_uy_tl 
+        { 
+          \dim_to_decimal_in_bp:n 
+           {
+             \g_@@_graphic_ly_tl bp + \ht\@picbox + \dp\@picbox         
+           }  
+        }     
+      \@@_graphic_applycorr:NNNN
+           \g_@@_graphic_lx_tl
+           \g_@@_graphic_ly_tl
+           \g_@@_graphic_ux_tl
+           \g_@@_graphic_uy_tl        
+      \bool_if:NT\l_@@_graphic_debug_bool
+        {
+          \@@_graphic_show_bbox:VVVVne
+           \g_@@_graphic_lx_tl
+           \g_@@_graphic_ly_tl
+           \g_@@_graphic_ux_tl
+           \g_@@_graphic_uy_tl
+           {red}
+           {\int_use:N\g_@@_graphic_int}
+        }
+      \@@_prop_gput:cnx
+            { g_@@_struct_\int_eval:n {\c at g_@@_struct_abs_int}_prop }
+            { A } 
+            {
+              << 
+                /O /Layout /BBox~
+                [
+                 \g_@@_graphic_lx_tl\c_space_tl
+                 \g_@@_graphic_ly_tl\c_space_tl
+                 \g_@@_graphic_ux_tl\c_space_tl
+                 \g_@@_graphic_uy_tl 
+                ]
+              >>   
+           }     
+     }    
+  }
+ 
+%    \end{macrocode}
+% \end{macro}
+% We redefine \cs{picture} to accept an optional argument and
+% change the default alt text. We also ensure that we are in 
+% hmode, so that stopping tagging doesn't confuse the paratags.
+%    \begin{macrocode}
+\RenewDocumentCommand\picture{O{}m}
+ { 
+   \leavevmode
+   \keys_set:nn{tag/picture}{#1} % 
+   \tl_set:Nn\l_@@_graphic_alt_dflt_tl {picture~environment}
+   \pictur@#2
+ } 
+%    \end{macrocode}
+% inside the picture box we stop tagging. 
+%    \begin{macrocode}
+\def\@picture(#1,#2)(#3,#4){%
+  \@defaultunitsset\@picht{#2}\unitlength
+  \@defaultunitsset\@tempdimc{#1}\unitlength
+  \Gin at tag@struct at begin
+  \setbox\@picbox\hb at xt@\@tempdimc\bgroup
+    \tag_stop: %do not tag inside the picture box
+    \@defaultunitsset\@tempdimc{#3}\unitlength
+    \hskip -\@tempdimc
+    \@defaultunitsset\@tempdimc{#4}\unitlength
+    \lower\@tempdimc\hbox\bgroup
+      \ignorespaces}
+%    \end{macrocode}
+% 
+%    \begin{macrocode}
+\def\endpicture{%
+  \egroup\hss\egroup
+    \ht\@picbox\@picht\dp\@picbox\z@
+    \picture at tag@bbox at attribute    
+    \mbox{\box\@picbox}
+    \Gin at tag@struct at end}
+%    \end{macrocode}
+%
+% \subsection{Debugging code}
+% 
+% \begin{macro}{\@@_graphic_show_bbox:nnnnnn}
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_graphic_show_bbox:nnnnnn #1#2#3#4#5#6%#5 color, #6 graphic
+ {  
+    \iow_log:n {tag/graphic~debug:~BBox~of~graphics~#6~is~#1~#2~#3~#4}  
+    \hook_gput_code:nnn
+     {shipout/foreground}
+     {tag/graphic} 
+     {
+      \int_compare:nNnT 
+       {\g_shipout_readonly_int}
+       =
+       {\@@_ref_value:enn{_@@_graphic_#6}{abspage}{0}}
+       {
+        \put
+         (#1 bp,\dim_eval:n{-\paperheight + \dim_eval:n{#2 bp}})
+         {
+          \opacity_select:n{0.5}\color_select:n{#5}
+          \rule
+           {\dim_eval:n {#3 bp-\dim_eval:n{#1 bp}}}
+           {\dim_eval:n {#4 bp-\dim_eval:n{#2 bp}}}
+         }
+       }           
+     }
+ }
+ \cs_generate_variant:Nn  \@@_graphic_show_bbox:nnnnnn {VVVVne}
+%    \end{macrocode}
+% \end{macro}
+
+%    \begin{macrocode}
+%</package>  
+%    \end{macrocode}
+
+%    \begin{macrocode}
+%<*latex-lab>
+\ProvidesFile{graphic-latex-lab-testphase.ltx}
+        [2023-04-07 v0.8 code related to the tagging included graphics]
+\RequirePackage{latex-lab-testphase-graphic}
+%</latex-lab>
+%    \end{macrocode}
+% \end{implementation}


Property changes on: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-graphic.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-mathtagging.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-mathtagging.dtx	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-mathtagging.dtx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -770,11 +770,14 @@
 %  \typeout{==>~math~begin}
 % needs different handling if we support nesting
   \tl_gset:Nx\tmpmathcontent
-     {\exp_not:N\begin{\g__math_grabbed_env_tl}
+     {
+       LaTeX~ formula~ starts~
+       \exp_not:N\begin{\g__math_grabbed_env_tl}
        \space
        \exp_not:V\g__math_grabbed_math_tl
        \space
        \exp_not:N\end{\g__math_grabbed_env_tl} 
+       \space LaTeX~ formula~ ends~
     }
   \tagstructbegin{tag=Formula,
     AFinline-o=\tmpmathcontent,

Added: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-minipage.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-minipage.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-minipage.dtx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,202 @@
+% \iffalse meta-comment
+%
+%% File: latex-lab-minipage.dtx (C) Copyright 2023 LaTeX Project
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version.  The latest version
+% of this license is in the file
+%
+%    https://www.latex-project.org/lppl.txt
+%
+%
+% The development version of the bundle can be found below
+%
+%    https://github.com/latex3/latex2e/required/latex-lab
+%
+% for those people who are interested or want to report an issue.
+%
+%<*driver>
+\documentclass{l3doc}
+\EnableCrossrefs
+\CodelineIndex
+\begin{document}
+  \DocInput{latex-lab-minipage.dtx}
+\end{document}
+%</driver>
+%
+% \fi
+%
+
+\def\ltlistsversion{v0.81}
+\def\ltlistsdate{2023/05/10}
+
+%
+% \title{The \textsf{latex-lab-minipage} package\\
+% Changes related to the tagging of minipage and parbox}
+% \author{\LaTeX{} Project\thanks{Initial implementation done by Ulrike Fischer}}
+% \date{\ltlistsversion\ \ltlistsdate}
+%
+% \maketitle
+%
+% \newcommand{\xt}[1]{\textsl{\textsf{#1}}}
+% \newcommand{\TODO}[1]{\textbf{[TODO:} #1\textbf{]}}
+% \newcommand{\docclass}{document class \marginpar{\raggedright document class
+% customizations}}
+%
+% \providecommand\hook[1]{\texttt{#1}}
+%
+% \begin{abstract}
+% \end{abstract}
+% 
+% \section{Introduction}
+% 
+%  How to tag minipages and parboxes is still under discussion. 
+%  But as they start and contain paragraphs it is clear that 
+%  hooks are needed to interrupt and restart the tagging. 
+%  
+%  The tagging added is currently quite simple minded. See the todo-testfiles and the
+%  code comments for some open points. 
+%  
+%    \begin{macrocode}
+%<*package>
+%    \end{macrocode}
+%
+% \section{Implementation}
+%    \begin{macrocode}
+\ProvidesExplPackage {latex-lab-testphase-minipage} {2023-05-10} {0.81}
+  {Code related to the tagging of minipages and parboxes}
+%    \end{macrocode}
+%  
+
+% \subsection{Provide the kernel hooks}
+% [kernel?]
+% We need to check/set the status before the
+% initial \cs{leavevmode} to decide how to handle the structure. 
+% Perhaps the same command will work for both?
+%    \begin{macrocode}
+\def\@kernel at init@minipage{}
+\def\@kernel at init@parbox{}
+%    \end{macrocode}
+% We need a few hooks.
+%    \begin{macrocode}
+\def\@kernel at before@minipage{}
+\def\@kernel at after@minipage{}
+\def\@kernel at before@parbox{}
+\def\@kernel at after@parbox{}
+%    \end{macrocode}
+%
+% \subsection{Patch minipage}
+% [kernel?]
+% The begin hook is inserted in \cs{@iiiminipage}
+%    \begin{macrocode}
+\def\@iiiminipage#1#2[#3]#4{%
+%    \end{macrocode}
+% Before switching to hmode we insert a hook. It is currently unused
+% but could for example check if we are in vmode and change the following
+% paragraph tag. 
+%    \begin{macrocode}
+  \@kernel at init@minipage
+  \leavevmode 
+  \@pboxswfalse
+  \setlength\@tempdima{#4}%
+  \def\@mpargs{{#1}{#2}[#3]{#4}}%
+%    \end{macrocode}
+% insert the hook
+%    \begin{macrocode}
+  \@kernel at before@minipage% new
+  \setbox\@tempboxa\vbox\bgroup
+    \color at begingroup
+      \hsize\@tempdima
+      \textwidth\hsize \columnwidth\hsize
+      \@parboxrestore
+      \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c at mpfootnote\z@
+      \let\@footnotetext\@mpfootnotetext
+      \let\@listdepth\@mplistdepth \@mplistdepth\z@
+      \@minipagerestore
+      \@setminipage}
+%    \end{macrocode}
+%  And a hook at the end
+%    \begin{macrocode}
+\def\endminipage{%
+    \par
+    \unskip
+    \ifvoid\@mpfootins\else
+      \vskip\skip\@mpfootins
+      \normalcolor
+      \footnoterule
+      \unvbox\@mpfootins
+    \fi
+    \@minipagefalse   %% added 24 May 89
+  \color at endgroup
+  \egroup
+%    \end{macrocode}
+% as the parbox command is called, we must prevent that it adds its additional
+% tagging commands:
+%    \begin{macrocode}
+  \tag_stop:n{minipage}
+  \expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}%
+  \tag_start:n{minipage}
+  \@kernel at after@minipage%new end ...
+  }
+%    \end{macrocode}
+%
+% And similar for \cs{parbox}
+%    \begin{macrocode}
+\long\def\@iiiparbox#1#2[#3]#4#5{%
+  \@kernel at init@parbox
+  \leavevmode
+  \@pboxswfalse
+  \setlength\@tempdima{#4}%
+  \@kernel at before@parbox% new
+  \@begin at tempboxa\vbox{\hsize\@tempdima\@parboxrestore#5\@@par}%
+    \ifx\relax#2\else
+      \setlength\@tempdimb{#2}%
+      \edef\@parboxto{to\the\@tempdimb}%
+    \fi
+    \if#1b\vbox
+    \else\if #1t\vtop
+    \else\ifmmode\vcenter
+    \else\@pboxswtrue $\vcenter
+    \fi\fi\fi
+    \@parboxto{\let\hss\vss\let\unhbox\unvbox
+       \csname bm@#3\endcsname}%
+    \if at pboxsw \m at th$\fi
+  \@end at tempboxa%
+  \@kernel at after@parbox%new end
+  }
+%    \end{macrocode}
+%
+% \subsection{Tagging commands}
+% 
+%    \begin{macrocode}
+\tl_new:N  \l__ltboxes_tag_tl
+\tl_set:Nn \l__ltboxes_tag_tl {Div}
+\cs_set_protected:Npn\@kernel at before@minipage
+  {
+%    \end{macrocode}
+% As there was a \cs{leavevmode} before that is a P/text open that we have to close.
+%    \begin{macrocode}
+    \tag_mc_end_push:\tag_struct_end:
+%    \end{macrocode}
+% TODO: the P can be further up, we need a proper method to test and handle this. 
+%    \begin{macrocode}   
+    \tag_struct_begin:n{tag=\l__ltboxes_tag_tl}}
+\cs_set_protected:Npn\@kernel at after@minipage
+  {\tag_struct_end:\tag_struct_begin:n{tag=\l__tag_para_tag_tl}\tag_mc_begin_pop:n{}}
+\cs_set_protected:Npn\@kernel at before@parbox
+  {\tag_mc_end_push:\tag_struct_end:\tag_struct_begin:n{tag=\l__ltboxes_tag_tl}}
+\cs_set_protected:Npn\@kernel at after@parbox
+  {\tag_struct_end:\tag_struct_begin:n{tag=\l__tag_para_tag_tl}\tag_mc_begin_pop:n{}}
+%    \end{macrocode}
+%    \begin{macrocode}
+%</package>  
+%    \end{macrocode}
+
+%    \begin{macrocode}
+%<*latex-lab>
+\ProvidesFile{minipage-latex-lab-testphase.ltx}
+        [2022-10-26 v0.8 code related to the tagging of sectioning commands]
+\RequirePackage{latex-lab-testphase-minipage}
+%</latex-lab>
+%    \end{macrocode}


Property changes on: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-minipage.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-new-or-1.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-new-or-1.dtx	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-new-or-1.dtx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-%% File: latex-lab-new-or-1.dtx (C) Copyright 2020-2022 Frank Mittelbach
+%% File: latex-lab-new-or-1.dtx (C) Copyright 2020-2023 Frank Mittelbach
 %
 % It may be distributed and/or modified under the conditions of the
 % LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -128,9 +128,9 @@
 %
 %    \begin{macrocode}
   \patchcmd\page at sofar
-      {\setbox\z@\hbox{p}\global\dimen\tw@\dp\z@}%
+      {\global\dimen\tw@\dp\z@}%
       {%
-        \setbox\z@\hbox{p}\global\dimen\tw@\dp\z@
+        \global\dimen\tw@\dp\z@
         \@mult at ptagging@hook
       }%
       {\typeout{Patching \string\page at sofar\space for tagging}}{\PATCHerror}%

Deleted: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-sec-tagging.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-sec-tagging.dtx	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-sec-tagging.dtx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -1,810 +0,0 @@
-% \iffalse meta-comment
-%
-%% File: sec-tagging.dtx (C) Copyright 2022-2023 LaTeX Project
-%
-% It may be distributed and/or modified under the conditions of the
-% LaTeX Project Public License (LPPL), either version 1.3c of this
-% license or (at your option) any later version.  The latest version
-% of this license is in the file
-%
-%    https://www.latex-project.org/lppl.txt
-%
-%
-% The development version of the bundle can be found below
-%
-%    https://github.com/latex3/latex2e/required/latex-lab
-%
-% for those people who are interested or want to report an issue.
-%
-%<*driver>
-\documentclass{l3doc}
-\EnableCrossrefs
-\CodelineIndex
-\begin{document}
-  \DocInput{latex-lab-sec-tagging.dtx}
-\end{document}
-%</driver>
-%
-% \fi
-%
-%
-% \title{The \textsf{sec-tagging} package\\
-% Changes related to the tagging of sectioning commands}
-% \author{\LaTeX{} Project\thanks{Initial implementation done by Ulrike Fischer}}
-% \date{v0.81 2023-02-12}
-%
-% \maketitle
-%
-% \newcommand{\xt}[1]{\textsl{\textsf{#1}}}
-% \newcommand{\TODO}[1]{\textbf{[TODO:} #1\textbf{]}}
-% \newcommand{\docclass}{document class \marginpar{\raggedright document class
-% customizations}}
-%
-% \providecommand\hook[1]{\texttt{#1}}
-%
-% \begin{abstract}
-% The following code implements a first draft for the tagging of sectioning commands.
-% \end{abstract}
-% 
-% \section{Limitations}
-% 
-% Sectioning commands are in not defined by the format but by the classes. 
-% Their implementation vary: some are defined with the help of \cs{@startsection}, 
-% some are like \cs{chapter} handcrafted, 
-% some build with the help of extension packages or as in the KOMA classes 
-% with class code that extends the \cs{@startsection} functionality.
-% 
-% The following code can therefore currently be used \emph{only} with the standard classes
-% or with classes which do not overwrite the changed definitions.
-% 
-% 
-% 
-% \section{Introduction}
-% 
-%  Tagging of sectioning commands consist of two parts:
-% 
-% \begin{itemize}
-%  \item The heading/title text of the section should be surrounded by a 
-%  heading tag, typically \texttt{Hn} with some value of \texttt{n}.
-%  The number of the section command can optionally be put in a \texttt{Lbl}. 
-%  The number of the \texttt{Hn} tag should reflect the \enquote{natural} level. 
-%  So in an article \cs{section} will use  \texttt{H1}, in a book \cs{chapter} will use
-%  \texttt{H1} and \cs{section} \texttt{H2}. 
-%  Titles of \cs{part} are a bit out of this system as they are normally
-%  not part of the hierarchy: often only some chapters are grouped under a part.
-%  Their title is therefore tagged as \texttt{Title}. 
-%  \item 
-%  The whole section should normally be surrounded by
-%  a \texttt{Sect} tag. Parts should be surrounded by \texttt{Part}. 
-%  It is a bit unclear if the headings should be inside or outside of these 
-%  structures---the best practice guide puts them outside---but on the whole 
-%  it sounds more logical to group the heading with the text inside the \texttt{Sect}.
-%  For the part this is actually required, as there can be only one \texttt{Title}
-%  in a structure, so the part title can't be at the same level as the 
-%  document \texttt{Title}.
-%  
-%  Starting such an enclosing \texttt{Sect} structure is rather easy, 
-%  but closing it requires code in various place, 
-%  for example the commands \cs{mainmatter}, \cs{backmatter}, 
-%  \cs{frontmatter} and \cs{appendix} should typically close everything. 
-%  Following sectioning commands should close all previous structures 
-%  with a level equal or higher than their own level.
-%  \end{itemize}
-%  
-%  \section{Technical details and problems}
-%  
-%  The implementation has to take care of various details.
-%  
-%  \begin{itemize}
-%  
-%  \item As sections in \LaTeX{} are not environments, the 
-%  \texttt{<Sect>} structures can be wrongly nested with other structures. For example
-%  if a document puts a sectioning command into a list or a trivlist or 
-%  a minipage then it can no longer close previous \texttt{<Sect>} structures correctly.
-%  The problem can be detected by checking the structure stack 
-%  and a warning can be issued, but the author then has to close the structures
-%  manually before the list or minipage. 
-%  
-%  Thus there have to be user interfaces to handle such cases.
-%  It should also be possible not to create all the \texttt{<Sect>} structures
-%  automatically but to tag only the headings so that the author can handle special
-%  cases manually. 
-%  
-%  \item If hyperref is used, targets for links should be inserted, either with
-%  \cs{refstepcounter} or manually with \cs{MakeLinkTarget}. These targets must be
-%  in the correct structure for the structure destinations. They replace some
-%  of the current patches in hyperref.
-%  
-%  \item With lualatex the mc-commands set attributes \emph{locally}, so the 
-%  commands must be at the right grouping level.
-%  \end{itemize}
-%  
-%  \subsection{Funktions and keys}
-%
-% \begin{function}{\tag_tool:n,\tagtool}
-% 
-% \end{function}
-%  
-%  \subsection{TODO}
-%  
-%  \begin{itemize}
-%   \item A dedicated command to close a sectioning unit should be provided. 
-%    
-%   \item A dedicated command to open a sectioning unit should be provided too. 
-%   
-%   \item It should also be possible to suppress the sectioning unit in sectioning commands
-%     to allow e.g. to put an epigraph or similar in front.
-%     
-%  \item The number in \cs{part} and  \cs{chapter} is currently not correctly 
-%  tagged as a \texttt{Lbl} as this requires to redefine the internal (class dependant)
-%  commands too.
-%     
-%  \end{itemize}
-%
-%    \begin{macrocode}
-%<*package>
-%    \end{macrocode}
-%
-% \section{Implementation}
-%    \begin{macrocode}
-\ProvidesExplPackage {latex-lab-testphase-sec-tagging} {2022-10-25} {0.8}
-  {Code related to the tagging of sectioning commands}
-%    \end{macrocode}
-%  
-% \subsection{Surrounding by \texttt{Sect} structures} 
-%  We use a stack to record the levels of the open \texttt{Sect}. The first item
-%  has level -100. A sectioning command will take a record from the stack. If its level is
-%  greater or equal it closes this structure and takes the next record from the stack.
-%  If the record has a smaller level then it puts it back and stops.
-%  The stack is compared with the main structure stack, if they don't match 
-%  it means we can't safely close the \texttt{Sect} and so we issue a warning 
-%  and do nothing. 
-%    
-% \subsubsection{Loading general kernel changes}
-% [kernel?]
-%  Also loaded in the toc-tagging code.
-%    \begin{macrocode}
-\RequirePackage{latex-lab-kernel-changes}
-%    \end{macrocode}
-%    \begin{macrocode}
-%</package>
-%    \end{macrocode}
-% \subsubsection{Glyphtounicode improvements}
-% 
-% As lualatex runs with legacy encodings in the test files, we enable and
-% load glyphtounicode. For the math we load additional definitions.
-% 
-%    \begin{macrocode}
-%<*kernelchange>
-\ifdefined\directlua
- \pdfvariable gentounicode =1
- \protected\def\pdfglyphtounicode {\pdfextension glyphtounicode } 
- \input{glyphtounicode}
-\fi
- \input{glyphtounicode-cmex}
-%</kernelchange>
-%    \end{macrocode}
-%
-% \subsubsection{updating \cs{@currentHref}}
-% [kernel?]
-%
-% We  must ensure that manual targets (e.g. in unnumbered sections)
-% correctly update \cs{@currentHref}. For this we extend the kernel definition of
-% \cs{MakeLinkTarget} 
-% 
-%    \begin{macrocode}
-%<*kernelchange>
-\ExplSyntaxOn
-\int_new:N\g__kernel_target_int
-\RenewDocumentCommand\MakeLinkTarget{sO{}m}
- {%
-  \ifvmode
-    \special{}%
-  \else
-    \@savsf\spacefactor
-    \smash{}%
-    \spacefactor\@savsf
-  \fi
-  \int_gincr:N\g__kernel_target_int
-  \tl_gset:Nx \@currentHref {target*.\int_use:N\g__kernel_target_int}
- }
-\ExplSyntaxOff 
-%</kernelchange> 
-%    \end{macrocode}
-%
-%    \begin{macrocode}
-%<*package>
-%    \end{macrocode}
-% \subsubsection{Tagging commands}
-%
-%
-% \begin{variable}{\g__tag_sec_stack_seq}
-% The stack holds the tag and the level.
-%    \begin{macrocode}
-\seq_new:N   \g__tag_sec_stack_seq
-\seq_gpush:Nn\g__tag_sec_stack_seq {{Document}{-100}}
-%    \end{macrocode}
-% \end{variable}
-% 
-% \begin{variable}{\l__tag_sec_Sect_bool}
-% This boolean controls if a Sect structure is opened. 
-%    \begin{macrocode}
-\bool_new:N     \l__tag_sec_Sect_bool
-\bool_set_true:N\l__tag_sec_Sect_bool
-%    \end{macrocode}
-% \end{variable}
- 
-% 
-% \begin{macro}{\__tag_sec_begin:nn}
-% This starts a sectioning structure. 
-% Currently the tag is fix, either Sect or Part, depending on the level,
-% but this will perhaps change. The second argument is currently unused.
-%    \begin{macrocode}
-\cs_new_protected:Npn\__tag_sec_begin:nn #1 #2 %#1 level #2 keyval
-  {
-    \tag_struct_begin:n 
-      {
-         tag= {\int_compare:nNnTF {#1}={-1}{Part}{Sect}}
-        ,#2
-      } 
-    \seq_gpush:Nx \g__tag_sec_stack_seq {{\g__tag_struct_tag_tl}{#1}}    
-  }
-%    \end{macrocode}
-% \end{macro}
-% 
-% \begin{macro}{\__tag_sec_end:n}
-%    \begin{macrocode}
-\msg_new:nnn { tag } {wrong-sect-nesting}
-  {
-    The~structure~#1~can~not~be~closed.\\
-    It~is~not~equal~to~the~current~structure~#2~on~the~main~stack
-  }
-
-\cs_new_protected:Npn\__tag_sec_end:n #1 % #1 level
-  {
-    \seq_get:NN \g__tag_sec_stack_seq \l__tag_tmpa_tl
-    \int_compare:nNnT {#1}<{\exp_last_unbraced:NV\use_ii:nn\l__tag_tmpa_tl+1}
-      {
-        \seq_get:NN\g__tag_struct_tag_stack_seq \l__tag_tmpb_tl
-        \exp_args:Nee
-          \tl_if_eq:nnTF 
-            {\exp_last_unbraced:NV\use_i:nn\l__tag_tmpa_tl}
-            {\exp_last_unbraced:NV\use_i:nn\l__tag_tmpb_tl}
-            {
-              \seq_gpop:NN \g__tag_sec_stack_seq \l__tag_tmpa_tl
-              \tag_struct_end:
-              \__tag_sec_end:n {#1}        
-            }
-            { 
-              \msg_warning:nnxx {tag}{wrong-sect-nesting}
-               { \exp_last_unbraced:NV\use_i:nn \l__tag_tmpa_tl }
-               { \exp_last_unbraced:NV\use_i:nn \l__tag_tmpb_tl } 
-            }
-      }  
-  }  
-%    \end{macrocode}
-% \end{macro}
-
-% \begin{macro}{\__tag_tool_para_split:}
-% Runin-sectioning command must separate the heading from the following text. 
-% 
-%    \begin{macrocode}
-\cs_new_protected:Npn \__tag_tool_para_split:
-  {
-    \tag_mc_end:
-    \tag_struct_end:        
-    \tag_struct_begin:n{tag=\l__tag_para_tag_default_tl}
-    \tag_mc_begin:n{}
-    \__tag_setup_restore_para_default:
-  }
-%    \end{macrocode}
-% \end{macro}
-
-% \begin{macro}{\__tag_setup_restore_para_default:}
-% We change the para tagging in the sectioning code.
-% This here restores the default. Currently it only resets the 
-% the tag, but perhaps more will be needed later. 
-%    \begin{macrocode}
-\cs_new_protected:Npn \__tag_setup_restore_para_default:
-  {
-    \tl_set:Nn \l__tag_para_main_tag_tl {text-unit}
-    \tl_set_eq:NN\l__tag_para_tag_tl\l__tag_para_tag_default_tl
-  }
-%    \end{macrocode}
-% \end{macro}
-% 
-% \begin{macro}{\__tag_sec_end_display:}
-%    \begin{macrocode}
-\cs_new_protected:Npn \__tag_sec_end_display:
-  {
-    \tag_struct_end: %P = Hn
-    \__tag_setup_restore_para_default:
-  }
-%    \end{macrocode}
-% \end{macro}
-%
-% Open sec structures should be closed at the end of the document. This should
-% be done before tagpdf closes the Document structure.
-%    \begin{macrocode}
-\hook_gput_code:nnn{tagpdf/finish/before}{tagpdf/sec}{\__tag_sec_end:n{-10}}
-\hook_gset_rule:nnnn {tagpdf/finish/before}{tagpdf/sec}{before}{tagpdf}  
-%    \end{macrocode}
-%
-% The commands \cs{mainmatter}, \cs{backmatter}, \cs{frontmatter} and
-% \cs{appendix} close all \texttt{Sect} and \texttt{Part} structures.
-%    \begin{macrocode}
-\AddToHook{cmd/frontmatter/before}{\__tag_sec_end:n{-10}}
-\AddToHook{cmd/mainmatter/before} {\__tag_sec_end:n{-10}}
-\AddToHook{cmd/backmatter/before} {\__tag_sec_end:n{-10}}
-\AddToHook{cmd/appendix/before}   {\__tag_sec_end:n{-10}}
-%    \end{macrocode}
-%
-% \subsection{Tagging tools}
-% We need to provide user and package level commands
-% 
-%    \begin{macrocode}
-\cs_if_free:NT \tag_tool:n
- {
-   \cs_new_protected:Npn \tag_tool:n #1
-    {
-      \tag_if_active:T { \keys_set:nn {tag / tool}{#1} }
-    }
-   \cs_set_eq:NN\tagtool\tag_tool:n   
- }   
-\keys_define:nn { tag / tool} 
-  {
-    ,sec-start-part .code:n = 
-      {
-        \bool_if:NT\l__tag_sec_Sect_bool
-          {
-            \__tag_sec_end:n   {-1} 
-            \__tag_sec_begin:nn{-1}{tag=Part}
-          }  
-         \tag_struct_begin:n{tag=part,title=#1}
-%    \end{macrocode}
-% We remap here the text-unit from the paragraph to NonStruct.
-% It would be better to suppress it completly as with the other
-% sectioning commands, but this would require to redefine \cs{@spart}
-% and \cs{@part}, as there is the grouping, and these commands are
-% all slightly different in the standard classes. So this is delayed 
-% to the time when sectioning commands are redefined with templates.
-%    \begin{macrocode}
-         \tl_set:Nn\l__tag_para_main_tag_tl {NonStruct}
-         \tl_set:Nn\l__tag_para_tag_tl {Span}
-      }
-    ,sec-stop-part .code:n = {\__tag_sec_end_display:}
-    ,sec-start-chapter .code:n =
-     {
-       \bool_if:NT\l__tag_sec_Sect_bool
-         {
-           \__tag_sec_end:n   {0} 
-           \__tag_sec_begin:nn{0}{tag=Sect}
-         }  
-        \tag_struct_begin:n{tag=chapter,title=#1}
-%    \end{macrocode}
-% similar to part we remap to NonStruct for now ...
-%    \begin{macrocode}
-        \tl_set:Nn\l__tag_para_main_tag_tl {NonStruct}
-        \tl_set:Nn\l__tag_para_tag_tl {Span}
-     }
-    ,sec-stop-chapter .meta:n = { sec-stop-part}  
-    ,sec-start .code:n = % #1 is a name like "section" 
-      {        
-        \bool_if:NT\l__tag_sec_Sect_bool
-          {       
-            \__tag_sec_end:n    {\use:c{toclevel@#1}+0} 
-            \__tag_sec_begin:nn {\use:c{toclevel@#1}+0}{tag=Sect}
-          }  
-        \tl_set:Nn\l__tag_para_tag_tl{#1}
-      } 
-    ,sec-start .value_required:n = true     
-    ,sec-split-para .code:n = {\__tag_tool_para_split:}
-    ,restore-para .code:n = {\__tag_setup_restore_para_default:}
-    ,sec-stop .code:n = 
-      {
-        \par\__tag_sec_end:n   {\use:c{toclevel@#1}+0}
-      }
-    ,sec-stop .value_required:n = true  
-    ,sec-add-grouping .bool_set:N = \l__tag_sec_Sect_bool
-  } 
-%    \end{macrocode}
-%
-%
-% \section{Sectioning commands}
-% 
-% \subsection{\cs{part} and \cs{chapter}}
-%
-% \cs{part} and \cs{chapter} are defined by the classes. 
-% To tag them we redefine the user commands. 
-% This will probably break with various classes and with titlesec.
-% The tagging inside relies on the para tagging.
-% We do not yet use keyval in the optional argument, as this requires latex-dev
-% and the naming of the keys and their key family is unclear.
-%    \begin{macrocode}
-\AddToHook{class/after}
- {
-  \@ifundefined{chapter}
-    {
-%    \end{macrocode}
-% This redefines \cs{part} in article class.
-%    \begin{macrocode}
-     \RenewDocumentCommand\part{ s O{#3} m }
-      {
-        \if at noskipsec \leavevmode \fi
-        \par
-        \addvspace{4ex}%
-        \@afterindentfalse
-%    \end{macrocode}
-% This are the tagging commands needed at the begin. They open a Part structure
-% and the structure for the title of the heading.
-%    \begin{macrocode}
-        % tagging start commands
-        \tag_tool:n {sec-start-part=#2}
-        % end tagging start commands
-%    \end{macrocode}
-% This adds a  manual target if the part is unnumbered or starred.
-% It replaces the hyperref patches.
-%    \begin{macrocode}
-        \bool_lazy_any:nT  
-          {
-            { #1 } 
-            { 
-              \int_compare_p:nNn {\c at secnumdepth}<{-1} 
-            } 
-          }  
-          {
-            \MakeLinkTarget[part]{}
-          }
-%    \end{macrocode}
-% The main call to the underlying commands. 
-%    \begin{macrocode}
-        \IfBooleanTF 
-          {#1}
-          { \@spart {#3} }
-          { \@part [#2]{#3} }
-%    \end{macrocode}
-% and now the closing command for the tagging of the title.
-%    \begin{macrocode}
-       \tag_tool:n {sec-stop-part} 
-      }    
-    }
-%    \end{macrocode}
-% Redefinitions for book and report
-%    \begin{macrocode}
-    {  
-     \RenewDocumentCommand\chapter{ s O{#3} m }
-      {
-        \if at openright\cleardoublepage\else\clearpage\fi
-        \thispagestyle{plain}%
-        \global\@topnum\z@
-        \@afterindentfalse
-%    \end{macrocode}
-% This are the tagging commands needed at the begin. They open a Sect structure
-% and the structure for the title of the heading.
-%    \begin{macrocode}  
-        \tag_tool:n { sec-start-chapter= #2 }      
-%    \end{macrocode}
-% This adds a  manual target if the chapter is unnumbered or starred.
-% It replaces the hyperref patches.
-%    \begin{macrocode}        
-        \bool_lazy_any:nT  
-          {
-            { #1 } 
-            { 
-              \int_compare_p:nNn {\c at secnumdepth}<{0} 
-            } 
-            {
-              %in book target also needed in frontmatter
-              \bool_lazy_and_p:nn 
-                { \cs_if_exist_p:c { @mainmattertrue } } 
-                { ! \legacy_if_p:n { @mainmatter } }
-            }
-          }  
-          {
-            \MakeLinkTarget[chapter]{}
-            %todo public function for this update!
-            \tl_if_blank:VF \@currentHref
-              {
-                \prop_gput:Nxx \g__tag_struct_dest_num_prop {\@currentHref}{\tag_get:n{struct_num}}
-              }
-          }   
-%    \end{macrocode}
-% The main call to the underlying commands. 
-%    \begin{macrocode}               
-        \IfBooleanTF 
-          {#1}
-          { \@schapter {#3} }
-          { \@chapter [#2]{#3} }
-%    \end{macrocode}
-% and now the closing command for the tagging of the title.
-%    \begin{macrocode}          
-        \tag_tool:n {sec-stop-chapter} 
-      }
-%    \end{macrocode}
-% and similar for \cs{part}
-%    \begin{macrocode}
-     \RenewDocumentCommand\part{ s O{#3} m }
-      {
-        \if at openright
-          \cleardoublepage
-        \else
-          \clearpage
-        \fi
-        \thispagestyle{plain}%
-        \if at twocolumn
-          \onecolumn
-          \@tempswatrue
-        \else
-          \@tempswafalse
-        \fi
-        \null\vfil
-%    \end{macrocode}
-% This are the tagging commands needed at the begin. They open a Part structure
-% and the structure for the title of the heading.
-%    \begin{macrocode}     
-       \tag_tool:n {sec-start-part=#2}   
-%    \end{macrocode}
-% This adds a  manual target if the part is unnumbered or starred.
-% It replaces the hyperref patches.
-%    \begin{macrocode}        
-        \bool_lazy_any:nT  
-          {
-            { #1 } 
-            { 
-              \int_compare_p:nNn {\c at secnumdepth}<{-1} 
-            } 
-            {
-              %in book target also needed in frontmatter
-              \bool_lazy_and_p:nn 
-                { \cs_if_exist_p:c { @mainmattertrue } } 
-                { ! \legacy_if_p:n { @mainmatter } }
-            }
-          }  
-          {
-            \MakeLinkTarget[part]{}
-            \tl_if_blank:VF \@currentHref
-             {
-               \prop_gput:Nxx \g__tag_struct_dest_num_prop {\@currentHref}{\tag_get:n{struct_num}}
-             }
-          }
-%    \end{macrocode}
-% The main call to the underlying commands. 
-%    \begin{macrocode}          
-        \IfBooleanTF 
-          {#1}
-          { \@spart {#3} }
-          { \@part [#2]{#3} }
-%    \end{macrocode}
-% and now the closing command for the tagging of the title.
-%    \begin{macrocode}          
-        \tag_tool:n{sec-stop-part}  
-      }    
-    }
- }        
-%    \end{macrocode}
-%
-% \subsection{Sectioning commands based on \cs{@startsection}}
-% 
-% The tagging of relies again on the para tagging: 
-% we simply exchange the tag name by the one given as \#1.
-% This assumes that a tag with the name of the sectioning type is defined.
-% We don't try to pass the title, this will be done together with 
-% the new keyval handling in the user command.
-% 
-% \subsubsection{Hyperref code}
-% hyperref has to insert anchors. If the sectioning is numbered this is done by 
-% \cs{refstepcounter} (and so in vmode). For unnumbered section hyperref 
-% injects the anchor in hmode before the text, it also inserts a 
-% kern to compensate the indent. 
-% 
-% This means that the target of numbered and unnumbered sectioning commands
-% differ, both regarding the location and in relation to the 
-% tagging structure: The anchor from the \cs{refstepcounter} is outside of
-% the structure created by the heading title if the para tags are used,
-% while the other anchors are inside and so the structure destinations are different.    
-% 
-% We unify this by suppressing the anchor from the refstepcounter.
-% Also we only go back if the indent is positive.
-% 
-% At first suppress all hyperref patches related to sectioning:
-%    \begin{macrocode}
-\def\hyper at nopatch@sectioning{}
-%    \end{macrocode}
-%
-% \begin{macro}{\@hyp at section@target at nnn}
-% A simple internal command. There is no need for something public,
-% as packages defining their own version of \cs{@startsection} will 
-% probably need something slightly different based on \cs{MakeLinkTarget}. 
-%    \begin{macrocode}
-\cs_new_protected:Npn \@hyp at section@target at nnn #1 #2 #3 %#1 optarg #2 name/counter, #3 indent
- {
-   \makebox[0pt][l]
-     { 
-       \skip_set:Nn \@tempskipa {#3}
-       \dim_compare:nNnF {\@tempskipa}<{0pt}{\kern-\@tempskipa}
-       \MakeLinkTarget#1{#2}
-     }
-   \tl_if_blank:VF \@currentHref
-    {
-      \prop_gput:Nxx \g__tag_struct_dest_num_prop {\@currentHref}{\tag_get:n{struct_num}}
-    }  
- }
-%    \end{macrocode}
-% \end{macro}
-% 
-% \subsection{Adaption of the heading commands}
-% We add to \cs{@startsection} the commands to open the \texttt{Sect}
-% structure and to change the para tag.
-%
-%    \begin{macrocode}
-\def\@startsection#1#2#3#4#5#6{%
-  \if at noskipsec \leavevmode \fi
-  \par
-  \@tempskipa #4\relax
-  \@afterindenttrue
-  \ifdim \@tempskipa <\z@
-    \@tempskipa -\@tempskipa \@afterindentfalse
-  \fi
-  \if at nobreak
-    \everypar{}%
-  \else
-    \addpenalty\@secpenalty\addvspace\@tempskipa
-  \fi
-  \tag_tool:n { sec-start=#1}%new
-  \@ifstar
-    {\@ssect{#3}{#4}{#5}{#6}}%
-    {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}  
-%    \end{macrocode}
-% To be able to correctly tag the number we need a special 
-% \cs{@hangfrom} variant. This is a bit tricky:
-% As the paragraph starts after the \cs{setbox} luatex attributes 
-% are not set yet and numbers are unmarked if one doesn't pay attention.
-% The code assumes that we are in vmode!
-%    \begin{macrocode}
-\cs_new_protected:Npn \@kernel at tag@hangfrom #1
-  {
-     \tagstructbegin{tag=\l__tag_para_tag_tl}
-     \tagstructbegin{tag=Lbl}
-     \setbox\@tempboxa
-       \hbox
-         {
-%    \end{macrocode}
-% In lua mode we have to set the attributes inside the box!
-%    \begin{macrocode}
-           \bool_lazy_and:nnT
-            {\tag_if_active_p:}
-            {\g__tag_mode_lua_bool}
-            {\tagmcbegin{tag=Lbl}}
-           {#1}
-         }
-%    \end{macrocode}
-% We stop tagging now, to avoid that the \cs{noindent} triggers
-% the paratagging. We do not disable paratagging completely, to 
-% avoid that the numbering goes wrong.
-%    \begin{macrocode}
-   \tag_stop:n{hangfrom}
-   \hangindent \wd\@tempboxa\noindent
-%    \end{macrocode}
-% Restart tagging and insert the box.
-%    \begin{macrocode}
-   \tag_start:n{hangfrom}
-   \tagmcbegin{}\box\@tempboxa\tagmcend\tagstructend\tagmcbegin{}}
-%    \end{macrocode}
-% This command is used to tag the numbers of runin. We do not try
-% to avoid the empty container from the paratagging, this would require
-% more changes. 
-%    \begin{macrocode}
-\cs_new_protected:Npn \@kernel at tag@svsec
-  {
-    \tag_mc_end_push:      
-    \tag_struct_begin:n{tag=Lbl}    
-    \tag_mc_begin:n{}      
-    \@svsec
-    \tag_mc_end:
-    \tag_struct_end:
-    \tag_mc_begin_pop:n{}
-  }  
-%    \end{macrocode}
-% \cs{@sect} is only changed to replace the hyperref patches
-% and to use the new \cs{@kernel at tag@hangfrom} and \cs{@kernel at tag@svsec}
-%    \begin{macrocode}
-\def\@sect#1#2#3#4#5#6[#7]#8{%  
-  \ifnum #2>\c at secnumdepth
-    \def\@svsec{\@hyp at section@target at nnn{[section]}{}{#3}}
-  \else
-    \LinkTargetOff
-    \refstepcounter{#1}%
-    \LinkTargetOn
-    \protected at edef\@svsec{\@hyp at section@target at nnn{}{#1}{#3}\@seccntformat{#1}\relax}%
-  \fi
-  \@tempskipa #5\relax
-  \ifdim \@tempskipa>\z@
-    \begingroup
-    \tagtool{para-flattened=true} % or \bool_set_true\l__tag_para_flattened_bool
-      #6{%
-         \ifnum #2>\c at secnumdepth
-          \@hangfrom {\hskip #3\relax\@svsec}%
-         \else 
-          \@kernel at tag@hangfrom{\hskip #3\relax\@svsec}%
-         \fi 
-          \interlinepenalty \@M #8\@@par}%
-    \endgroup
-    \csname #1mark\endcsname{#7}%
-    \addcontentsline{toc}{#1}{%
-      \ifnum #2>\c at secnumdepth \else
-        \protect\numberline{\csname the#1\endcsname}%
-      \fi
-      #7}%
-  \else
-    \def\@svsechd{%
-      #6{\hskip #3\relax
-      \ifnum #2>\c at secnumdepth
-       \@svsec
-      \else 
-       \@kernel at tag@svsec
-      \fi  #8}%
-      \csname #1mark\endcsname{#7}%
-      \addcontentsline{toc}{#1}{%
-        \ifnum #2>\c at secnumdepth \else
-          \protect\numberline{\csname the#1\endcsname}%
-        \fi
-        #7}}%
-  \fi
-  \@xsect{#5}}
-%    \end{macrocode}
-% similar for \cs{@ssect}
-%    \begin{macrocode}
-\def\@ssect#1#2#3#4#5{%
-  \@tempskipa #3\relax
-  \ifdim \@tempskipa>\z@
-    \begingroup
-    \tagtool{para-flattened=true}
-      #4{%
-        \@hangfrom{\hskip #1\relax\@hyp at section@target at nnn{[section]}{}{#1}}%
-          \interlinepenalty \@M #5\@@par}%
-    \endgroup
-  \else
-    \def\@svsechd{#4{\hskip #1\relax\@hyp at section@target at nnn{[section]}{}{#3}\relax #5}}%
-  \fi
-  \@xsect{#3}}  
-%    \end{macrocode}
-% At last \cs{@xsect} needs code in two places. For display headings it has to
-% restore the default para code, for run in headings it has to separated the 
-% heading from the following text.
-%    \begin{macrocode}
-\def\@xsect#1{%
-  \@tempskipa #1\relax
-  \ifdim \@tempskipa>\z@
-    \par \nobreak
-    \vskip \@tempskipa
-    \tag_tool:n {restore-para}
-    \@afterheading
-  \else
-    \@nobreakfalse
-    \global\@noskipsectrue
-    \everypar{%
-      \if at noskipsec
-        \global\@noskipsecfalse
-       {\setbox\z@\lastbox}%
-        \clubpenalty\@M
-        \begingroup \@svsechd \endgroup
-        \unskip
-        \tag_tool:n {sec-split-para}
-        \@tempskipa #1\relax
-        \hskip -\@tempskipa
-      \else
-        \clubpenalty \@clubpenalty
-        \everypar{}%
-      \fi}%
-  \fi
-  \ignorespaces}    
-%</package>  
-%    \end{macrocode}
-
-%    \begin{macrocode}
-%<*latex-lab>
-\ProvidesFile{sec-tagging-latex-lab-testphase.ltx}
-        [2023-02-12 v0.81 code related to the tagging of sectioning commands]        
-\RequirePackage{latex-lab-testphase-sec-tagging}
-%</latex-lab>
-%    \end{macrocode}

Added: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-sec.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-sec.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-sec.dtx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,818 @@
+% \iffalse meta-comment
+%
+%% File: latex-lab-sec.dtx (C) Copyright 2022-2023 LaTeX Project
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version.  The latest version
+% of this license is in the file
+%
+%    https://www.latex-project.org/lppl.txt
+%
+%
+% The development version of the bundle can be found below
+%
+%    https://github.com/latex3/latex2e/required/latex-lab
+%
+% for those people who are interested or want to report an issue.
+%
+%<*driver>
+\documentclass{l3doc}
+\EnableCrossrefs
+\CodelineIndex
+\begin{document}
+  \DocInput{latex-lab-sec.dtx}
+\end{document}
+%</driver>
+%
+% \fi
+%
+%
+% \title{The \textsf{latex-lab-sec} package\\
+% Changes related to the tagging of sectioning commands}
+% \author{\LaTeX{} Project\thanks{Initial implementation done by Ulrike Fischer}}
+% \date{v0.82 2023-05-20}
+%
+% \maketitle
+%
+% \newcommand{\xt}[1]{\textsl{\textsf{#1}}}
+% \newcommand{\TODO}[1]{\textbf{[TODO:} #1\textbf{]}}
+% \newcommand{\docclass}{document class \marginpar{\raggedright document class
+% customizations}}
+%
+% \providecommand\hook[1]{\texttt{#1}}
+%
+% \begin{abstract}
+% The following code implements a first draft for the tagging of sectioning commands.
+% \end{abstract}
+% 
+% \section{Limitations}
+% 
+% Sectioning commands are in not defined by the format but by the classes. 
+% Their implementation vary: some are defined with the help of \cs{@startsection}, 
+% some are like \cs{chapter} handcrafted, 
+% some build with the help of extension packages or as in the KOMA classes 
+% with class code that extends the \cs{@startsection} functionality.
+% 
+% The following code can therefore currently be used \emph{only} with the standard classes
+% or with classes which do not overwrite the changed definitions.
+% 
+% 
+% 
+% \section{Introduction}
+% 
+%  Tagging of sectioning commands consist of two parts:
+% 
+% \begin{itemize}
+%  \item The heading/title text of the section should be surrounded by a 
+%  heading tag, typically \texttt{Hn} with some value of \texttt{n}.
+%  The number of the section command can optionally be put in a \texttt{Lbl}. 
+%  The number of the \texttt{Hn} tag should reflect the \enquote{natural} level. 
+%  So in an article \cs{section} will use  \texttt{H1}, in a book \cs{chapter} will use
+%  \texttt{H1} and \cs{section} \texttt{H2}. 
+%  Titles of \cs{part} are a bit out of this system as they are normally
+%  not part of the hierarchy: often only some chapters are grouped under a part.
+%  Their title is therefore tagged as \texttt{Title}. 
+%  \item 
+%  The whole section should normally be surrounded by
+%  a \texttt{Sect} tag. Parts should be surrounded by \texttt{Part}. 
+%  It is a bit unclear if the headings should be inside or outside of these 
+%  structures---the best practice guide puts them outside---but on the whole 
+%  it sounds more logical to group the heading with the text inside the \texttt{Sect}.
+%  For the part this is actually required, as there can be only one \texttt{Title}
+%  in a structure, so the part title can't be at the same level as the 
+%  document \texttt{Title}.
+%  
+%  Starting such an enclosing \texttt{Sect} structure is rather easy, 
+%  but closing it requires code in various place, 
+%  for example the commands \cs{mainmatter}, \cs{backmatter}, 
+%  \cs{frontmatter} and \cs{appendix} should typically close everything. 
+%  Following sectioning commands should close all previous structures 
+%  with a level equal or higher than their own level.
+%  \end{itemize}
+%  
+%  \section{Technical details and problems}
+%  
+%  The implementation has to take care of various details.
+%  
+%  \begin{itemize}
+%  
+%  \item As sections in \LaTeX{} are not environments, the 
+%  \texttt{<Sect>} structures can be wrongly nested with other structures. For example
+%  if a document puts a sectioning command into a list or a trivlist or 
+%  a minipage then it can no longer close previous \texttt{<Sect>} structures correctly.
+%  The problem can be detected by checking the structure stack 
+%  and a warning can be issued, but the author then has to close the structures
+%  manually before the list or minipage. 
+%  
+%  Thus there have to be user interfaces to handle such cases.
+%  It should also be possible not to create all the \texttt{<Sect>} structures
+%  automatically but to tag only the headings so that the author can handle special
+%  cases manually. 
+%  
+%  \item If hyperref is used, targets for links should be inserted, either with
+%  \cs{refstepcounter} or manually with \cs{MakeLinkTarget}. These targets must be
+%  in the correct structure for the structure destinations. They replace some
+%  of the current patches in hyperref.
+%  
+%  \item With lualatex the mc-commands set attributes \emph{locally}, so the 
+%  commands must be at the right grouping level.
+%  \end{itemize}
+%  
+%  \subsection{Funktions and keys}
+%
+% \begin{function}{\tag_tool:n,\tagtool}
+% 
+% \end{function}
+%  
+%  \subsection{TODO}
+%  
+%  \begin{itemize}
+%   \item A dedicated command to close a sectioning unit should be provided. 
+%    
+%   \item A dedicated command to open a sectioning unit should be provided too. 
+%   
+%   \item It should also be possible to suppress the sectioning unit in sectioning commands
+%     to allow e.g. to put an epigraph or similar in front.
+%     
+%  \item The number in \cs{part} and  \cs{chapter} is currently not correctly 
+%  tagged as a \texttt{Lbl} as this requires to redefine the internal (class dependant)
+%  commands too.
+%     
+%  \end{itemize}
+%
+%    \begin{macrocode}
+%<*package>
+%    \end{macrocode}
+%
+% \section{Implementation}
+%    \begin{macrocode}
+\ProvidesExplPackage {latex-lab-testphase-sec} {2023-05-20} {0.81}
+  {Code related to the tagging of sectioning commands}
+%    \end{macrocode}
+%  
+% \subsection{Surrounding by \texttt{Sect} structures} 
+%  We use a stack to record the levels of the open \texttt{Sect}. The first item
+%  has level -100. A sectioning command will take a record from the stack. If its level is
+%  greater or equal it closes this structure and takes the next record from the stack.
+%  If the record has a smaller level then it puts it back and stops.
+%  The stack is compared with the main structure stack, if they don't match 
+%  it means we can't safely close the \texttt{Sect} and so we issue a warning 
+%  and do nothing. 
+%    
+% \subsubsection{Loading general kernel changes}
+% [kernel?]
+%  Also loaded in the toc-tagging code.
+%    \begin{macrocode}
+\RequirePackage{latex-lab-kernel-changes}
+%    \end{macrocode}
+%    \begin{macrocode}
+%</package>
+%    \end{macrocode}
+% \subsubsection{Glyphtounicode improvements}
+% 
+% As lualatex runs with legacy encodings in the test files, we enable and
+% load glyphtounicode. For the math we load additional definitions.
+% 
+%    \begin{macrocode}
+%<*kernelchange>
+\ifdefined\directlua
+ \pdfvariable gentounicode =1
+ \protected\def\pdfglyphtounicode {\pdfextension glyphtounicode } 
+ \input{glyphtounicode}
+\fi
+\ifdefined\pdfglyphtounicode
+ \input{glyphtounicode-cmex}
+\fi 
+%</kernelchange>
+%    \end{macrocode}
+%
+% \subsubsection{updating \cs{@currentHref}}
+% [kernel?]
+%
+% We  must ensure that manual targets (e.g. in unnumbered sections)
+% correctly update \cs{@currentHref}. For this we extend the kernel definition of
+% \cs{MakeLinkTarget} 
+% 
+%    \begin{macrocode}
+%<*kernelchange>
+\ExplSyntaxOn
+\int_new:N\g__kernel_target_int
+\RenewDocumentCommand\MakeLinkTarget{sO{}m}
+ {%
+  \ifvmode
+    \special{}%
+  \else
+    \@savsf\spacefactor
+    \smash{}%
+    \spacefactor\@savsf
+  \fi
+  \IfBooleanTF {#1}
+   {
+     \tl_gset:Nx \@currentHref {#3}
+   }
+   {
+     \int_gincr:N\g__kernel_target_int
+     \tl_gset:Nx \@currentHref {target*.\int_use:N\g__kernel_target_int}
+   }  
+ }
+\ExplSyntaxOff 
+%</kernelchange> 
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%<*package>
+%    \end{macrocode}
+% \subsubsection{Tagging commands}
+%
+%
+% \begin{variable}{\g__tag_sec_stack_seq}
+% The stack holds the tag and the level.
+%    \begin{macrocode}
+\seq_new:N   \g__tag_sec_stack_seq
+\seq_gpush:Nn\g__tag_sec_stack_seq {{Document}{-100}}
+%    \end{macrocode}
+% \end{variable}
+% 
+% \begin{variable}{\l__tag_sec_Sect_bool}
+% This boolean controls if a Sect structure is opened. 
+%    \begin{macrocode}
+\bool_new:N     \l__tag_sec_Sect_bool
+\bool_set_true:N\l__tag_sec_Sect_bool
+%    \end{macrocode}
+% \end{variable}
+ 
+% 
+% \begin{macro}{\__tag_sec_begin:nn}
+% This starts a sectioning structure. 
+% Currently the tag is fix, either Sect or Part, depending on the level,
+% but this will perhaps change. The second argument is currently unused.
+%    \begin{macrocode}
+\cs_new_protected:Npn\__tag_sec_begin:nn #1 #2 %#1 level #2 keyval
+  {
+    \tag_struct_begin:n 
+      {
+         tag= {\int_compare:nNnTF {#1}={-1}{Part}{Sect}}
+        ,#2
+      } 
+    \seq_gpush:Nx \g__tag_sec_stack_seq {{\g__tag_struct_tag_tl}{\int_eval:n{#1}}}    
+  }
+%    \end{macrocode}
+% \end{macro}
+% 
+% \begin{macro}{\__tag_sec_end:n}
+%    \begin{macrocode}
+\msg_new:nnn { tag } {wrong-sect-nesting}
+  {
+    The~structure~#1~can~not~be~closed.\\
+    It~is~not~equal~to~the~current~structure~#2~on~the~main~stack
+  }
+
+\cs_new_protected:Npn\__tag_sec_end:n #1 % #1 level
+  {
+    \seq_get:NN \g__tag_sec_stack_seq \l__tag_tmpa_tl
+    \int_compare:nNnT {#1}<{\exp_last_unbraced:NV\use_ii:nn\l__tag_tmpa_tl+1}
+      {
+        \seq_get:NN\g__tag_struct_tag_stack_seq \l__tag_tmpb_tl
+        \exp_args:Nee
+          \tl_if_eq:nnTF 
+            {\exp_last_unbraced:NV\use_i:nn\l__tag_tmpa_tl}
+            {\exp_last_unbraced:NV\use_i:nn\l__tag_tmpb_tl}
+            {
+              \seq_gpop:NN \g__tag_sec_stack_seq \l__tag_tmpa_tl
+              \tag_struct_end:
+              \__tag_sec_end:n {#1}        
+            }
+            { 
+              \msg_warning:nnxx {tag}{wrong-sect-nesting}
+               { \exp_last_unbraced:NV\use_i:nn \l__tag_tmpa_tl }
+               { \exp_last_unbraced:NV\use_i:nn \l__tag_tmpb_tl } 
+            }
+      }  
+  } 
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\__tag_tool_para_split:}
+% Runin-sectioning command must separate the heading from the following text. 
+% 
+%    \begin{macrocode}
+\cs_new_protected:Npn \__tag_tool_para_split:
+  {
+    \tag_mc_end:
+    \tag_struct_end:        
+    \tag_struct_begin:n{tag=\l__tag_para_tag_default_tl}
+    \tag_mc_begin:n{}
+    \__tag_setup_restore_para_default:
+  }
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\__tag_setup_restore_para_default:}
+% We change the para tagging in the sectioning code.
+% This here restores the default. Currently it only resets the 
+% the tag, but perhaps more will be needed later. 
+%    \begin{macrocode}
+\cs_new_protected:Npn \__tag_setup_restore_para_default:
+  {
+    \tl_set:Nn \l__tag_para_main_tag_tl {text-unit}
+    \tl_set_eq:NN\l__tag_para_tag_tl\l__tag_para_tag_default_tl
+  }
+%    \end{macrocode}
+% \end{macro}
+% 
+% \begin{macro}{\__tag_sec_end_display:}
+%    \begin{macrocode}
+\cs_new_protected:Npn \__tag_sec_end_display:
+  {
+    \tag_struct_end: %P = Hn
+    \__tag_setup_restore_para_default:
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% Open sec structures should be closed at the end of the document. This should
+% be done before tagpdf closes the Document structure.
+%    \begin{macrocode}
+\hook_gput_code:nnn{tagpdf/finish/before}{tagpdf/sec}{\__tag_sec_end:n{-10}}
+\hook_gset_rule:nnnn {tagpdf/finish/before}{tagpdf/sec}{before}{tagpdf}  
+%    \end{macrocode}
+%
+% The commands \cs{mainmatter}, \cs{backmatter}, \cs{frontmatter} and
+% \cs{appendix} close all \texttt{Sect} and \texttt{Part} structures.
+%    \begin{macrocode}
+\AddToHook{cmd/frontmatter/before}{\__tag_sec_end:n{-10}}
+\AddToHook{cmd/mainmatter/before} {\__tag_sec_end:n{-10}}
+\AddToHook{cmd/backmatter/before} {\__tag_sec_end:n{-10}}
+\AddToHook{cmd/appendix/before}   {\__tag_sec_end:n{-10}}
+%    \end{macrocode}
+%
+% \subsection{Tagging tools}
+% We need to provide user and package level commands
+% 
+%    \begin{macrocode}
+\cs_if_free:NT \tag_tool:n
+ {
+   \cs_new_protected:Npn \tag_tool:n #1
+    {
+      \tag_if_active:T { \keys_set:nn {tag / tool}{#1} }
+    }
+   \cs_set_eq:NN\tagtool\tag_tool:n   
+ }   
+\keys_define:nn { tag / tool} 
+  {
+    ,sec-start-part .code:n = 
+      {
+        \bool_if:NT\l__tag_sec_Sect_bool
+          {
+            \__tag_sec_end:n   {-1} 
+            \__tag_sec_begin:nn{-1}{tag=Part}
+          }  
+         \tag_struct_begin:n{tag=part,title=#1}
+%    \end{macrocode}
+% We remap here the text-unit from the paragraph to NonStruct.
+% It would be better to suppress it completly as with the other
+% sectioning commands, but this would require to redefine \cs{@spart}
+% and \cs{@part}, as there is the grouping, and these commands are
+% all slightly different in the standard classes. So this is delayed 
+% to the time when sectioning commands are redefined with templates.
+%    \begin{macrocode}
+         \tl_set:Nn\l__tag_para_main_tag_tl {NonStruct}
+         \tl_set:Nn\l__tag_para_tag_tl {Span}
+      }
+    ,sec-stop-part .code:n = {\__tag_sec_end_display:}
+    ,sec-start-chapter .code:n =
+     {
+       \bool_if:NT\l__tag_sec_Sect_bool
+         {
+           \__tag_sec_end:n   {0} 
+           \__tag_sec_begin:nn{0}{tag=Sect}
+         }  
+        \tag_struct_begin:n{tag=chapter,title=#1}
+%    \end{macrocode}
+% similar to part we remap to NonStruct for now ...
+%    \begin{macrocode}
+        \tl_set:Nn\l__tag_para_main_tag_tl {NonStruct}
+        \tl_set:Nn\l__tag_para_tag_tl {Span}
+     }
+    ,sec-stop-chapter .meta:n = { sec-stop-part}  
+    ,sec-start .code:n = % #1 is a name like "section" 
+      {        
+        \bool_if:NT\l__tag_sec_Sect_bool
+          {       
+            \__tag_sec_end:n    {\cs_if_exist_use:c{toclevel@#1}+0} 
+            \__tag_sec_begin:nn {\cs_if_exist_use:c{toclevel@#1}+0}{tag=Sect}
+          }  
+        \tl_set:Nn\l__tag_para_tag_tl{#1}
+      } 
+    ,sec-start .value_required:n = true     
+    ,sec-split-para .code:n = {\__tag_tool_para_split:}
+    ,restore-para .code:n = {\__tag_setup_restore_para_default:}
+    ,sec-stop .code:n = 
+      {
+        \par\__tag_sec_end:n   {\cs_if_exist_use:c{toclevel@#1}+0}
+      }
+    ,sec-stop .value_required:n = true  
+    ,sec-add-grouping .bool_set:N = \l__tag_sec_Sect_bool
+  } 
+%    \end{macrocode}
+%
+%
+% \section{Sectioning commands}
+% 
+% \subsection{\cs{part} and \cs{chapter}}
+%
+% \cs{part} and \cs{chapter} are defined by the classes. 
+% To tag them we redefine the user commands. 
+% This will probably break with various classes and with titlesec.
+% The tagging inside relies on the para tagging.
+% We do not yet use keyval in the optional argument, as this requires latex-dev
+% and the naming of the keys and their key family is unclear.
+%    \begin{macrocode}
+\AddToHook{class/after}
+ {
+  \@ifundefined{chapter}
+    {
+%    \end{macrocode}
+% This redefines \cs{part} in article class.
+%    \begin{macrocode}
+     \RenewDocumentCommand\part{ s O{#3} m }
+      {
+        \if at noskipsec \leavevmode \fi
+        \par
+        \addvspace{4ex}%
+        \@afterindentfalse
+%    \end{macrocode}
+% This are the tagging commands needed at the begin. They open a Part structure
+% and the structure for the title of the heading.
+%    \begin{macrocode}
+        % tagging start commands
+        \tag_tool:n {sec-start-part=#2}
+        % end tagging start commands
+%    \end{macrocode}
+% This adds a  manual target if the part is unnumbered or starred.
+% It replaces the hyperref patches.
+%    \begin{macrocode}
+        \bool_lazy_any:nT  
+          {
+            { #1 } 
+            { 
+              \int_compare_p:nNn {\c at secnumdepth}<{-1} 
+            } 
+          }  
+          {
+            \MakeLinkTarget[part]{}
+          }
+%    \end{macrocode}
+% The main call to the underlying commands. 
+%    \begin{macrocode}
+        \IfBooleanTF 
+          {#1}
+          { \@spart {#3} }
+          { \@part [#2]{#3} }
+%    \end{macrocode}
+% and now the closing command for the tagging of the title.
+%    \begin{macrocode}
+       \tag_tool:n {sec-stop-part} 
+      }    
+    }
+%    \end{macrocode}
+% Redefinitions for book and report
+%    \begin{macrocode}
+    {  
+     \RenewDocumentCommand\chapter{ s O{#3} m }
+      {
+        \if at openright\cleardoublepage\else\clearpage\fi
+        \thispagestyle{plain}%
+        \global\@topnum\z@
+        \@afterindentfalse
+%    \end{macrocode}
+% This are the tagging commands needed at the begin. They open a Sect structure
+% and the structure for the title of the heading.
+%    \begin{macrocode}  
+        \tag_tool:n { sec-start-chapter= #2 }      
+%    \end{macrocode}
+% This adds a  manual target if the chapter is unnumbered or starred.
+% It replaces the hyperref patches.
+%    \begin{macrocode}        
+        \bool_lazy_any:nT  
+          {
+            { #1 } 
+            { 
+              \int_compare_p:nNn {\c at secnumdepth}<{0} 
+            } 
+            {
+              %in book target also needed in frontmatter
+              \bool_lazy_and_p:nn 
+                { \cs_if_exist_p:c { @mainmattertrue } } 
+                { ! \legacy_if_p:n { @mainmatter } }
+            }
+          }  
+          {
+            \MakeLinkTarget[chapter]{}
+            %todo public function for this update!
+            \tl_if_blank:VF \@currentHref
+              {
+                \prop_gput:Nxx \g__tag_struct_dest_num_prop {\@currentHref}{\tag_get:n{struct_num}}
+              }
+          }   
+%    \end{macrocode}
+% The main call to the underlying commands. 
+%    \begin{macrocode}               
+        \IfBooleanTF 
+          {#1}
+          { \@schapter {#3} }
+          { \@chapter [#2]{#3} }
+%    \end{macrocode}
+% and now the closing command for the tagging of the title.
+%    \begin{macrocode}          
+        \tag_tool:n {sec-stop-chapter} 
+      }
+%    \end{macrocode}
+% and similar for \cs{part}
+%    \begin{macrocode}
+     \RenewDocumentCommand\part{ s O{#3} m }
+      {
+        \if at openright
+          \cleardoublepage
+        \else
+          \clearpage
+        \fi
+        \thispagestyle{plain}%
+        \if at twocolumn
+          \onecolumn
+          \@tempswatrue
+        \else
+          \@tempswafalse
+        \fi
+        \null\vfil
+%    \end{macrocode}
+% This are the tagging commands needed at the begin. They open a Part structure
+% and the structure for the title of the heading.
+%    \begin{macrocode}     
+       \tag_tool:n {sec-start-part=#2}   
+%    \end{macrocode}
+% This adds a  manual target if the part is unnumbered or starred.
+% It replaces the hyperref patches.
+%    \begin{macrocode}        
+        \bool_lazy_any:nT  
+          {
+            { #1 } 
+            { 
+              \int_compare_p:nNn {\c at secnumdepth}<{-1} 
+            } 
+            {
+              %in book target also needed in frontmatter
+              \bool_lazy_and_p:nn 
+                { \cs_if_exist_p:c { @mainmattertrue } } 
+                { ! \legacy_if_p:n { @mainmatter } }
+            }
+          }  
+          {
+            \MakeLinkTarget[part]{}
+            \tl_if_blank:VF \@currentHref
+             {
+               \prop_gput:Nxx \g__tag_struct_dest_num_prop {\@currentHref}{\tag_get:n{struct_num}}
+             }
+          }
+%    \end{macrocode}
+% The main call to the underlying commands. 
+%    \begin{macrocode}          
+        \IfBooleanTF 
+          {#1}
+          { \@spart {#3} }
+          { \@part [#2]{#3} }
+%    \end{macrocode}
+% and now the closing command for the tagging of the title.
+%    \begin{macrocode}          
+        \tag_tool:n{sec-stop-part}  
+      }    
+    }
+ }        
+%    \end{macrocode}
+%
+% \subsection{Sectioning commands based on \cs{@startsection}}
+% 
+% The tagging of relies again on the para tagging: 
+% we simply exchange the tag name by the one given as \#1.
+% This assumes that a tag with the name of the sectioning type is defined.
+% We don't try to pass the title, this will be done together with 
+% the new keyval handling in the user command.
+% 
+% \subsubsection{Hyperref code}
+% hyperref has to insert anchors. If the sectioning is numbered this is done by 
+% \cs{refstepcounter} (and so in vmode). For unnumbered section hyperref 
+% injects the anchor in hmode before the text, it also inserts a 
+% kern to compensate the indent. 
+% 
+% This means that the target of numbered and unnumbered sectioning commands
+% differ, both regarding the location and in relation to the 
+% tagging structure: The anchor from the \cs{refstepcounter} is outside of
+% the structure created by the heading title if the para tags are used,
+% while the other anchors are inside and so the structure destinations are different.    
+% 
+% We unify this by suppressing the anchor from the refstepcounter.
+% Also we only go back if the indent is positive.
+% 
+% At first suppress all hyperref patches related to sectioning:
+%    \begin{macrocode}
+\def\hyper at nopatch@sectioning{}
+%    \end{macrocode}
+%
+% \begin{macro}{\@hyp at section@target at nnn}
+% A simple internal command. There is no need for something public,
+% as packages defining their own version of \cs{@startsection} will 
+% probably need something slightly different based on \cs{MakeLinkTarget}. 
+%    \begin{macrocode}
+\cs_new_protected:Npn \@hyp at section@target at nnn #1 #2 #3 %#1 optarg #2 name/counter, #3 indent
+ {
+   \makebox[0pt][l]
+     { 
+       \skip_set:Nn \@tempskipa {#3}
+       \dim_compare:nNnF {\@tempskipa}<{0pt}{\kern-\@tempskipa}
+       \MakeLinkTarget#1{#2}
+     }
+   \tl_if_blank:VF \@currentHref
+    {
+      \prop_gput:Nxx \g__tag_struct_dest_num_prop {\@currentHref}{\tag_get:n{struct_num}}
+    }  
+ }
+%    \end{macrocode}
+% \end{macro}
+% 
+% \subsection{Adaption of the heading commands}
+% We add to \cs{@startsection} the commands to open the \texttt{Sect}
+% structure and to change the para tag.
+%
+%    \begin{macrocode}
+\def\@startsection#1#2#3#4#5#6{%
+  \if at noskipsec \leavevmode \fi
+  \par
+  \@tempskipa #4\relax
+  \@afterindenttrue
+  \ifdim \@tempskipa <\z@
+    \@tempskipa -\@tempskipa \@afterindentfalse
+  \fi
+  \if at nobreak
+    \everypar{}%
+  \else
+    \addpenalty\@secpenalty\addvspace\@tempskipa
+  \fi
+  \tag_tool:n { sec-start=#1}%new
+  \@ifstar
+    {\@ssect{#3}{#4}{#5}{#6}}%
+    {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}  
+%    \end{macrocode}
+% To be able to correctly tag the number we need a special 
+% \cs{@hangfrom} variant. This is a bit tricky:
+% As the paragraph starts after the \cs{setbox} luatex attributes 
+% are not set yet and numbers are unmarked if one doesn't pay attention.
+% The code assumes that we are in vmode!
+%    \begin{macrocode}
+\cs_new_protected:Npn \@kernel at tag@hangfrom #1
+  {
+     \tagstructbegin{tag=\l__tag_para_tag_tl}
+     \tagstructbegin{tag=Lbl}
+     \setbox\@tempboxa
+       \hbox
+         {
+%    \end{macrocode}
+% In lua mode we have to set the attributes inside the box!
+%    \begin{macrocode}
+           \bool_lazy_and:nnT
+            {\tag_if_active_p:}
+            {\g__tag_mode_lua_bool}
+            {\tagmcbegin{tag=Lbl}}
+           {#1}
+         }
+%    \end{macrocode}
+% We stop tagging now, to avoid that the \cs{noindent} triggers
+% the paratagging. We do not disable paratagging completely, to 
+% avoid that the numbering goes wrong.
+%    \begin{macrocode}
+   \tag_stop:n{hangfrom}
+   \hangindent \wd\@tempboxa\noindent
+%    \end{macrocode}
+% Restart tagging and insert the box.
+%    \begin{macrocode}
+   \tag_start:n{hangfrom}
+   \tagmcbegin{}\box\@tempboxa\tagmcend\tagstructend\tagmcbegin{}}
+%    \end{macrocode}
+% This command is used to tag the numbers of runin. We do not try
+% to avoid the empty container from the paratagging, this would require
+% more changes. 
+%    \begin{macrocode}
+\cs_new_protected:Npn \@kernel at tag@svsec
+  {
+    \tag_mc_end_push:      
+    \tag_struct_begin:n{tag=Lbl}    
+    \tag_mc_begin:n{}      
+    \@svsec
+    \tag_mc_end:
+    \tag_struct_end:
+    \tag_mc_begin_pop:n{}
+  }  
+%    \end{macrocode}
+% \cs{@sect} is only changed to replace the hyperref patches
+% and to use the new \cs{@kernel at tag@hangfrom} and \cs{@kernel at tag@svsec}
+%    \begin{macrocode}
+\def\@sect#1#2#3#4#5#6[#7]#8{%  
+  \ifnum #2>\c at secnumdepth
+    \def\@svsec{\@hyp at section@target at nnn{[section]}{}{#3}}
+  \else
+    \LinkTargetOff
+    \refstepcounter{#1}%
+    \LinkTargetOn
+    \protected at edef\@svsec{\@hyp at section@target at nnn{}{#1}{#3}\@seccntformat{#1}\relax}%
+  \fi
+  \@tempskipa #5\relax
+  \ifdim \@tempskipa>\z@
+    \begingroup
+    \tagtool{para-flattened=true} % or \bool_set_true\l__tag_para_flattened_bool
+      #6{%
+         \ifnum #2>\c at secnumdepth
+          \@hangfrom {\hskip #3\relax\@svsec}%
+         \else 
+          \@kernel at tag@hangfrom{\hskip #3\relax\@svsec}%
+         \fi 
+          \interlinepenalty \@M #8\@@par}%
+    \endgroup
+    \csname #1mark\endcsname{#7}%
+    \addcontentsline{toc}{#1}{%
+      \ifnum #2>\c at secnumdepth \else
+        \protect\numberline{\csname the#1\endcsname}%
+      \fi
+      #7}%
+  \else
+    \def\@svsechd{%
+      #6{\hskip #3\relax
+      \ifnum #2>\c at secnumdepth
+       \@svsec
+      \else 
+       \@kernel at tag@svsec
+      \fi  #8}%
+      \csname #1mark\endcsname{#7}%
+      \addcontentsline{toc}{#1}{%
+        \ifnum #2>\c at secnumdepth \else
+          \protect\numberline{\csname the#1\endcsname}%
+        \fi
+        #7}}%
+  \fi
+  \@xsect{#5}}
+%    \end{macrocode}
+% similar for \cs{@ssect}
+%    \begin{macrocode}
+\def\@ssect#1#2#3#4#5{%
+  \@tempskipa #3\relax
+  \ifdim \@tempskipa>\z@
+    \begingroup
+    \tagtool{para-flattened=true}
+      #4{%
+        \@hangfrom{\hskip #1\relax\@hyp at section@target at nnn{[section]}{}{#1}}%
+          \interlinepenalty \@M #5\@@par}%
+    \endgroup
+  \else
+    \def\@svsechd{#4{\hskip #1\relax\@hyp at section@target at nnn{[section]}{}{#3}\relax #5}}%
+  \fi
+  \@xsect{#3}}  
+%    \end{macrocode}
+% At last \cs{@xsect} needs code in two places. For display headings it has to
+% restore the default para code, for run in headings it has to separated the 
+% heading from the following text.
+%    \begin{macrocode}
+\def\@xsect#1{%
+  \@tempskipa #1\relax
+  \ifdim \@tempskipa>\z@
+    \par \nobreak
+    \vskip \@tempskipa
+    \tag_tool:n {restore-para}
+    \@afterheading
+  \else
+    \@nobreakfalse
+    \global\@noskipsectrue
+    \everypar{%
+      \if at noskipsec
+        \global\@noskipsecfalse
+       {\setbox\z@\lastbox}%
+        \clubpenalty\@M
+        \begingroup \@svsechd \endgroup
+        \unskip
+        \tag_tool:n {sec-split-para}
+        \@tempskipa #1\relax
+        \hskip -\@tempskipa
+      \else
+        \clubpenalty \@clubpenalty
+        \everypar{}%
+      \fi}%
+  \fi
+  \ignorespaces}    
+%</package>  
+%    \end{macrocode}
+
+%    \begin{macrocode}
+%<*latex-lab>
+\ProvidesFile{sec-tagging-latex-lab-testphase.ltx}
+        [2023-05-20 v0.82 code related to the tagging of sectioning commands]        
+\RequirePackage{latex-lab-testphase-sec}
+%</latex-lab>
+%    \end{macrocode}


Property changes on: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-sec.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-testphase.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-testphase.dtx	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-testphase.dtx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -84,8 +84,11 @@
               [2023-03-06 v0.1a  latex-lab wrapper phase-III]
 \input{phase-II-latex-lab-testphase.ltx}
 \RequirePackage{latex-lab-testphase-block-tagging}
-\RequirePackage{latex-lab-testphase-sec-tagging}
-\RequirePackage{latex-lab-testphase-toc-tagging}             
+\RequirePackage{latex-lab-testphase-sec}
+\RequirePackage{latex-lab-testphase-toc}             
+\RequirePackage{latex-lab-testphase-minipage}             
+\RequirePackage{latex-lab-testphase-graphic}             
+\RequirePackage{latex-lab-testphase-float}             
 %</phase-III>
 %    \end{macrocode}
 %

Modified: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-hyperref-changes.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-hyperref-changes.dtx	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-hyperref-changes.dtx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-%% File: toc-hyperref-changes.dtx (C) Copyright 2022-2023 LaTeX Project
+%% File: latex-lab-toc-hyperref-changes.dtx (C) Copyright 2022-2023 LaTeX Project
 %
 % It may be distributed and/or modified under the conditions of the
 % LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -26,10 +26,10 @@
 %</driver>
 %
 % \fi
-% \title{The \textsf{toc-hyperref-changes} package\\
+% \title{The \textsf{latex-lab-toc-hyperref-changes} package\\
 % Changes and additions to hyperref related to toc entries}
 % \author{\LaTeX{} Project\thanks{Initial implementation done by Ulrike Fischer}}
-% \date{Version 0.81 2023-02-10}
+% \date{Version 0.82 2023-05-20}
 %
 % \maketitle
 %

Modified: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-kernel-changes.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-kernel-changes.dtx	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-kernel-changes.dtx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-%% File: toc-kernel-functions.dtx (C) Copyright 2022-2023 LaTeX Project
+%% File: latex-lab-toc-kernel-functions.dtx (C) Copyright 2022-2023 LaTeX Project
 %
 % It may be distributed and/or modified under the conditions of the
 % LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -27,10 +27,10 @@
 %
 % \fi
 %
-% \title{The \textsf{toc-kernel-changes} package\\
+% \title{The \textsf{latex-lab-toc-kernel-changes} package\\
 % Changes and additions to the kernel related to tagging and links in toc entries}
 % \author{\LaTeX{} Project\thanks{Initial implementation done by Ulrike Fischer}}
-% \date{Version 0.81 2023-02-10}
+% \date{Version 0.82 2023-05-20}
 %
 % \maketitle
 %
@@ -132,6 +132,7 @@
 % once that heading stuff is turned into template 
 % instances the template should set that number.
 %    \begin{macrocode}
+\def\toclevel at document{-10}
 \def\toclevel at part{-1}
 \def\toclevel at chapter{0}
 \def\toclevel at section{1}
@@ -435,9 +436,9 @@
 %    \begin{macrocode}
 %<*latex-lab>
 \ProvidesFile{toc-tagging-latex-lab-testphase.ltx}
-        [2022-10-26 v0.8 code related to the tagging of toc and similar lists]
+        [2023-05-20 v0.81 code related to the tagging of toc and similar lists]
 
-\RequirePackage{latex-lab-testphase-toc-tagging}
+\RequirePackage{latex-lab-testphase-toc}
 
 %</latex-lab>
 %    \end{macrocode}

Modified: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-tagging-functions.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-tagging-functions.dtx	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-toc-tagging-functions.dtx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-%% File: toc-tagging-functions.dtx (C) Copyright 2022-2023 LaTeX Project
+%% File: latex-lab-toc-tagging-functions.dtx (C) Copyright 2022-2023 LaTeX Project
 %
 % It may be distributed and/or modified under the conditions of the
 % LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -28,10 +28,10 @@
 % \fi
 %
 %
-% \title{The \textsf{toc-tagging-functions} package\\
+% \title{The \textsf{latex-lab-toc-tagging-functions} package\\
 % Tagpdf functions related to the tagging of toc and similar lists}
 % \author{\LaTeX{} Project\thanks{Initial implementation done by Ulrike Fischer}}
-% \date{Version 0.81 2023-02-10}
+% \date{Version 0.82 2023-05-20}
 %
 % \maketitle
 %
@@ -48,7 +48,7 @@
 % Header for the testphase package
 %    \begin{macrocode}
 %<*header>
-\ProvidesExplPackage {latex-lab-testphase-toc-tagging} {2023-02-10} {0.81}
+\ProvidesExplPackage {latex-lab-testphase-toc} {2023-05-20} {0.82}
   { commands related to the tagging of toc-like lists}
 %</header>  
 %    \end{macrocode}
@@ -356,7 +356,7 @@
 %
 %    \begin{macrocode}
 \def\@dottedtocline at cfgpoint@leaders#1{%
- \tag_mc_begin:n{artifact}\nobreak#1\nobreak\tag_mc_end:}
+ \tag_mc_begin:n{artifact}\tag_stop:n{leaders}\nobreak#1\nobreak\tag_start:n{leaders}\tag_mc_end:}
 %    \end{macrocode}
 
 %

Modified: trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab.ins	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab.ins	2023-05-26 21:07:56 UTC (rev 67224)
@@ -90,11 +90,11 @@
 \generate{\file{latex-lab-mathtools.ltx}{\from{latex-lab-mathtools.dtx}{kernel}}}
 \generate{\file{latex-lab-mathpkg.ltx}{\from{latex-lab-mathpkg.dtx}{kernel}}}
 
-\generate{\file{latex-lab-testphase-sec-tagging.sty}{\from{latex-lab-sec-tagging.dtx}{package}}}
-\generate{\file{sec-tagging-latex-lab-testphase.ltx}{\from{latex-lab-sec-tagging.dtx}{latex-lab}}}
+\generate{\file{latex-lab-testphase-sec.sty}{\from{latex-lab-sec.dtx}{package}}}
+\generate{\file{sec-tagging-latex-lab-testphase.ltx}{\from{latex-lab-sec.dtx}{latex-lab}}}
 
 
-\generate{\file{latex-lab-testphase-toc-tagging.sty}{%
+\generate{\file{latex-lab-testphase-toc.sty}{%
   \from{latex-lab-toc-tagging-functions.dtx}{header}
   \from{latex-lab-toc-kernel-changes.dtx}{package}
   \from{latex-lab-toc-tagging-functions.dtx}{package}
@@ -105,11 +105,37 @@
     
 \generate{\file{latex-lab-kernel-changes.sty}
   {\from{latex-lab-toc-kernel-changes.dtx}{kernelchange}
-   \from{latex-lab-sec-tagging.dtx}{kernelchange}
+   \from{latex-lab-sec.dtx}{kernelchange}
   }}    
 
 
+\generate{\file{latex-lab-testphase-graphic.sty}{%
+  \from{latex-lab-graphic.dtx}{package}}}
+
+\generate{\file{graphic-latex-lab-testphase.ltx}{%
+  \from{latex-lab-graphic.dtx}{latex-lab}}}
+
 \generate{\file{latex-lab-testphase-block-tagging.sty}{\from{latex-lab-block-tagging.dtx}{package}}}
 \generate{\file{block-tagging-latex-lab-testphase.ltx}{\from{latex-lab-block-tagging.dtx}{latex-lab}}}
 
+\generate{\file{latex-lab-testphase-minipage.sty}{%
+  \from{latex-lab-minipage.dtx}{package}}}
+
+\generate{\file{minipage-latex-lab-testphase.ltx}{%
+  \from{latex-lab-minipage.dtx}{latex-lab}}}
+  
+  \generate{\file{latex-lab-testphase-float.sty}{%
+  \from{latex-lab-float.dtx}{package}}}
+
+\generate{\file{float-latex-lab-testphase.ltx}{%
+  \from{latex-lab-float.dtx}{latex-lab}}}
+  
+\generate{\file{latex-lab-testphase-bib.sty}{%
+  \from{latex-lab-bib.dtx}{package}}}
+
+\generate{\file{bib-latex-lab-testphase.ltx}{%
+  \from{latex-lab-bib.dtx}{latex-lab}}}
+
+  
+
 \endbatchfile

Added: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/bib-latex-lab-testphase.ltx
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/bib-latex-lab-testphase.ltx	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/bib-latex-lab-testphase.ltx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,43 @@
+%%
+%% This is file `bib-latex-lab-testphase.ltx',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% latex-lab-bib.dtx  (with options: `latex-lab')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright 2021-2023 LaTeX Project
+%% 
+%% This file was generated from file(s) of the  `LaTeX-lab Bundle'.
+%% ------------------------------------------------------------------------------------
+%% 
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008 or later.
+%% 
+%% This file may only be distributed together with a copy of the LaTeX
+%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle'
+%% without such generated files.
+%% 
+%% The newest sources can be found below
+%% 
+%%    https://github.com/latex3/latex2e/required/latex-lab
+%% 
+%% where one can also log issues in case there are any.
+%% 
+%% 
+%% File: latex-lab-bib.dtx (C) Copyright 2023 LaTeX Project
+\ProvidesFile{bib-latex-lab-testphase.ltx}
+        [2023-05-18 v0.8 code related to the tagging of bib and citations]
+
+\RequirePackage{latex-lab-testphase-bib}
+
+\endinput
+%%
+%% End of file `bib-latex-lab-testphase.ltx'.


Property changes on: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/bib-latex-lab-testphase.ltx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/block-tagging-latex-lab-testphase.ltx
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/block-tagging-latex-lab-testphase.ltx	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/block-tagging-latex-lab-testphase.ltx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -34,8 +34,8 @@
 %% 
 %% File: latex-lab-block-tagging.dtx (C) Copyright 2021-2023 LaTeX Project
 
-\def\ltblocksversion{v0.8a}
-\def\ltblocksdate{2023/03/08}
+\def\ltblocksversion{v0.8c}
+\def\ltblocksdate{2023/05/16}
 
 \ProvidesFile{block-tagging-latex-lab-testphase.ltx}
         [\ltblocksdate\space \ltblocksversion\space

Added: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/float-latex-lab-testphase.ltx
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/float-latex-lab-testphase.ltx	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/float-latex-lab-testphase.ltx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,42 @@
+%%
+%% This is file `float-latex-lab-testphase.ltx',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% latex-lab-float.dtx  (with options: `latex-lab')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright 2021-2023 LaTeX Project
+%% 
+%% This file was generated from file(s) of the  `LaTeX-lab Bundle'.
+%% ------------------------------------------------------------------------------------
+%% 
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008 or later.
+%% 
+%% This file may only be distributed together with a copy of the LaTeX
+%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle'
+%% without such generated files.
+%% 
+%% The newest sources can be found below
+%% 
+%%    https://github.com/latex3/latex2e/required/latex-lab
+%% 
+%% where one can also log issues in case there are any.
+%% 
+%% 
+%% File: latex-lab-float.dtx (C) Copyright 2023 LaTeX Project
+
+\ProvidesFile{float-latex-lab-testphase.ltx}
+        [2023-04-30 v0.8 code related to the tagging of floats]
+\RequirePackage{latex-lab-testphase-float}
+\endinput
+%%
+%% End of file `float-latex-lab-testphase.ltx'.


Property changes on: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/float-latex-lab-testphase.ltx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/graphic-latex-lab-testphase.ltx
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/graphic-latex-lab-testphase.ltx	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/graphic-latex-lab-testphase.ltx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,42 @@
+%%
+%% This is file `graphic-latex-lab-testphase.ltx',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% latex-lab-graphic.dtx  (with options: `latex-lab')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright 2021-2023 LaTeX Project
+%% 
+%% This file was generated from file(s) of the  `LaTeX-lab Bundle'.
+%% ------------------------------------------------------------------------------------
+%% 
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008 or later.
+%% 
+%% This file may only be distributed together with a copy of the LaTeX
+%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle'
+%% without such generated files.
+%% 
+%% The newest sources can be found below
+%% 
+%%    https://github.com/latex3/latex2e/required/latex-lab
+%% 
+%% where one can also log issues in case there are any.
+%% 
+%% 
+%% File: latex-lab-graphic.dtx (C) Copyright 2022-2023 LaTeX Project
+
+\ProvidesFile{graphic-latex-lab-testphase.ltx}
+        [2023-04-07 v0.8 code related to the tagging included graphics]
+\RequirePackage{latex-lab-testphase-graphic}
+\endinput
+%%
+%% End of file `graphic-latex-lab-testphase.ltx'.


Property changes on: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/graphic-latex-lab-testphase.ltx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-footnotes.ltx
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-footnotes.ltx	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-footnotes.ltx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -271,12 +271,12 @@
       }
   }
 
-\DeclareDocumentCommand\footnotetext {om}
+\DeclareDocumentCommand\footnotetext {o+m}
   {
     \fnote_set_fnmark:nn {#1} \@mpfn
     \@footnotetext {#2}
   }
-\DeclareDocumentCommand\footnote {om}
+\DeclareDocumentCommand\footnote {o+m}
   {
     \fnote_step_fnmark:nn {#1} \@mpfn
     \cs_set_eq:NN \__fnote_footnotemark_finish: \prg_do_nothing:

Modified: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-kernel-changes.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-kernel-changes.sty	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-kernel-changes.sty	2023-05-26 21:07:56 UTC (rev 67224)
@@ -5,7 +5,7 @@
 %% The original source files were:
 %%
 %% latex-lab-toc-kernel-changes.dtx  (with options: `kernelchange')
-%% latex-lab-sec-tagging.dtx  (with options: `kernelchange')
+%% latex-lab-sec.dtx  (with options: `kernelchange')
 %% 
 %% This is a generated file.
 %% 
@@ -33,7 +33,7 @@
 %% where one can also log issues in case there are any.
 %% 
 %% 
-%% File: toc-kernel-functions.dtx (C) Copyright 2022-2023 LaTeX Project
+%% File: latex-lab-toc-kernel-functions.dtx (C) Copyright 2022-2023 LaTeX Project
 \def\hyper at nopatch@counter{}
 \def\@definecounter#1{\expandafter\newcount\csname c@#1\endcsname
      \setcounter{#1}\z@
@@ -62,6 +62,7 @@
        {\csname p@#1\expandafter\endcsname\csname the#1\endcsname}%
 }
 \let\@kernel at refstepcounter\refstepcounter
+\def\toclevel at document{-10}
 \def\toclevel at part{-1}
 \def\toclevel at chapter{0}
 \def\toclevel at section{1}
@@ -72,13 +73,15 @@
 \def\toclevel at figure{1}
 \def\toclevel at table{1}
 
-%% File: sec-tagging.dtx (C) Copyright 2022-2023 LaTeX Project
+%% File: latex-lab-sec.dtx (C) Copyright 2022-2023 LaTeX Project
 \ifdefined\directlua
  \pdfvariable gentounicode =1
  \protected\def\pdfglyphtounicode {\pdfextension glyphtounicode }
  \input{glyphtounicode}
 \fi
+\ifdefined\pdfglyphtounicode
  \input{glyphtounicode-cmex}
+\fi
 \ExplSyntaxOn
 \int_new:N\g__kernel_target_int
 \RenewDocumentCommand\MakeLinkTarget{sO{}m}
@@ -90,8 +93,14 @@
     \smash{}%
     \spacefactor\@savsf
   \fi
-  \int_gincr:N\g__kernel_target_int
-  \tl_gset:Nx \@currentHref {target*.\int_use:N\g__kernel_target_int}
+  \IfBooleanTF {#1}
+   {
+     \tl_gset:Nx \@currentHref {#3}
+   }
+   {
+     \int_gincr:N\g__kernel_target_int
+     \tl_gset:Nx \@currentHref {target*.\int_use:N\g__kernel_target_int}
+   }
  }
 \ExplSyntaxOff
 

Modified: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-mathtagging.ltx
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-mathtagging.ltx	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-mathtagging.ltx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -318,11 +318,14 @@
 
 \def\@kernel at math@begin {
   \tl_gset:Nx\tmpmathcontent
-     {\exp_not:N\begin{\g__math_grabbed_env_tl}
+     {
+       LaTeX~ formula~ starts~
+       \exp_not:N\begin{\g__math_grabbed_env_tl}
        \space
        \exp_not:V\g__math_grabbed_math_tl
        \space
        \exp_not:N\end{\g__math_grabbed_env_tl}
+       \space LaTeX~ formula~ ends~
     }
   \tagstructbegin{tag=Formula,
     AFinline-o=\tmpmathcontent,

Added: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-bib.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-bib.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-bib.sty	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,187 @@
+%%
+%% This is file `latex-lab-testphase-bib.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% latex-lab-bib.dtx  (with options: `package')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright 2021-2023 LaTeX Project
+%% 
+%% This file was generated from file(s) of the  `LaTeX-lab Bundle'.
+%% ------------------------------------------------------------------------------------
+%% 
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008 or later.
+%% 
+%% This file may only be distributed together with a copy of the LaTeX
+%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle'
+%% without such generated files.
+%% 
+%% The newest sources can be found below
+%% 
+%%    https://github.com/latex3/latex2e/required/latex-lab
+%% 
+%% where one can also log issues in case there are any.
+%% 
+%% 
+%% File: latex-lab-bib.dtx (C) Copyright 2023 LaTeX Project
+\ProvidesExplPackage {latex-lab-testphase-bib} {2023-05-18} {0.8}
+  {Code related to the tagging of bibliography and cite command}
+\RequirePackage{latex-lab-testphase-block-tagging}
+\def\hyper at nopatch@bib{}
+
+\providecommand*\@extra at binfo{}%
+\providecommand\@extra at b@citeb{}
+\tl_new:N\l__tag_bib_target_tl
+
+\def\@lbibitem[#1]#2{%
+  \tl_set:Nx\l__tag_bib_target_tl{cite.#2\@extra at b@citeb}
+  \AddToHookNext{para/begin}{\makebox[0pt][r]{\MakeLinkTarget*{\l__tag_bib_target_tl}\hspace{\leftmargin}}}
+  \item[\@biblabel{#1}\hfill]\if at filesw
+      {\let\protect\noexpand
+       \immediate
+       \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
+\let\@kernel at copy@lbibitem\@lbibitem
+\def\@bibitem#1{
+  \tl_set:Nx\l__tag_bib_target_tl{cite.#1\@extra at b@citeb}%
+  \AddToHookNext{para/begin}{\makebox[0pt][r]{\MakeLinkTarget*{\l__tag_bib_target_tl}\hspace{\leftmargin}}}
+  \item\if at filesw \immediate\write\@auxout
+       {\string\bibcite{#1}{\the\value{\@listctr}}}\fi\ignorespaces}
+\let\@kernel at copy@bibitem\@bibitem
+\AddToHook{env/thebibliography/begin}
+  {\cs_set:Npn \__block_list_item_begin:
+    { \tagstructbegin{tag=\LItag,label=\l__tag_bib_target_tl}}
+  }
+\NewMirroredHookPairWithArguments{bibcite/before}{bibcite/after}{2}
+\def\bibcite#1#2{%
+   \@newl at bel{b}{#1\@extra at binfo}{%
+      \UseHookWithArguments{bibcite/before}{2}{#1}{#2}
+       #2
+      \UseHookWithArguments{bibcite/after}{2}{#1}{#2}
+       }%
+     }%
+\let\@kernel at copy@bibcite\bibcite
+\AddToHookWithArguments{bibcite/before}
+  {
+    \tag_mc_end_push:
+    \exp_args:Nx\tagstructbegin{tag=Reference,ref=cite.#1\@extra at b@citeb}
+    \tagmcbegin{}
+  }
+\AddToHookWithArguments{bibcite/after}[tag]
+  {
+    \tag_mc_end:
+    \tagstructend
+    \tag_mc_begin_pop:n{}
+  }
+\AddToHook{package/hyperref/after}
+ {
+   \@ifpackagelater{hyperref}{2023-05-01}{}
+    {
+      \@ifpackageloaded{natbib}{}
+       {\let\@lbibitem\@kernel at copy@lbibitem
+        \let\@bibitem\@kernel at copy@bibitem
+        \let\bibcite\@kernel at copy@bibcite}
+    }
+   \AddToHookWithArguments{bibcite/before}{\hyper at linkstart{cite}{cite.#1\@extra at b@citeb}}
+   \AddToHookWithArguments{bibcite/after}{\hyper at linkend}
+ }
+\AddToHook{package/natbib/after}
+  {
+    \def\hyper at natanchorstart#1{\MakeLinkTarget*{#1}}
+    \def\@lbibitem[#1]#2{%
+      \tl_set:Nx\l__tag_bib_target_tl{cite.#2\@extra at b@citeb}
+      \if\relax\@extra at b@citeb\relax\else
+        \@ifundefined{br@#2\@extra at b@citeb}{}{%
+         \@namedef{br@#2}{\@nameuse{br@#2\@extra at b@citeb}}%
+        }%
+      \fi
+      \@ifundefined{b@#2\@extra at b@citeb}{%
+       \def\NAT at num{}%
+      }{%
+       \NAT at parse{#2}%
+      }%
+      \def\NAT at tmp{#1}%
+      \expandafter\let\expandafter\bibitemOpen\csname NAT at b@open@#2\endcsname
+      \expandafter\let\expandafter\bibitemShut\csname NAT at b@shut@#2\endcsname
+      \@ifnum{\NAT at merge>\@ne}{%
+       \NAT at bibitem@first at sw{%
+        \@firstoftwo
+       }{%
+        \@ifundefined{NAT at b*@#2}{%
+         \@firstoftwo
+        }{%
+         \expandafter\def\expandafter\NAT at num\expandafter{\the\c at NAT@ctr}%
+         \@secondoftwo
+        }%
+       }%
+      }{%
+       \@firstoftwo
+      }%
+      {%
+       \global\advance\c at NAT@ctr\@ne
+       \@ifx{\NAT at tmp\@empty}{\@firstoftwo}{%
+        \@secondoftwo
+       }%
+       {%
+        \expandafter\def\expandafter\NAT at num\expandafter{\the\c at NAT@ctr}%
+        \global\NAT at stdbsttrue
+       }{}%
+       \bibitem at fin
+       \item[\hfil\NAT at anchor{#2}{\NAT at num}]%
+       \global\let\NAT at bibitem@first at sw\@secondoftwo
+       \NAT at bibitem@init
+      }%
+      {%
+       \NAT at anchor{#2}{}%
+       \NAT at bibitem@cont
+       \bibitem at fin
+      }%
+      \@ifx{\NAT at tmp\@empty}{%
+        \NAT at wrout{\the\c at NAT@ctr}{}{}{}{#2}%
+      }{%
+        \expandafter\NAT at ifcmd\NAT at tmp(@)(@)\@nil{#2}%
+      }%
+    }%
+    \NewMirroredHookPairWithArguments{natbib/linkstart}{natbib/linkend}{1}
+    \renewcommand\hyper at natlinkstart[1]{\UseHookWithArguments{natbib/linkstart}{1}{#1}}
+    \renewcommand\hyper at natlinkend{\UseHookWithArguments{natbib/linkend}{1}{}}
+    \AddToHookWithArguments{natbib/linkstart}
+      {
+         \leavevmode
+         \tag_mc_end_push:
+         \exp_args:Nx\tagstructbegin{tag=Reference,ref=cite.#1\@extra at b@citeb}
+         \tagmcbegin{}
+      }
+    \AddToHook{natbib/linkend}
+      {
+       \tag_mc_end:
+       \tagstructend
+       \tag_mc_begin_pop:n{}
+      }
+  }
+\AddToHook{package/hyperref/after}
+ {
+    \renewcommand\hyper at natlinkstart[1]{\UseHookWithArguments{natbib/linkstart}{1}{#1}}
+    \renewcommand\hyper at natlinkend{\UseHookWithArguments{natbib/linkend}{1}{}}
+    \AddToHookWithArguments{natbib/linkstart}
+      {
+         \Hy at backout{#1}%
+         \hyper at linkstart{cite}{cite.#1}%
+         \def\hyper at nat@current{#1}
+      }
+    \AddToHook{natbib/linkend}
+      {
+       \hyper at linkend
+      }
+ }
+\endinput
+%%
+%% End of file `latex-lab-testphase-bib.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-bib.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-block-tagging.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-block-tagging.sty	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-block-tagging.sty	2023-05-26 21:07:56 UTC (rev 67224)
@@ -34,8 +34,8 @@
 %% 
 %% File: latex-lab-block-tagging.dtx (C) Copyright 2021-2023 LaTeX Project
 
-\def\ltblocksversion{v0.8a}
-\def\ltblocksdate{2023/03/08}
+\def\ltblocksversion{v0.8c}
+\def\ltblocksdate{2023/05/16}
 
 \ProvidesPackage {latex-lab-testphase-block-tagging}
                  [\ltblocksdate\space \ltblocksversion\space
@@ -198,6 +198,7 @@
 \AddToHook{begindocument/before}{
   \RenewDocumentEnvironment{verbatim}{ !O{} }
     { \UseInstance{blockenv}{verbatim} {#1}
+      \@setupverbinvisiblespace\frenchspacing\@vobeyspaces
       \@xverbatim
     }
     { \endblockenv }
@@ -213,10 +214,10 @@
   \@tempswafalse
   \def\par{%
     \if at tempswa
-      \leavevmode \null \@@par\penalty\interlinepenalty
+      \leavevmode \null {\@@par}\penalty\interlinepenalty
     \else
       \@tempswatrue
-      \ifhmode\@@par\penalty\interlinepenalty\fi
+      \ifhmode{\@@par}\penalty\interlinepenalty\fi
     \fi}%
   \let\do\@makeother \dospecials
   \obeylines \verbatim at font \@noligs
@@ -223,8 +224,6 @@
   \everypar \expandafter{\the\everypar \unpenalty}%
   \tl_set:Nn \l__tag_para_main_tag_tl {codeline}
   \tagtool{paratag=Code}%   oder faster: \tl_set:Nn\l__tag_para_tag_tl{Code}
-  \@setupverbinvisiblespace
-  \frenchspacing \@vobeyspaces
 }
 \newcommand\@setupverbinvisiblespace{}
 \tag_if_active:T {
@@ -283,13 +282,88 @@
                            }
     { \endblockenv }
 }
-\tag_if_active:T {
-  \tagpdfsetup{add-new-tag={tag=theorem-like,role=L}}
+\RenewDocumentCommand \newtheorem { m O{#1} m o }
+{
+  \expandafter\@ifdefinable\csname #1\endcsname
+    {
+      \str_if_eq:nnTF{#1}{#2}
+         {
+           \@definecounter {#2}
+           \IfNoValueTF {#4}
+             {  % @ynthm
+               \tl_gset:cx { the #2 }
+                  {
+                    \@thmcounter{#2}
+                  }
+             }
+             {  % @xnthm
+               \@newctr{#1}[#4]
+               \tl_gset:cx { the #2 }
+                  {
+                    \expandafter\noexpand\csname the#4\endcsname
+                    \@thmcountersep
+                    \@thmcounter{#2}
+                  }
+             }
+         }
+         {  % @othm
+           \@ifundefined{c@#2}
+              { \@nocounterr{#2} }
+              {
+                \tl_gset:cn { the #1 }
+                   { \UseName { the #2 } }
+              }
+         }
+      \global\@namedef{#1}   { \@thm{#2}{#3} }
+      \global\@namedef{end#1}{ \@endtheorem  }
+    }
 }
-\def\@begintheorem#1#2{\trivlist[tag-name=theorem-like]%
-   \item[\hskip \labelsep{\bfseries #1\ #2}]\itshape}
-\def\@opargbegintheorem#1#2#3{\trivlist[tag-name=theorem-like]
-      \item[\hskip \labelsep{\bfseries #1\ #2\ (#3)}]\itshape}
+\def\@begintheorem#1#2{
+  \UseInstance{blockenv}{theorem}{}
+  \tagpdfparaOff
+  \textbf{
+    \tag_struct_begin:n{tag=Caption}
+      \tag_mc_begin:n {}
+        #1\
+      \tag_mc_end:
+      \tag_struct_begin:n{tag=Lbl}
+        \tag_mc_begin:n {}
+          #2
+        \tag_mc_end:
+      \tag_struct_end:
+    \tag_struct_end:
+  }
+  \tagpdfparaOn
+  \__block_start_para_structure_unconditionally:n { \PARALABEL }
+  \itshape
+  \hskip\labelsep
+  \ignorespaces
+}
+\def\@opargbegintheorem#1#2#3{
+  \UseInstance{blockenv}{theorem}{}
+  \tagpdfparaOff
+  \textbf{
+    \tag_struct_begin:n{tag=Caption}
+      \tag_mc_begin:n {}
+        #1\
+      \tag_mc_end:
+      \tag_struct_begin:n{tag=Lbl}
+        \tag_mc_begin:n {}
+          #2
+        \tag_mc_end:
+      \tag_struct_end:
+      \tag_mc_begin:n {}
+        \ (#3)
+      \tag_mc_end:
+    \tag_struct_end:
+  }
+  \tagpdfparaOn
+  \__block_start_para_structure_unconditionally:n { \PARALABEL }
+  \itshape
+  \hskip\labelsep
+  \ignorespaces
+}
+\def\@endtheorem{\endblockenv}
 \cs_new:Npn \g_block_nesting_depth_int { \@listdepth }  % a fake int
                                                         % for now
 \DeclareTemplateCode{blockenv}{display}{1}
@@ -400,11 +474,16 @@
       \addpenalty \@endparpenalty
       \addvspace \l__block_topsepadd_skip
     }
-  \legacy_if_gset_true:n { @endpe }
+    %    \begin{macrocode}
+  \bool_if:NTF \l__block_standalone_bool
+    { \legacy_if_gset_false:n { @endpe } }
+    { \legacy_if_gset_true:n  { @endpe } }
 }
 \cs_new:Npn \__kernel_displayblock_end: {
   \__block_debug_typeout:n{\detokenize{__kernel_displayblock_end:}}
 }
+\bool_new:N       \l__block_standalone_bool
+\bool_set_false:N \l__block_standalone_bool
 \DeclareTemplateCode{para}{std}{1}
 {
   indent-width      = \parindent ,
@@ -746,6 +825,18 @@
   \let \__kernel_displayblock_begin:          \prg_do_nothing:
   \let \__kernel_displayblock_end:            \prg_do_nothing:
 }
+\cs_new:Npn \__block_recipe_standalone: {
+  \cs_set_eq:NN \__kernel_displayblock_beginpar_hmode:w
+                                              \prg_do_nothing:
+  \cs_set_eq:NN \__kernel_displayblock_beginpar_vmode:
+                                              \prg_do_nothing:
+  \cs_set_eq:NN \__kernel_displayblock_begin: \__block_inner_begin:
+  \cs_set_eq:NN \__kernel_displayblock_end:   \__block_inner_end:
+  \bool_set_true:N \l__block_standalone_bool
+  \tl_if_empty:NTF \l__block_tag_name_tl
+     { \tl_set:Nn    \l__block_tag_inner_tag_tl {Sect}            }
+     { \tl_set_eq:NN \l__block_tag_inner_tag_tl \l__block_tag_name_tl }
+}
 \cs_new:Npn \__block_recipe_standard:
 {
   \cs_set_eq:NN \__kernel_displayblock_beginpar_hmode:w
@@ -872,7 +963,22 @@
   block-instance = quoteblock ,
   inner-instance =  ,
 }
+
+\DeclareInstance{blockenv}{theorem}{display}
+{
+  env-name       = theorem-like,
+  tag-name       = theorem-like,
+  tag-class      = ,
+  tagging-recipe = standalone,
+  inner-level-counter  = ,
+  level-increase = false,
+  setup-code     = ,
+  block-instance = displayblock ,
+}
 \tag_if_active:T {
+  \tagpdfsetup{add-new-tag={tag=theorem-like,role=Sect}}
+}
+\tag_if_active:T {
   \tagpdfsetup{add-new-tag={tag=verbatim,role=P}}
   \tagpdfsetup{add-new-tag={tag=codeline,role=Sub}}
 }
@@ -885,7 +991,7 @@
   inner-level-counter  = ,
   level-increase = false,
   setup-code     = ,
-  block-instance = displayblock ,
+  block-instance = verbatimblock ,
   inner-instance = ,
   final-code     = \legacyverbatimsetup ,
 }
@@ -952,6 +1058,18 @@
 \DeclareInstanceCopy{block}{displayblock-4}{displayblock-0}
 \DeclareInstanceCopy{block}{displayblock-5}{displayblock-0}
 \DeclareInstanceCopy{block}{displayblock-6}{displayblock-0}
+\DeclareInstance{block}{verbatimblock-0}{display}
+  {
+    leftmargin      = 0pt ,
+    parindent       = 0pt ,
+    par-skip        = 0pt ,
+  }
+\DeclareInstanceCopy{block}{verbatimblock-1}{verbatimblock-0}
+\DeclareInstanceCopy{block}{verbatimblock-2}{verbatimblock-0}
+\DeclareInstanceCopy{block}{verbatimblock-3}{verbatimblock-0}
+\DeclareInstanceCopy{block}{verbatimblock-4}{verbatimblock-0}
+\DeclareInstanceCopy{block}{verbatimblock-5}{verbatimblock-0}
+\DeclareInstanceCopy{block}{verbatimblock-6}{verbatimblock-0}
 \DeclareInstance{block}{quoteblock-1}{display}
   { rightmargin = \KeyValue{leftmargin} }
 \DeclareInstanceCopy{block}{quoteblock-2}{quoteblock-1}
@@ -1099,7 +1217,7 @@
              \bool_if:NF \l__tag_para_flattened_bool
                {
                  \__block_debug_typeout:n{Structure-end~
-                       \l__tag_para_main_tag_tl\space after~ list \on at line }
+                   \l__tag_para_main_tag_tl\space after~ displayblock \on at line }
                  \int_gincr:N \g__tag_para_main_end_int
                  \tag_struct_end: %text-unit
                }
@@ -1111,29 +1229,48 @@
   \bool_if:NT \l__tag_para_bool {
        \legacy_if:nF { @inlabel }
          {
-           \__block_debug_typeout:n
-              { @endpe = \legacy_if:nTF { @endpe }{true}{false}
-                \on at line }
-           \legacy_if:nF { @endpe }
-             {
-               \bool_if:NF \l__tag_para_flattened_bool
-                  {
-                    \int_gincr:N \g__tag_para_main_begin_int
-                    \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl}
-                  }
-              }
-           \int_gincr:N \g__tag_para_begin_int
-           \__block_debug_typeout:n{increment~ P \on at line }
-           \tag_struct_begin:n
-               {
-                  tag=\l__tag_para_tag_tl
-                 ,attribute-class=\l_tag_para_attr_class_tl
-               }
-           \__tag_check_para_begin_show:nn {green}{\PARALABEL}
-           \tag_mc_begin:n {}
+           \__block_start_para_structure:n { \PARALABEL }
          }
      }
 }
+\cs_new_protected:Npn \__block_start_para_structure:n #1 {
+   \__block_debug_typeout:n
+      { @endpe = \legacy_if:nTF { @endpe }{true}{false}
+        \on at line }
+   \legacy_if:nF { @endpe }
+     {
+       \bool_if:NF \l__tag_para_flattened_bool
+          {
+            \int_gincr:N \g__tag_para_main_begin_int
+            \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl}
+          }
+      }
+   \int_gincr:N \g__tag_para_begin_int
+   \__block_debug_typeout:n{increment~ P \on at line }
+   \tag_struct_begin:n
+       {
+          tag=\l__tag_para_tag_tl
+         ,attribute-class=\l_tag_para_attr_class_tl
+       }
+   \__tag_check_para_begin_show:nn {green}{#1}
+   \tag_mc_begin:n {}
+}
+\cs_new_protected:Npn \__block_start_para_structure_unconditionally:n #1 {
+   \bool_if:NF \l__tag_para_flattened_bool
+       {
+         \int_gincr:N \g__tag_para_main_begin_int
+         \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl}
+       }
+   \int_gincr:N \g__tag_para_begin_int
+   \__block_debug_typeout:n{increment~ P \on at line }
+   \tag_struct_begin:n
+       {
+          tag=\l__tag_para_tag_tl
+         ,attribute-class=\l_tag_para_attr_class_tl
+       }
+   \__tag_check_para_begin_show:nn {green}{#1}
+   \tag_mc_begin:n {}
+}
 \tag_if_active:T {
 }
 \RemoveFromHook{para/end}[tagpdf]
@@ -1208,24 +1345,7 @@
 \cs_set:Npn \__kernel_list_label_after: {
    \bool_if:NT \l__tag_para_bool
      {
-       \bool_if:NF \l__tag_para_flattened_bool
-            {
-              \int_gincr:N \g__tag_para_main_begin_int
-              \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl}
-            }
-       \int_gincr:N \g__tag_para_begin_int
-       \__block_debug_typeout:n{increment~ P \on at line }
-       \tag_struct_begin:n {
-          tag=\l__tag_para_tag_tl
-         ,attribute-class=\l_tag_para_attr_class_tl
-       }
-       \bool_if:NT \l__tag_para_show_bool
-            {
-              \tag_mc_begin:n {artifact}
-              \llap {\color_select:n {blue}\tiny Li-\int_use:N \g__tag_para_begin_int \ }
-              \tag_mc_end:
-            }
-       \tag_mc_begin:n {tag=P}
+       \__block_start_para_structure_unconditionally:n { LI- }
      }
 }
 \cs_new:Npn \__block_inner_begin: {

Added: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-float.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-float.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-float.sty	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,264 @@
+%%
+%% This is file `latex-lab-testphase-float.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% latex-lab-float.dtx  (with options: `package')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright 2021-2023 LaTeX Project
+%% 
+%% This file was generated from file(s) of the  `LaTeX-lab Bundle'.
+%% ------------------------------------------------------------------------------------
+%% 
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008 or later.
+%% 
+%% This file may only be distributed together with a copy of the LaTeX
+%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle'
+%% without such generated files.
+%% 
+%% The newest sources can be found below
+%% 
+%%    https://github.com/latex3/latex2e/required/latex-lab
+%% 
+%% where one can also log issues in case there are any.
+%% 
+%% 
+%% File: latex-lab-float.dtx (C) Copyright 2023 LaTeX Project
+\ProvidesExplPackage {latex-lab-testphase-float} {2023-04-28} {0.8}
+  {Code related to the tagging of floats}
+\tagpdfsetup{add-new-tag=float/Aside}
+\tagpdfsetup{add-new-tag=figures/Sect}
+\tagpdfsetup{add-new-tag=tables/Sect}
+\prop_new:N \g__tag_float_sect_prop
+\seq_new:N  \g__tag_float_types_seq
+\seq_gput_right:Nn \g__tag_float_types_seq {figure}
+\seq_gput_right:Nn \g__tag_float_types_seq {table}
+\bool_new:N       \g__tag_float_sect_bool
+\bool_gset_true:N  \g__tag_float_sect_bool
+\cs_new_protected:Npn\__tag_float_init_collect:
+  {
+    \bool_if:NT\g__tag_float_sect_bool
+      {
+        \seq_map_inline:Nn\g__tag_float_types_seq
+          {
+            \tag_struct_begin:n{tag=##1s,stash}
+            \prop_gput:Nnx\g__tag_float_sect_prop {##1-struct}{\int_use:N\c at g__tag_struct_abs_int}
+            \tag_struct_end:
+          }
+      }
+  }
+\cs_new_protected:Npn \__tag_float_stop_sect:
+  {
+    \bool_if:NT\g__tag_float_sect_bool
+     {
+      \seq_map_inline:Nn\g__tag_float_types_seq
+        {
+          \prop_get:NnNT\g__tag_float_sect_prop{##1-used}\l__tag_tmpa_tl
+            {
+              \exp_args:Ne
+              \tag_struct_use_num:n{\prop_item:Nn\g__tag_float_sect_prop{##1-struct}}
+              \prop_gremove:Nn \g__tag_float_sect_prop{##1-used}
+            }
+        }
+     }
+  }
+
+\keys_define:nn { tag / tool}
+ {
+   flush-floats .code:n =
+     {
+       \keys_set:nn {tag / tool} {sec-stop=#1}
+       \__tag_float_stop_sect:
+       \__tag_float_init_collect:
+     },
+   flush-float .default:n = Document
+ }
+\AddToHook{begindocument/end}[latex-lab/float]
+  {\__tag_float_init_collect:}
+\AddToHook{tagpdf/finish/before}[latex-lab/float]
+  {\par\__tag_sec_end:n{-10}\__tag_float_stop_sect:}
+\DeclareHookRule{tagpdf/finish/before}{latex-lab/float}{before}{tagpdf}
+\keys_define:nn { tag / tool}
+  {
+   split-float .code:n =
+    {
+      \__tag_float_end:
+      \__tag_float_begin:
+      \MakeLinkTarget[tagstructure]{g__tag_struct_abs_int}
+    }
+ }
+
+\cs_new_protected:Npn \__tag_float_stop_par:
+  {
+    \tag_mc_end:
+    \bool_if:NF \g__tag_float_sect_bool
+     {
+      \tag_struct_end:
+     }
+  }
+\cs_new_protected:Npn \__tag_float_start_par:
+  {
+    \bool_if:NF \g__tag_float_sect_bool
+     {
+      \tag_struct_begin:n{tag=text}%
+     }
+   \tag_mc_begin:n{tag=P}
+  }
+
+\cs_new_protected:Npn \__tag_float_begin:
+ {%
+  \bool_if:NTF\g__tag_float_sect_bool
+   {
+     \exp_args:Ne
+     \tag_struct_begin:n{tag=float,parent=0\prop_item:No\g__tag_float_sect_prop{\@captype-struct}}%
+     \prop_gput:Nxx \g__tag_float_sect_prop {\@captype-used}{true}
+   }
+   {
+     \tag_struct_begin:n{tag=float}
+   }
+     \tl_set:Nx\@current at float@struct{\tag_get:n{struct_num}}%
+     \typeout{Float structure: \@current at float@struct}
+ }
+
+\cs_new_protected:Npn\__tag_float_end:{\tag_struct_end:} %end Aside
+
+\ExplSyntaxOff
+\def\@xfloat #1[#2]{%
+  \@nodocument
+  \def \@captype {#1}%
+   \def \@fps {#2}%
+   \@onelevel at sanitize \@fps
+   \def \reserved at b {!}%
+   \ifx \reserved at b \@fps
+     \@fpsadddefault
+   \else
+     \ifx \@fps \@empty
+       \@fpsadddefault
+     \fi
+   \fi
+   \ifhmode
+     \@bsphack
+     \@nameuse{__tag_float_stoppar:} %<---end P
+     \@floatpenalty -\@Mii
+   \else
+     \@floatpenalty-\@Miii
+   \fi
+  \ifinner
+     \@parmoderr\@floatpenalty\z@
+  \else
+    \@next\@currbox\@freelist
+      {%
+       \@tempcnta \sixt@@n
+       \expandafter \@tfor \expandafter \reserved at a
+         \expandafter :\expandafter =\@fps
+         \do
+          {%
+           \if \reserved at a h%
+             \ifodd \@tempcnta
+             \else
+               \advance \@tempcnta \@ne
+             \fi
+           \else\if \reserved at a t%
+             \@setfpsbit \tw@
+           \else\if \reserved at a b%
+             \@setfpsbit 4%
+           \else\if \reserved at a p%
+             \@setfpsbit 8%
+           \else\if \reserved at a !%
+             \ifnum \@tempcnta>15
+               \advance\@tempcnta -\sixt@@n\relax
+             \fi
+           \else
+             \@latex at error{Unknown float option `\reserved at a'}%
+             {Option `\reserved at a' ignored and `p' used.}%
+             \@setfpsbit 8%
+           \fi\fi\fi\fi\fi
+           }%
+       \@tempcntb \csname ftype@\@captype \endcsname
+       \multiply \@tempcntb \@xxxii
+       \advance \@tempcnta \@tempcntb
+       \global \count\@currbox \@tempcnta
+       }%
+    \@fltovf
+  \fi
+  \@nameuse{__tag_float_begin:}%
+  \global \setbox\@currbox
+    \color at vbox
+      \normalcolor
+      \vbox \bgroup
+        \hsize\columnwidth
+        \@parboxrestore
+        \@floatboxreset
+        \MakeLinkTarget[tagstructure]{g__tag_struct_abs_int}%
+}%
+\def\end at float{%
+  \@endfloatbox
+  \@nameuse{__tag_float_end:}%
+  \ifnum\@floatpenalty <\z@
+    \@largefloatcheck
+    \@cons\@currlist\@currbox
+    \ifnum\@floatpenalty <-\@Mii
+      \penalty -\@Miv
+      \@tempdima\prevdepth
+      \vbox{}%
+      \prevdepth\@tempdima
+      \penalty\@floatpenalty
+    \else
+      \vadjust{\penalty -\@Miv \vbox{}\penalty\@floatpenalty}\@Esphack
+      \@nameuse{__tag_float_start_par:} %restart P safe here??
+    \fi
+  \fi
+}
+\ExplSyntaxOn
+\def\hyper at nopatch@caption{}
+\providecommand\theHg__tag_struct_abs_int{\int_use:N\c at g__tag_struct_abs_int}
+
+\AddToHook{begindocument}
+  {
+    \long\def\@makecaption#1#2{%
+      \vskip\abovecaptionskip
+      \xdef\@currentHref{tagstructure.\@current at float@struct}%
+      \tag_stop:n{caption}
+      \sbox\@tempboxa{#1:~#2}%
+      \tag_start:n{caption}
+      \tagtool{para=false}
+      \tag_struct_begin:n{tag=Caption,parent=\@current at float@struct}
+     \seq_gpop_right:cN {g__tag_struct_kids_\@current at float@struct _seq}\l__tag_tmpa_tl
+     \seq_gput_left:cV  {g__tag_struct_kids_\@current at float@struct _seq}\l__tag_tmpa_tl
+      \ifdim \wd\@tempboxa >\hsize
+        \tag_struct_begin:n{tag=Lbl}
+        \tag_mc_begin:n{}
+          #1:~
+        \tag_mc_end:
+        \tag_struct_end:
+        \tag_mc_begin:n{}
+          #2\par
+        \tag_mc_end:
+      \else
+          \global \@minipagefalse
+        \hb at xt@\hsize{\hfil
+         \tag_struct_begin:n{tag=Lbl}
+          \tag_mc_begin:n{}
+           #1:~
+          \tag_mc_end:
+         \tag_struct_end:
+         \tag_mc_begin:n{}
+          #2\par
+         \tag_mc_end:\hfil}%
+       \fi
+       \tag_struct_end: %caption
+      \vskip\belowcaptionskip}
+  }
+
+\endinput
+%%
+%% End of file `latex-lab-testphase-float.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-float.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-graphic.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-graphic.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-graphic.sty	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,694 @@
+%%
+%% This is file `latex-lab-testphase-graphic.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% latex-lab-graphic.dtx  (with options: `package')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright 2021-2023 LaTeX Project
+%% 
+%% This file was generated from file(s) of the  `LaTeX-lab Bundle'.
+%% ------------------------------------------------------------------------------------
+%% 
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008 or later.
+%% 
+%% This file may only be distributed together with a copy of the LaTeX
+%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle'
+%% without such generated files.
+%% 
+%% The newest sources can be found below
+%% 
+%%    https://github.com/latex3/latex2e/required/latex-lab
+%% 
+%% where one can also log issues in case there are any.
+%% 
+%% 
+%% File: latex-lab-graphic.dtx (C) Copyright 2022-2023 LaTeX Project
+\ProvidesExplPackage {latex-lab-testphase-graphic} {2023-04-07} {0.8}
+  {Code related to the tagging of graphics}
+\RequirePackage{l3opacity}
+\ref_attribute_gset:nnnn{xpos}{0}{shipout}{\int_use:N\tex_lastxpos:D}
+\ref_attribute_gset:nnnn{ypos}{0}{shipout}{\int_use:N\tex_lastypos:D}
+
+\cs_new_protected:Npn\__tag_graphic_savepos:n #1
+ {
+  \tex_savepos:D
+  \ref_label:nn{#1}{xpos,ypos,abspage}
+  \tex_savepos:D
+ }
+\cs_generate_variant:Nn \__tag_graphic_savepos:n {e}
+\bool_new:N \l__tag_graphic_debug_bool
+\keys_define:nn { document / metadata }
+  {
+    debug / BBox .code:n = { \bool_set_true:N \l__tag_graphic_debug_bool }
+  }
+\int_new:N\g__tag_graphic_int
+
+\tl_new:N \g__tag_graphic_lx_tl
+\tl_new:N \g__tag_graphic_ly_tl
+\tl_new:N \g__tag_graphic_ux_tl
+\tl_new:N \g__tag_graphic_uy_tl
+\seq_new:N\l__tag_graphic_bboxcorr_seq
+\bool_new:N\l__tag_graphic_bboxcorr_bool
+\tl_new:N \l__tag_graphic_currentlabel_tl
+
+\tl_new:N \l__tag_graphic_alt_tl
+\tl_new:N \l__tag_graphic_alt_dflt_tl
+\tl_set:Nn \l__tag_graphic_alt_dflt_tl {\Gin at base\Gin at ext}
+\tl_new:N \l__tag_graphic_actual_tl
+\tl_new:N \l__tag_graphic_struct_tl
+\tl_set:Nn\l__tag_graphic_struct_tl {Figure}
+\bool_new:N\l__tag_graphic_artifact_bool
+\bool_new:N\l__tag_graphic_BBox_bool
+\bool_set_true:N\l__tag_graphic_BBox_bool
+
+\fp_new:N\l__tag_graphic_sin_fp
+\fp_new:N\l__tag_graphic_cos_fp
+\fp_new:N\l__tag_graphic_lxly_fp
+\fp_new:N\l__tag_graphic_lxuy_fp
+\fp_new:N\l__tag_graphic_uxly_fp
+\fp_new:N\l__tag_graphic_uxuy_fp
+\fp_new:N\l__tag_graphic_ux_fp
+\fp_new:N\l__tag_graphic_ly_fp
+\fp_new:N\l__tag_graphic_lx_fp
+\fp_new:N\l__tag_graphic_uy_fp
+\fp_new:N\l__tag_graphic_scale_fp
+\fp_new:N\l__tag_graphic_trim_ux_fp
+\fp_new:N\l__tag_graphic_trim_ly_fp
+\fp_new:N\l__tag_graphic_trim_lx_fp
+\fp_new:N\l__tag_graphic_trim_uy_fp
+\msg_new:nnn {tag}{alt-text-missing}
+  {
+    Alternative~text~for~graphic~is~missing.\\
+    Using~'#1'~instead
+  }
+\cs_new_protected:Npn\Gin at tag@struct at begin
+ {
+   \tag_if_active:T
+    {
+      \tag_mc_end_push:
+      \bool_if:NTF\l__tag_graphic_artifact_bool
+       {
+         \tag_mc_begin:n{artifact}
+       }
+       {
+         \tl_if_empty:NTF\l__tag_graphic_actual_tl
+           {
+             \tl_if_empty:NT\l__tag_graphic_alt_tl
+               {
+                 \msg_warning:nnx{tag}{alt-text-missing}{\l__tag_graphic_alt_dflt_tl}
+                 \tl_set:Nx\l__tag_graphic_alt_tl {\l__tag_graphic_alt_dflt_tl}
+               }
+             \tag_struct_begin:n
+               {
+                tag=\l__tag_graphic_struct_tl,
+                alt=\l__tag_graphic_alt_tl,
+               }
+           }
+           {
+             \tag_struct_begin:n
+               {
+                 tag=Span,
+                 actualtext=\l__tag_graphic_actual_tl,
+               }
+             \bool_set_false:N\l__tag_graphic_BBox_bool
+           }
+        \tag_mc_begin:n{}
+       }
+    }
+ }
+
+\cs_new_protected:Npn\Gin at tag@struct at end
+ {
+   \tag_if_active:T
+    {
+     \tag_mc_end:
+     \bool_if:NF\l__tag_graphic_artifact_bool
+      {
+        \tag_struct_end:
+      }
+     \tag_mc_begin_pop:n{}
+    }
+ }
+\AddToHook{package/graphics/after}
+ {
+  \def\Gin at setfile#1#2#3{%
+  \ifx\\#2\\\Gread at false\fi
+  \ifGin at bbox\else
+    \ifGread@
+      \csname Gread@%
+         \expandafter\ifx\csname Gread@#1\endcsname\relax
+           eps%
+         \else
+           #1%
+         \fi
+      \endcsname{\Gin at base#2}%
+    \else
+      \Gin at nosize{#3}%
+    \fi
+  \fi
+  \Gin at viewport@code
+  \Gin at nat@height\Gin at ury bp%
+  \advance\Gin at nat@height-\Gin at lly bp%
+  \Gin at nat@width\Gin at urx bp%
+  \advance\Gin at nat@width-\Gin at llx bp%
+  \Gin at req@sizes
+  \expandafter\ifx\csname Ginclude@#1\endcsname\relax
+    \Gin at drafttrue
+    \expandafter\ifx\csname Gread@#1\endcsname\relax
+      \@latex at error{Can not include graphics of type: #1}\@ehc
+      \global\expandafter\let\csname Gread@#1\endcsname\@empty
+    \fi
+  \fi
+  \leavevmode
+  \Gin at tag@struct at begin %NEW
+  \ifGin at draft
+      \hb at xt@\Gin at req@width{%
+        \vrule\hss
+        \vbox to \Gin at req@height{%
+           \hrule \@width \Gin at req@width
+           \vss
+           \edef\@tempa{#3}%
+           \rlap{ \ttfamily\expandafter\strip at prefix\meaning\@tempa}%
+           \vss
+           \hrule}%
+        \hss\vrule}%
+  \else
+    \@addtofilelist{#3}%
+    \ProvidesFile{#3}[Graphic file (type #1)]%
+    \setbox\z@\hbox{\csname Ginclude@#1\endcsname{#3}}%
+    \dp\z@\z@
+    \ht\z@\Gin at req@height
+    \wd\z@\Gin at req@width
+  \Gin at tag@bbox at attribute %new
+  \box\z@
+  \Gin at tag@struct at end %new
+  \fi}
+ }
+\AddToHook{package/graphicx/after}[latex-lab]
+  {
+    \define at key{Gin}{alt}       {\tl_set:Nx\l__tag_graphic_alt_tl{\text_purify:n{#1}}}
+    \define at key{Gin}{artifact}[]
+      {
+        \bool_set_true:N \l__tag_graphic_artifact_bool
+        \bool_set_false:N \l__tag_graphic_BBox_bool
+      }
+    \define at key{Gin}{actualtext}
+     {
+       \tl_set:Nx\l__tag_graphic_actual_tl{\text_purify:n{#1}}
+       \bool_set_false:N \l__tag_graphic_BBox_bool
+     }
+    \define at key{Gin}{correct-BBox}
+      {
+        \bool_set_true:N \l__tag_graphic_bboxcorr_bool
+        \seq_set_split:Nnn\l__tag_graphic_bboxcorr_seq{~}{#1~0pt~0pt~0pt~0pt}
+      }
+    \define at key{Gin}{tag}
+      {
+        \str_case:nnF {#1}
+          {
+            {artifact}
+            {
+               \bool_set_true:N \l__tag_graphic_artifact_bool
+               \bool_set_false:N \l__tag_graphic_BBox_bool
+            }
+            {false}{\tag_stop:}
+          }
+          {\tl_set:Nn\l__tag_graphic_struct_tl{#1}}
+      }
+  }
+\AddToHook{package/graphics/after}[latex-lab]
+  {\RequirePackage{graphicx}}
+\keys_define:nn{tag/picture}
+   {
+     ,alt .code:n =
+        {\tl_set:Nx\l__tag_graphic_alt_tl{\text_purify:n{#1}}}
+     ,artifact .code:n =
+        {
+          \bool_set_true:N \l__tag_graphic_artifact_bool
+          \bool_set_false:N \l__tag_graphic_BBox_bool
+        }
+     ,actualtext .code:n =
+        {
+          \tl_set:Nx\l__tag_graphic_actual_tl{\text_purify:n{#1}}
+          \bool_set_false:N \l__tag_graphic_BBox_bool
+        }
+     ,correct-BBox .code:n =
+      {
+        \bool_set_true:N \l__tag_graphic_bboxcorr_bool
+        \seq_set_split:Nnn\l__tag_graphic_bboxcorr_seq{~}{#1~0pt~0pt~0pt~0pt}
+      }
+    ,tag .code:n =
+      {
+        \str_case:nnF {#1}
+          {
+            {artifact}
+            {
+               \bool_set_true:N \l__tag_graphic_artifact_bool
+               \bool_set_false:N \l__tag_graphic_BBox_bool
+            }
+            {false}{\tag_stop:}
+          }
+          {\tl_set:Nn\l__tag_graphic_struct_tl{#1}}
+      }
+   }
+\cs_new_protected:Npn \__tag_graphic_get_trim:
+ {
+   \legacy_if:nTF {Gin at clip}
+    {
+      \fp_zero:N\l__tag_graphic_trim_lx_fp
+      \fp_zero:N\l__tag_graphic_trim_ly_fp
+      \fp_zero:N\l__tag_graphic_trim_ux_fp
+      \fp_zero:N\l__tag_graphic_trim_uy_fp
+    }
+    {
+      \fp_set:Nn \l__tag_graphic_trim_lx_fp {\l__tag_graphic_scale_fp*\Gin at vllx}
+      \fp_set:Nn \l__tag_graphic_trim_ly_fp {\l__tag_graphic_scale_fp*\Gin at vlly}
+      \fp_set:Nn \l__tag_graphic_trim_ux_fp {\l__tag_graphic_scale_fp*\Gin at vurx}
+      \fp_set:Nn \l__tag_graphic_trim_uy_fp {\l__tag_graphic_scale_fp*\Gin at vury}
+      \cs_if_exist:NT \Gin at ollx
+        {
+         \fp_set:Nn \l__tag_graphic_trim_ux_fp {\l__tag_graphic_scale_fp* (\Gin at ourx-(\Gin at urx)) }
+         \fp_set:Nn \l__tag_graphic_trim_uy_fp {\l__tag_graphic_scale_fp* (\Gin at oury-(\Gin at ury)) }
+        }
+    }
+ }
+\cs_new_protected:Npn \__tag_graphic_get_scale:
+ {
+   \fp_set:Nn \l__tag_graphic_scale_fp { \Gin at scalex }
+ }
+\cs_new_protected:Npn \__tag_graphic_applyangle:nnnn #1#2#3#4 %lx,ly,ux,uy
+ {
+   \bool_lazy_and:nnT
+     {\cs_if_exist_p:N \Grot at angle }
+     {! \int_compare_p:nNn { \Grot at angle }={0}}
+     {
+       \fp_set:Nn \l__tag_graphic_sin_fp  { sind(\Grot at angle) }
+       \fp_set:Nn \l__tag_graphic_cos_fp  { cosd(\Grot at angle) }
+       \fp_set:Nn \l__tag_graphic_lx_fp {#1}
+       \fp_set:Nn \l__tag_graphic_ly_fp {#2}
+       \fp_set:Nn \l__tag_graphic_ux_fp {#3}
+       \fp_set:Nn \l__tag_graphic_uy_fp {#4}
+       \fp_set:Nn\l__tag_graphic_lxly_fp
+        {
+          -\l__tag_graphic_trim_lx_fp *  \l__tag_graphic_cos_fp
+          +\l__tag_graphic_trim_ly_fp *  \l__tag_graphic_sin_fp
+        }
+       \fp_set:Nn\l__tag_graphic_lxuy_fp
+        {
+          (-\l__tag_graphic_trim_lx_fp) * \l__tag_graphic_cos_fp
+          +
+           (\l__tag_graphic_uy_fp-\l__tag_graphic_ly_fp-\l__tag_graphic_trim_ly_fp)
+            * (-\l__tag_graphic_sin_fp)
+        }
+       \fp_set:Nn\l__tag_graphic_uxly_fp
+        {
+          (\l__tag_graphic_ux_fp-\l__tag_graphic_lx_fp-\l__tag_graphic_trim_lx_fp)
+           * \l__tag_graphic_cos_fp
+          +
+          (\l__tag_graphic_trim_ly_fp) * (\l__tag_graphic_sin_fp)
+        }
+       \fp_set:Nn\l__tag_graphic_uxuy_fp
+        {
+          (\l__tag_graphic_ux_fp-\l__tag_graphic_lx_fp-\l__tag_graphic_trim_lx_fp)
+            *  \l__tag_graphic_cos_fp
+         +
+          (\l__tag_graphic_uy_fp-\l__tag_graphic_ly_fp-\l__tag_graphic_trim_ly_fp)
+            * (-\l__tag_graphic_sin_fp)
+        }
+       \tl_gset:Nx\g__tag_graphic_lx_tl
+         {
+          \fp_eval:n
+            {
+              min
+               (
+                 \l__tag_graphic_lxly_fp,
+                 \l__tag_graphic_lxuy_fp,
+                 \l__tag_graphic_uxly_fp,
+                 \l__tag_graphic_uxuy_fp,
+               )
+               +\l__tag_graphic_lx_fp
+               +\l__tag_graphic_trim_lx_fp
+            }
+         }
+       \tl_gset:Nx\g__tag_graphic_ux_tl
+         {
+           \fp_eval:n
+             {
+               max
+                (
+                  \l__tag_graphic_lxly_fp,
+                  \l__tag_graphic_lxuy_fp,
+                  \l__tag_graphic_uxly_fp,
+                  \l__tag_graphic_uxuy_fp
+                )
+                +\l__tag_graphic_lx_fp
+                +\l__tag_graphic_trim_lx_fp
+             }
+         }
+       \fp_set:Nn\l__tag_graphic_lxly_fp
+        {
+           -\l__tag_graphic_trim_lx_fp *  \l__tag_graphic_sin_fp
+           -\l__tag_graphic_trim_ly_fp *  \l__tag_graphic_cos_fp
+        }
+       \fp_set:Nn\l__tag_graphic_lxuy_fp
+        {
+          - \l__tag_graphic_trim_lx_fp *  \l__tag_graphic_sin_fp
+          +
+          (\l__tag_graphic_uy_fp-\l__tag_graphic_ly_fp-\l__tag_graphic_trim_ly_fp)
+            * \l__tag_graphic_cos_fp
+        }
+       \fp_set:Nn\l__tag_graphic_uxly_fp
+        {
+          (\l__tag_graphic_ux_fp-\l__tag_graphic_lx_fp-\l__tag_graphic_trim_lx_fp)
+            * \l__tag_graphic_sin_fp
+          - \l__tag_graphic_trim_ly_fp * \l__tag_graphic_cos_fp
+        }
+       \fp_set:Nn\l__tag_graphic_uxuy_fp
+        {
+          (\l__tag_graphic_ux_fp-\l__tag_graphic_lx_fp-\l__tag_graphic_trim_lx_fp)
+            * \l__tag_graphic_sin_fp
+         +
+          (\l__tag_graphic_uy_fp-\l__tag_graphic_ly_fp-\l__tag_graphic_trim_ly_fp)
+            * \l__tag_graphic_cos_fp
+        }
+       \tl_gset:Nx\g__tag_graphic_ly_tl
+         {
+          \fp_eval:n
+            {
+              min
+               (
+                 \l__tag_graphic_lxly_fp,
+                 \l__tag_graphic_lxuy_fp,
+                 \l__tag_graphic_uxly_fp,
+                 \l__tag_graphic_uxuy_fp
+               )
+              + \l__tag_graphic_ly_fp + \l__tag_graphic_trim_ly_fp
+            }
+         }
+       \tl_gset:Nx\g__tag_graphic_uy_tl
+         {
+           \fp_eval:n
+             {
+               max
+                (
+                  \l__tag_graphic_lxly_fp,
+                  \l__tag_graphic_lxuy_fp,
+                  \l__tag_graphic_uxly_fp,
+                  \l__tag_graphic_uxuy_fp,
+                )
+               + \l__tag_graphic_ly_fp + \l__tag_graphic_trim_ly_fp
+             }
+         }
+     }
+ }
+\cs_generate_variant:Nn\__tag_graphic_applyangle:nnnn {VVVV}
+\cs_new_protected:Npn \__tag_graphic_applycorr:NNNN #1 #2 #3 #4
+ {
+  \bool_if:NT\l__tag_graphic_bboxcorr_bool
+    {
+     \tl_set:Nx #1
+       {
+         \fp_eval:n
+          {
+           #1
+           +
+           \dim_to_decimal_in_bp:n {\seq_item:Nn \l__tag_graphic_bboxcorr_seq {1} }
+          }
+       }
+     \tl_set:Nx #2
+       {
+         \fp_eval:n
+          {
+           #2
+           +
+           \dim_to_decimal_in_bp:n {\seq_item:Nn \l__tag_graphic_bboxcorr_seq {2} }
+          }
+       }
+     \tl_set:Nx #3
+       {
+         \fp_eval:n
+          {
+           #3
+           +
+           \dim_to_decimal_in_bp:n {\seq_item:Nn \l__tag_graphic_bboxcorr_seq {3} }
+          }
+       }
+     \tl_set:Nx #4
+       {
+         \fp_eval:n
+          {
+           #4
+           +
+           \dim_to_decimal_in_bp:n {\seq_item:Nn \l__tag_graphic_bboxcorr_seq {4} }
+          }
+       }
+     }
+  }
+\cs_new_protected:Npn \Gin at tag@bbox at attribute
+  {
+  \bool_lazy_all:nT
+    {
+      {\tag_if_active_p:}
+      {!\l__tag_graphic_artifact_bool}
+      {\l__tag_graphic_BBox_bool}
+    }
+    {
+      \fp_set:Nn \l__tag_graphic_scale_fp { \Gin at scalex }
+      \__tag_graphic_get_trim:
+      \int_gincr:N\g__tag_graphic_int
+      \tl_set:Nx\l__tag_graphic_currentlabel_tl {__tag_graphic_\int_use:N \g__tag_graphic_int}
+      \__tag_graphic_savepos:e { \l__tag_graphic_currentlabel_tl }
+      \tl_gset:Nx\g__tag_graphic_lx_tl
+        {
+          \dim_to_decimal_in_bp:n
+            { \__tag_ref_value:enn {\l__tag_graphic_currentlabel_tl}{xpos}{0}sp }
+        }
+      \tl_gset:Nx\g__tag_graphic_ly_tl
+        {
+          \dim_to_decimal_in_bp:n
+            { \__tag_ref_value:enn {\l__tag_graphic_currentlabel_tl}{ypos}{0}sp }
+        }
+      \tl_gset:Nx\g__tag_graphic_ux_tl
+          {
+            \fp_eval:n
+             {
+               \g__tag_graphic_lx_tl
+               +
+               \dim_to_decimal_in_bp:n { \Gin at req@width }
+             }
+          }
+       \tl_gset:Nx\g__tag_graphic_uy_tl
+          {
+            \fp_eval:n
+             {
+               \g__tag_graphic_ly_tl
+               +
+                \dim_to_decimal_in_bp:n  { \Gin at req@height }
+             }
+          }
+      \legacy_if:nF {Gin at clip}
+        {
+          \tl_gset:Nx\g__tag_graphic_ux_tl
+            {
+              \fp_eval:n
+                {
+                  \g__tag_graphic_ux_tl
+                  +
+                  \l__tag_graphic_trim_ux_fp
+                }
+            }
+          \tl_gset:Nx\g__tag_graphic_lx_tl
+            {
+              \fp_eval:n
+                {
+                  \g__tag_graphic_lx_tl
+                   -
+                  \l__tag_graphic_trim_lx_fp
+                }
+            }
+          \tl_gset:Nx\g__tag_graphic_uy_tl
+            {
+              \fp_eval:n
+                {
+                  \g__tag_graphic_uy_tl
+                  +
+                  \l__tag_graphic_trim_uy_fp
+                }
+            }
+          \tl_gset:Nx\g__tag_graphic_ly_tl
+            {
+              \fp_eval:n
+                {
+                  \g__tag_graphic_ly_tl
+                  -
+                  \l__tag_graphic_trim_ly_fp
+                }
+            }
+        }
+      \__tag_graphic_applyangle:VVVV
+        \g__tag_graphic_lx_tl
+        \g__tag_graphic_ly_tl
+        \g__tag_graphic_ux_tl
+        \g__tag_graphic_uy_tl
+      \__tag_graphic_applycorr:NNNN
+        \g__tag_graphic_lx_tl
+        \g__tag_graphic_ly_tl
+        \g__tag_graphic_ux_tl
+        \g__tag_graphic_uy_tl
+    \bool_if:NT\l__tag_graphic_debug_bool
+     {
+       \__tag_graphic_show_bbox:VVVVne
+        \g__tag_graphic_lx_tl
+        \g__tag_graphic_ly_tl
+        \g__tag_graphic_ux_tl
+        \g__tag_graphic_uy_tl
+        {red}
+        {\int_use:N\g__tag_graphic_int}
+     }
+      \__tag_prop_gput:cnx
+         { g__tag_struct_\int_eval:n {\c at g__tag_struct_abs_int}_prop }
+         { A }
+         {
+           <<
+             /O /Layout /BBox~
+             [
+              \g__tag_graphic_lx_tl\c_space_tl
+              \g__tag_graphic_ly_tl\c_space_tl
+              \g__tag_graphic_ux_tl\c_space_tl
+              \g__tag_graphic_uy_tl
+             ]
+           >>
+         }
+    }
+  }
+\newcommand\picture at tag@bbox at attribute
+ {
+   \bool_lazy_all:nT
+    {
+      {\tag_if_active_p:}
+      {!\l__tag_graphic_artifact_bool}
+      {\l__tag_graphic_BBox_bool}
+    }
+    {
+      \int_gincr:N\g__tag_graphic_int
+      \tl_set:Nx\l__tag_graphic_currentlabel_tl {__tag_graphic_\int_use:N \g__tag_graphic_int}
+      \__tag_graphic_savepos:e { \l__tag_graphic_currentlabel_tl }
+      \tl_gset:Nx \g__tag_graphic_lx_tl
+        {
+          \dim_to_decimal_in_bp:n
+          { \__tag_ref_value:enn {\l__tag_graphic_currentlabel_tl}{xpos}{0}sp  }
+        }
+      \tl_gset:Nx \g__tag_graphic_ly_tl
+        {
+          \dim_to_decimal_in_bp:n
+          { \__tag_ref_value:enn {\l__tag_graphic_currentlabel_tl}{ypos}{0}sp - \dp\@picbox }
+        }
+      \tl_gset:Nx \g__tag_graphic_ux_tl
+        {
+          \dim_to_decimal_in_bp:n
+           {
+             \g__tag_graphic_lx_tl bp + \wd\@picbox
+           }
+        }
+      \tl_gset:Nx \g__tag_graphic_uy_tl
+        {
+          \dim_to_decimal_in_bp:n
+           {
+             \g__tag_graphic_ly_tl bp + \ht\@picbox + \dp\@picbox
+           }
+        }
+      \__tag_graphic_applycorr:NNNN
+           \g__tag_graphic_lx_tl
+           \g__tag_graphic_ly_tl
+           \g__tag_graphic_ux_tl
+           \g__tag_graphic_uy_tl
+      \bool_if:NT\l__tag_graphic_debug_bool
+        {
+          \__tag_graphic_show_bbox:VVVVne
+           \g__tag_graphic_lx_tl
+           \g__tag_graphic_ly_tl
+           \g__tag_graphic_ux_tl
+           \g__tag_graphic_uy_tl
+           {red}
+           {\int_use:N\g__tag_graphic_int}
+        }
+      \__tag_prop_gput:cnx
+            { g__tag_struct_\int_eval:n {\c at g__tag_struct_abs_int}_prop }
+            { A }
+            {
+              <<
+                /O /Layout /BBox~
+                [
+                 \g__tag_graphic_lx_tl\c_space_tl
+                 \g__tag_graphic_ly_tl\c_space_tl
+                 \g__tag_graphic_ux_tl\c_space_tl
+                 \g__tag_graphic_uy_tl
+                ]
+              >>
+           }
+     }
+  }
+
+\RenewDocumentCommand\picture{O{}m}
+ {
+   \leavevmode
+   \keys_set:nn{tag/picture}{#1} %
+   \tl_set:Nn\l__tag_graphic_alt_dflt_tl {picture~environment}
+   \pictur@#2
+ }
+\def\@picture(#1,#2)(#3,#4){%
+  \@defaultunitsset\@picht{#2}\unitlength
+  \@defaultunitsset\@tempdimc{#1}\unitlength
+  \Gin at tag@struct at begin
+  \setbox\@picbox\hb at xt@\@tempdimc\bgroup
+    \tag_stop: %do not tag inside the picture box
+    \@defaultunitsset\@tempdimc{#3}\unitlength
+    \hskip -\@tempdimc
+    \@defaultunitsset\@tempdimc{#4}\unitlength
+    \lower\@tempdimc\hbox\bgroup
+      \ignorespaces}
+\def\endpicture{%
+  \egroup\hss\egroup
+    \ht\@picbox\@picht\dp\@picbox\z@
+    \picture at tag@bbox at attribute
+    \mbox{\box\@picbox}
+    \Gin at tag@struct at end}
+\cs_new_protected:Npn \__tag_graphic_show_bbox:nnnnnn #1#2#3#4#5#6%#5 color, #6 graphic
+ {
+    \iow_log:n {tag/graphic~debug:~BBox~of~graphics~#6~is~#1~#2~#3~#4}
+    \hook_gput_code:nnn
+     {shipout/foreground}
+     {tag/graphic}
+     {
+      \int_compare:nNnT
+       {\g_shipout_readonly_int}
+       =
+       {\__tag_ref_value:enn{__tag_graphic_#6}{abspage}{0}}
+       {
+        \put
+         (#1 bp,\dim_eval:n{-\paperheight + \dim_eval:n{#2 bp}})
+         {
+          \opacity_select:n{0.5}\color_select:n{#5}
+          \rule
+           {\dim_eval:n {#3 bp-\dim_eval:n{#1 bp}}}
+           {\dim_eval:n {#4 bp-\dim_eval:n{#2 bp}}}
+         }
+       }
+     }
+ }
+ \cs_generate_variant:Nn  \__tag_graphic_show_bbox:nnnnnn {VVVVne}
+
+
+\endinput
+%%
+%% End of file `latex-lab-testphase-graphic.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-graphic.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-minipage.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-minipage.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-minipage.sty	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,120 @@
+%%
+%% This is file `latex-lab-testphase-minipage.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% latex-lab-minipage.dtx  (with options: `package')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright 2021-2023 LaTeX Project
+%% 
+%% This file was generated from file(s) of the  `LaTeX-lab Bundle'.
+%% ------------------------------------------------------------------------------------
+%% 
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008 or later.
+%% 
+%% This file may only be distributed together with a copy of the LaTeX
+%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle'
+%% without such generated files.
+%% 
+%% The newest sources can be found below
+%% 
+%%    https://github.com/latex3/latex2e/required/latex-lab
+%% 
+%% where one can also log issues in case there are any.
+%% 
+%% 
+%% File: latex-lab-minipage.dtx (C) Copyright 2023 LaTeX Project
+
+\def\ltlistsversion{v0.81}
+\def\ltlistsdate{2023/05/10}
+
+\ProvidesExplPackage {latex-lab-testphase-minipage} {2023-05-10} {0.81}
+  {Code related to the tagging of minipages and parboxes}
+
+\def\@kernel at init@minipage{}
+\def\@kernel at init@parbox{}
+\def\@kernel at before@minipage{}
+\def\@kernel at after@minipage{}
+\def\@kernel at before@parbox{}
+\def\@kernel at after@parbox{}
+\def\@iiiminipage#1#2[#3]#4{%
+  \@kernel at init@minipage
+  \leavevmode
+  \@pboxswfalse
+  \setlength\@tempdima{#4}%
+  \def\@mpargs{{#1}{#2}[#3]{#4}}%
+  \@kernel at before@minipage% new
+  \setbox\@tempboxa\vbox\bgroup
+    \color at begingroup
+      \hsize\@tempdima
+      \textwidth\hsize \columnwidth\hsize
+      \@parboxrestore
+      \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c at mpfootnote\z@
+      \let\@footnotetext\@mpfootnotetext
+      \let\@listdepth\@mplistdepth \@mplistdepth\z@
+      \@minipagerestore
+      \@setminipage}
+\def\endminipage{%
+    \par
+    \unskip
+    \ifvoid\@mpfootins\else
+      \vskip\skip\@mpfootins
+      \normalcolor
+      \footnoterule
+      \unvbox\@mpfootins
+    \fi
+    \@minipagefalse   %% added 24 May 89
+  \color at endgroup
+  \egroup
+  \tag_stop:n{minipage}
+  \expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}%
+  \tag_start:n{minipage}
+  \@kernel at after@minipage%new end ...
+  }
+\long\def\@iiiparbox#1#2[#3]#4#5{%
+  \@kernel at init@parbox
+  \leavevmode
+  \@pboxswfalse
+  \setlength\@tempdima{#4}%
+  \@kernel at before@parbox% new
+  \@begin at tempboxa\vbox{\hsize\@tempdima\@parboxrestore#5\@@par}%
+    \ifx\relax#2\else
+      \setlength\@tempdimb{#2}%
+      \edef\@parboxto{to\the\@tempdimb}%
+    \fi
+    \if#1b\vbox
+    \else\if #1t\vtop
+    \else\ifmmode\vcenter
+    \else\@pboxswtrue $\vcenter
+    \fi\fi\fi
+    \@parboxto{\let\hss\vss\let\unhbox\unvbox
+       \csname bm@#3\endcsname}%
+    \if at pboxsw \m at th$\fi
+  \@end at tempboxa%
+  \@kernel at after@parbox%new end
+  }
+\tl_new:N  \l__ltboxes_tag_tl
+\tl_set:Nn \l__ltboxes_tag_tl {Div}
+\cs_set_protected:Npn\@kernel at before@minipage
+  {
+    \tag_mc_end_push:\tag_struct_end:
+    \tag_struct_begin:n{tag=\l__ltboxes_tag_tl}}
+\cs_set_protected:Npn\@kernel at after@minipage
+  {\tag_struct_end:\tag_struct_begin:n{tag=\l__tag_para_tag_tl}\tag_mc_begin_pop:n{}}
+\cs_set_protected:Npn\@kernel at before@parbox
+  {\tag_mc_end_push:\tag_struct_end:\tag_struct_begin:n{tag=\l__ltboxes_tag_tl}}
+\cs_set_protected:Npn\@kernel at after@parbox
+  {\tag_struct_end:\tag_struct_begin:n{tag=\l__tag_para_tag_tl}\tag_mc_begin_pop:n{}}
+
+\endinput
+%%
+%% End of file `latex-lab-testphase-minipage.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-minipage.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-new-or-1.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-new-or-1.sty	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-new-or-1.sty	2023-05-26 21:07:56 UTC (rev 67224)
@@ -32,7 +32,7 @@
 %% where one can also log issues in case there are any.
 %% 
 %% 
-%% File: latex-lab-new-or-1.dtx (C) Copyright 2020-2022 Frank Mittelbach
+%% File: latex-lab-new-or-1.dtx (C) Copyright 2020-2023 Frank Mittelbach
 \ProvidesPackage{latex-lab-testphase-new-or-1}
         [2022-11-94 v0.1a Temporary output patches for tagging and better link support]
 \RequirePackage{etoolbox}
@@ -65,9 +65,9 @@
 \AddToHook{package/multicol/after}
     {% multicol needs later loading
   \patchcmd\page at sofar
-      {\setbox\z@\hbox{p}\global\dimen\tw@\dp\z@}%
+      {\global\dimen\tw@\dp\z@}%
       {%
-        \setbox\z@\hbox{p}\global\dimen\tw@\dp\z@
+        \global\dimen\tw@\dp\z@
         \@mult at ptagging@hook
       }%
       {\typeout{Patching \string\page at sofar\space for tagging}}{\PATCHerror}%

Deleted: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-sec-tagging.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-sec-tagging.sty	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-sec-tagging.sty	2023-05-26 21:07:56 UTC (rev 67224)
@@ -1,412 +0,0 @@
-%%
-%% This is file `latex-lab-testphase-sec-tagging.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% latex-lab-sec-tagging.dtx  (with options: `package')
-%% 
-%% This is a generated file.
-%% 
-%% Copyright 2021-2023 LaTeX Project
-%% 
-%% This file was generated from file(s) of the  `LaTeX-lab Bundle'.
-%% ------------------------------------------------------------------------------------
-%% 
-%% It may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3c
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
-%%    http://www.latex-project.org/lppl.txt
-%% and version 1.3c or later is part of all distributions of LaTeX
-%% version 2008 or later.
-%% 
-%% This file may only be distributed together with a copy of the LaTeX
-%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle'
-%% without such generated files.
-%% 
-%% The newest sources can be found below
-%% 
-%%    https://github.com/latex3/latex2e/required/latex-lab
-%% 
-%% where one can also log issues in case there are any.
-%% 
-%% 
-%% File: sec-tagging.dtx (C) Copyright 2022-2023 LaTeX Project
-\ProvidesExplPackage {latex-lab-testphase-sec-tagging} {2022-10-25} {0.8}
-  {Code related to the tagging of sectioning commands}
-\RequirePackage{latex-lab-kernel-changes}
-\seq_new:N   \g__tag_sec_stack_seq
-\seq_gpush:Nn\g__tag_sec_stack_seq {{Document}{-100}}
-\bool_new:N     \l__tag_sec_Sect_bool
-\bool_set_true:N\l__tag_sec_Sect_bool
-
-\cs_new_protected:Npn\__tag_sec_begin:nn #1 #2 %#1 level #2 keyval
-  {
-    \tag_struct_begin:n
-      {
-         tag= {\int_compare:nNnTF {#1}={-1}{Part}{Sect}}
-        ,#2
-      }
-    \seq_gpush:Nx \g__tag_sec_stack_seq {{\g__tag_struct_tag_tl}{#1}}
-  }
-\msg_new:nnn { tag } {wrong-sect-nesting}
-  {
-    The~structure~#1~can~not~be~closed.\\
-    It~is~not~equal~to~the~current~structure~#2~on~the~main~stack
-  }
-
-\cs_new_protected:Npn\__tag_sec_end:n #1 % #1 level
-  {
-    \seq_get:NN \g__tag_sec_stack_seq \l__tag_tmpa_tl
-    \int_compare:nNnT {#1}<{\exp_last_unbraced:NV\use_ii:nn\l__tag_tmpa_tl+1}
-      {
-        \seq_get:NN\g__tag_struct_tag_stack_seq \l__tag_tmpb_tl
-        \exp_args:Nee
-          \tl_if_eq:nnTF
-            {\exp_last_unbraced:NV\use_i:nn\l__tag_tmpa_tl}
-            {\exp_last_unbraced:NV\use_i:nn\l__tag_tmpb_tl}
-            {
-              \seq_gpop:NN \g__tag_sec_stack_seq \l__tag_tmpa_tl
-              \tag_struct_end:
-              \__tag_sec_end:n {#1}
-            }
-            {
-              \msg_warning:nnxx {tag}{wrong-sect-nesting}
-               { \exp_last_unbraced:NV\use_i:nn \l__tag_tmpa_tl }
-               { \exp_last_unbraced:NV\use_i:nn \l__tag_tmpb_tl }
-            }
-      }
-  }
-
-\cs_new_protected:Npn \__tag_tool_para_split:
-  {
-    \tag_mc_end:
-    \tag_struct_end:
-    \tag_struct_begin:n{tag=\l__tag_para_tag_default_tl}
-    \tag_mc_begin:n{}
-    \__tag_setup_restore_para_default:
-  }
-
-\cs_new_protected:Npn \__tag_setup_restore_para_default:
-  {
-    \tl_set:Nn \l__tag_para_main_tag_tl {text-unit}
-    \tl_set_eq:NN\l__tag_para_tag_tl\l__tag_para_tag_default_tl
-  }
-\cs_new_protected:Npn \__tag_sec_end_display:
-  {
-    \tag_struct_end: %P = Hn
-    \__tag_setup_restore_para_default:
-  }
-\hook_gput_code:nnn{tagpdf/finish/before}{tagpdf/sec}{\__tag_sec_end:n{-10}}
-\hook_gset_rule:nnnn {tagpdf/finish/before}{tagpdf/sec}{before}{tagpdf}
-\AddToHook{cmd/frontmatter/before}{\__tag_sec_end:n{-10}}
-\AddToHook{cmd/mainmatter/before} {\__tag_sec_end:n{-10}}
-\AddToHook{cmd/backmatter/before} {\__tag_sec_end:n{-10}}
-\AddToHook{cmd/appendix/before}   {\__tag_sec_end:n{-10}}
-\cs_if_free:NT \tag_tool:n
- {
-   \cs_new_protected:Npn \tag_tool:n #1
-    {
-      \tag_if_active:T { \keys_set:nn {tag / tool}{#1} }
-    }
-   \cs_set_eq:NN\tagtool\tag_tool:n
- }
-\keys_define:nn { tag / tool}
-  {
-    ,sec-start-part .code:n =
-      {
-        \bool_if:NT\l__tag_sec_Sect_bool
-          {
-            \__tag_sec_end:n   {-1}
-            \__tag_sec_begin:nn{-1}{tag=Part}
-          }
-         \tag_struct_begin:n{tag=part,title=#1}
-         \tl_set:Nn\l__tag_para_main_tag_tl {NonStruct}
-         \tl_set:Nn\l__tag_para_tag_tl {Span}
-      }
-    ,sec-stop-part .code:n = {\__tag_sec_end_display:}
-    ,sec-start-chapter .code:n =
-     {
-       \bool_if:NT\l__tag_sec_Sect_bool
-         {
-           \__tag_sec_end:n   {0}
-           \__tag_sec_begin:nn{0}{tag=Sect}
-         }
-        \tag_struct_begin:n{tag=chapter,title=#1}
-        \tl_set:Nn\l__tag_para_main_tag_tl {NonStruct}
-        \tl_set:Nn\l__tag_para_tag_tl {Span}
-     }
-    ,sec-stop-chapter .meta:n = { sec-stop-part}
-    ,sec-start .code:n = % #1 is a name like "section"
-      {
-        \bool_if:NT\l__tag_sec_Sect_bool
-          {
-            \__tag_sec_end:n    {\use:c{toclevel@#1}+0}
-            \__tag_sec_begin:nn {\use:c{toclevel@#1}+0}{tag=Sect}
-          }
-        \tl_set:Nn\l__tag_para_tag_tl{#1}
-      }
-    ,sec-start .value_required:n = true
-    ,sec-split-para .code:n = {\__tag_tool_para_split:}
-    ,restore-para .code:n = {\__tag_setup_restore_para_default:}
-    ,sec-stop .code:n =
-      {
-        \par\__tag_sec_end:n   {\use:c{toclevel@#1}+0}
-      }
-    ,sec-stop .value_required:n = true
-    ,sec-add-grouping .bool_set:N = \l__tag_sec_Sect_bool
-  }
-\AddToHook{class/after}
- {
-  \@ifundefined{chapter}
-    {
-     \RenewDocumentCommand\part{ s O{#3} m }
-      {
-        \if at noskipsec \leavevmode \fi
-        \par
-        \addvspace{4ex}%
-        \@afterindentfalse
-        % tagging start commands
-        \tag_tool:n {sec-start-part=#2}
-        % end tagging start commands
-        \bool_lazy_any:nT
-          {
-            { #1 }
-            {
-              \int_compare_p:nNn {\c at secnumdepth}<{-1}
-            }
-          }
-          {
-            \MakeLinkTarget[part]{}
-          }
-        \IfBooleanTF
-          {#1}
-          { \@spart {#3} }
-          { \@part [#2]{#3} }
-       \tag_tool:n {sec-stop-part}
-      }
-    }
-    {
-     \RenewDocumentCommand\chapter{ s O{#3} m }
-      {
-        \if at openright\cleardoublepage\else\clearpage\fi
-        \thispagestyle{plain}%
-        \global\@topnum\z@
-        \@afterindentfalse
-        \tag_tool:n { sec-start-chapter= #2 }
-        \bool_lazy_any:nT
-          {
-            { #1 }
-            {
-              \int_compare_p:nNn {\c at secnumdepth}<{0}
-            }
-            {
-              %in book target also needed in frontmatter
-              \bool_lazy_and_p:nn
-                { \cs_if_exist_p:c { @mainmattertrue } }
-                { ! \legacy_if_p:n { @mainmatter } }
-            }
-          }
-          {
-            \MakeLinkTarget[chapter]{}
-            %todo public function for this update!
-            \tl_if_blank:VF \@currentHref
-              {
-                \prop_gput:Nxx \g__tag_struct_dest_num_prop {\@currentHref}{\tag_get:n{struct_num}}
-              }
-          }
-        \IfBooleanTF
-          {#1}
-          { \@schapter {#3} }
-          { \@chapter [#2]{#3} }
-        \tag_tool:n {sec-stop-chapter}
-      }
-     \RenewDocumentCommand\part{ s O{#3} m }
-      {
-        \if at openright
-          \cleardoublepage
-        \else
-          \clearpage
-        \fi
-        \thispagestyle{plain}%
-        \if at twocolumn
-          \onecolumn
-          \@tempswatrue
-        \else
-          \@tempswafalse
-        \fi
-        \null\vfil
-       \tag_tool:n {sec-start-part=#2}
-        \bool_lazy_any:nT
-          {
-            { #1 }
-            {
-              \int_compare_p:nNn {\c at secnumdepth}<{-1}
-            }
-            {
-              %in book target also needed in frontmatter
-              \bool_lazy_and_p:nn
-                { \cs_if_exist_p:c { @mainmattertrue } }
-                { ! \legacy_if_p:n { @mainmatter } }
-            }
-          }
-          {
-            \MakeLinkTarget[part]{}
-            \tl_if_blank:VF \@currentHref
-             {
-               \prop_gput:Nxx \g__tag_struct_dest_num_prop {\@currentHref}{\tag_get:n{struct_num}}
-             }
-          }
-        \IfBooleanTF
-          {#1}
-          { \@spart {#3} }
-          { \@part [#2]{#3} }
-        \tag_tool:n{sec-stop-part}
-      }
-    }
- }
-\def\hyper at nopatch@sectioning{}
-\cs_new_protected:Npn \@hyp at section@target at nnn #1 #2 #3 %#1 optarg #2 name/counter, #3 indent
- {
-   \makebox[0pt][l]
-     {
-       \skip_set:Nn \@tempskipa {#3}
-       \dim_compare:nNnF {\@tempskipa}<{0pt}{\kern-\@tempskipa}
-       \MakeLinkTarget#1{#2}
-     }
-   \tl_if_blank:VF \@currentHref
-    {
-      \prop_gput:Nxx \g__tag_struct_dest_num_prop {\@currentHref}{\tag_get:n{struct_num}}
-    }
- }
-\def\@startsection#1#2#3#4#5#6{%
-  \if at noskipsec \leavevmode \fi
-  \par
-  \@tempskipa #4\relax
-  \@afterindenttrue
-  \ifdim \@tempskipa <\z@
-    \@tempskipa -\@tempskipa \@afterindentfalse
-  \fi
-  \if at nobreak
-    \everypar{}%
-  \else
-    \addpenalty\@secpenalty\addvspace\@tempskipa
-  \fi
-  \tag_tool:n { sec-start=#1}%new
-  \@ifstar
-    {\@ssect{#3}{#4}{#5}{#6}}%
-    {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
-\cs_new_protected:Npn \@kernel at tag@hangfrom #1
-  {
-     \tagstructbegin{tag=\l__tag_para_tag_tl}
-     \tagstructbegin{tag=Lbl}
-     \setbox\@tempboxa
-       \hbox
-         {
-           \bool_lazy_and:nnT
-            {\tag_if_active_p:}
-            {\g__tag_mode_lua_bool}
-            {\tagmcbegin{tag=Lbl}}
-           {#1}
-         }
-   \tag_stop:n{hangfrom}
-   \hangindent \wd\@tempboxa\noindent
-   \tag_start:n{hangfrom}
-   \tagmcbegin{}\box\@tempboxa\tagmcend\tagstructend\tagmcbegin{}}
-\cs_new_protected:Npn \@kernel at tag@svsec
-  {
-    \tag_mc_end_push:
-    \tag_struct_begin:n{tag=Lbl}
-    \tag_mc_begin:n{}
-    \@svsec
-    \tag_mc_end:
-    \tag_struct_end:
-    \tag_mc_begin_pop:n{}
-  }
-\def\@sect#1#2#3#4#5#6[#7]#8{%
-  \ifnum #2>\c at secnumdepth
-    \def\@svsec{\@hyp at section@target at nnn{[section]}{}{#3}}
-  \else
-    \LinkTargetOff
-    \refstepcounter{#1}%
-    \LinkTargetOn
-    \protected at edef\@svsec{\@hyp at section@target at nnn{}{#1}{#3}\@seccntformat{#1}\relax}%
-  \fi
-  \@tempskipa #5\relax
-  \ifdim \@tempskipa>\z@
-    \begingroup
-    \tagtool{para-flattened=true} % or \bool_set_true\l__tag_para_flattened_bool
-      #6{%
-         \ifnum #2>\c at secnumdepth
-          \@hangfrom {\hskip #3\relax\@svsec}%
-         \else
-          \@kernel at tag@hangfrom{\hskip #3\relax\@svsec}%
-         \fi
-          \interlinepenalty \@M #8\@@par}%
-    \endgroup
-    \csname #1mark\endcsname{#7}%
-    \addcontentsline{toc}{#1}{%
-      \ifnum #2>\c at secnumdepth \else
-        \protect\numberline{\csname the#1\endcsname}%
-      \fi
-      #7}%
-  \else
-    \def\@svsechd{%
-      #6{\hskip #3\relax
-      \ifnum #2>\c at secnumdepth
-       \@svsec
-      \else
-       \@kernel at tag@svsec
-      \fi  #8}%
-      \csname #1mark\endcsname{#7}%
-      \addcontentsline{toc}{#1}{%
-        \ifnum #2>\c at secnumdepth \else
-          \protect\numberline{\csname the#1\endcsname}%
-        \fi
-        #7}}%
-  \fi
-  \@xsect{#5}}
-\def\@ssect#1#2#3#4#5{%
-  \@tempskipa #3\relax
-  \ifdim \@tempskipa>\z@
-    \begingroup
-    \tagtool{para-flattened=true}
-      #4{%
-        \@hangfrom{\hskip #1\relax\@hyp at section@target at nnn{[section]}{}{#1}}%
-          \interlinepenalty \@M #5\@@par}%
-    \endgroup
-  \else
-    \def\@svsechd{#4{\hskip #1\relax\@hyp at section@target at nnn{[section]}{}{#3}\relax #5}}%
-  \fi
-  \@xsect{#3}}
-\def\@xsect#1{%
-  \@tempskipa #1\relax
-  \ifdim \@tempskipa>\z@
-    \par \nobreak
-    \vskip \@tempskipa
-    \tag_tool:n {restore-para}
-    \@afterheading
-  \else
-    \@nobreakfalse
-    \global\@noskipsectrue
-    \everypar{%
-      \if at noskipsec
-        \global\@noskipsecfalse
-       {\setbox\z@\lastbox}%
-        \clubpenalty\@M
-        \begingroup \@svsechd \endgroup
-        \unskip
-        \tag_tool:n {sec-split-para}
-        \@tempskipa #1\relax
-        \hskip -\@tempskipa
-      \else
-        \clubpenalty \@clubpenalty
-        \everypar{}%
-      \fi}%
-  \fi
-  \ignorespaces}
-
-\endinput
-%%
-%% End of file `latex-lab-testphase-sec-tagging.sty'.

Added: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-sec.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-sec.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-sec.sty	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,412 @@
+%%
+%% This is file `latex-lab-testphase-sec.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% latex-lab-sec.dtx  (with options: `package')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright 2021-2023 LaTeX Project
+%% 
+%% This file was generated from file(s) of the  `LaTeX-lab Bundle'.
+%% ------------------------------------------------------------------------------------
+%% 
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008 or later.
+%% 
+%% This file may only be distributed together with a copy of the LaTeX
+%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle'
+%% without such generated files.
+%% 
+%% The newest sources can be found below
+%% 
+%%    https://github.com/latex3/latex2e/required/latex-lab
+%% 
+%% where one can also log issues in case there are any.
+%% 
+%% 
+%% File: latex-lab-sec.dtx (C) Copyright 2022-2023 LaTeX Project
+\ProvidesExplPackage {latex-lab-testphase-sec} {2023-05-20} {0.81}
+  {Code related to the tagging of sectioning commands}
+\RequirePackage{latex-lab-kernel-changes}
+\seq_new:N   \g__tag_sec_stack_seq
+\seq_gpush:Nn\g__tag_sec_stack_seq {{Document}{-100}}
+\bool_new:N     \l__tag_sec_Sect_bool
+\bool_set_true:N\l__tag_sec_Sect_bool
+
+\cs_new_protected:Npn\__tag_sec_begin:nn #1 #2 %#1 level #2 keyval
+  {
+    \tag_struct_begin:n
+      {
+         tag= {\int_compare:nNnTF {#1}={-1}{Part}{Sect}}
+        ,#2
+      }
+    \seq_gpush:Nx \g__tag_sec_stack_seq {{\g__tag_struct_tag_tl}{\int_eval:n{#1}}}
+  }
+\msg_new:nnn { tag } {wrong-sect-nesting}
+  {
+    The~structure~#1~can~not~be~closed.\\
+    It~is~not~equal~to~the~current~structure~#2~on~the~main~stack
+  }
+
+\cs_new_protected:Npn\__tag_sec_end:n #1 % #1 level
+  {
+    \seq_get:NN \g__tag_sec_stack_seq \l__tag_tmpa_tl
+    \int_compare:nNnT {#1}<{\exp_last_unbraced:NV\use_ii:nn\l__tag_tmpa_tl+1}
+      {
+        \seq_get:NN\g__tag_struct_tag_stack_seq \l__tag_tmpb_tl
+        \exp_args:Nee
+          \tl_if_eq:nnTF
+            {\exp_last_unbraced:NV\use_i:nn\l__tag_tmpa_tl}
+            {\exp_last_unbraced:NV\use_i:nn\l__tag_tmpb_tl}
+            {
+              \seq_gpop:NN \g__tag_sec_stack_seq \l__tag_tmpa_tl
+              \tag_struct_end:
+              \__tag_sec_end:n {#1}
+            }
+            {
+              \msg_warning:nnxx {tag}{wrong-sect-nesting}
+               { \exp_last_unbraced:NV\use_i:nn \l__tag_tmpa_tl }
+               { \exp_last_unbraced:NV\use_i:nn \l__tag_tmpb_tl }
+            }
+      }
+  }
+
+\cs_new_protected:Npn \__tag_tool_para_split:
+  {
+    \tag_mc_end:
+    \tag_struct_end:
+    \tag_struct_begin:n{tag=\l__tag_para_tag_default_tl}
+    \tag_mc_begin:n{}
+    \__tag_setup_restore_para_default:
+  }
+
+\cs_new_protected:Npn \__tag_setup_restore_para_default:
+  {
+    \tl_set:Nn \l__tag_para_main_tag_tl {text-unit}
+    \tl_set_eq:NN\l__tag_para_tag_tl\l__tag_para_tag_default_tl
+  }
+\cs_new_protected:Npn \__tag_sec_end_display:
+  {
+    \tag_struct_end: %P = Hn
+    \__tag_setup_restore_para_default:
+  }
+\hook_gput_code:nnn{tagpdf/finish/before}{tagpdf/sec}{\__tag_sec_end:n{-10}}
+\hook_gset_rule:nnnn {tagpdf/finish/before}{tagpdf/sec}{before}{tagpdf}
+\AddToHook{cmd/frontmatter/before}{\__tag_sec_end:n{-10}}
+\AddToHook{cmd/mainmatter/before} {\__tag_sec_end:n{-10}}
+\AddToHook{cmd/backmatter/before} {\__tag_sec_end:n{-10}}
+\AddToHook{cmd/appendix/before}   {\__tag_sec_end:n{-10}}
+\cs_if_free:NT \tag_tool:n
+ {
+   \cs_new_protected:Npn \tag_tool:n #1
+    {
+      \tag_if_active:T { \keys_set:nn {tag / tool}{#1} }
+    }
+   \cs_set_eq:NN\tagtool\tag_tool:n
+ }
+\keys_define:nn { tag / tool}
+  {
+    ,sec-start-part .code:n =
+      {
+        \bool_if:NT\l__tag_sec_Sect_bool
+          {
+            \__tag_sec_end:n   {-1}
+            \__tag_sec_begin:nn{-1}{tag=Part}
+          }
+         \tag_struct_begin:n{tag=part,title=#1}
+         \tl_set:Nn\l__tag_para_main_tag_tl {NonStruct}
+         \tl_set:Nn\l__tag_para_tag_tl {Span}
+      }
+    ,sec-stop-part .code:n = {\__tag_sec_end_display:}
+    ,sec-start-chapter .code:n =
+     {
+       \bool_if:NT\l__tag_sec_Sect_bool
+         {
+           \__tag_sec_end:n   {0}
+           \__tag_sec_begin:nn{0}{tag=Sect}
+         }
+        \tag_struct_begin:n{tag=chapter,title=#1}
+        \tl_set:Nn\l__tag_para_main_tag_tl {NonStruct}
+        \tl_set:Nn\l__tag_para_tag_tl {Span}
+     }
+    ,sec-stop-chapter .meta:n = { sec-stop-part}
+    ,sec-start .code:n = % #1 is a name like "section"
+      {
+        \bool_if:NT\l__tag_sec_Sect_bool
+          {
+            \__tag_sec_end:n    {\cs_if_exist_use:c{toclevel@#1}+0}
+            \__tag_sec_begin:nn {\cs_if_exist_use:c{toclevel@#1}+0}{tag=Sect}
+          }
+        \tl_set:Nn\l__tag_para_tag_tl{#1}
+      }
+    ,sec-start .value_required:n = true
+    ,sec-split-para .code:n = {\__tag_tool_para_split:}
+    ,restore-para .code:n = {\__tag_setup_restore_para_default:}
+    ,sec-stop .code:n =
+      {
+        \par\__tag_sec_end:n   {\cs_if_exist_use:c{toclevel@#1}+0}
+      }
+    ,sec-stop .value_required:n = true
+    ,sec-add-grouping .bool_set:N = \l__tag_sec_Sect_bool
+  }
+\AddToHook{class/after}
+ {
+  \@ifundefined{chapter}
+    {
+     \RenewDocumentCommand\part{ s O{#3} m }
+      {
+        \if at noskipsec \leavevmode \fi
+        \par
+        \addvspace{4ex}%
+        \@afterindentfalse
+        % tagging start commands
+        \tag_tool:n {sec-start-part=#2}
+        % end tagging start commands
+        \bool_lazy_any:nT
+          {
+            { #1 }
+            {
+              \int_compare_p:nNn {\c at secnumdepth}<{-1}
+            }
+          }
+          {
+            \MakeLinkTarget[part]{}
+          }
+        \IfBooleanTF
+          {#1}
+          { \@spart {#3} }
+          { \@part [#2]{#3} }
+       \tag_tool:n {sec-stop-part}
+      }
+    }
+    {
+     \RenewDocumentCommand\chapter{ s O{#3} m }
+      {
+        \if at openright\cleardoublepage\else\clearpage\fi
+        \thispagestyle{plain}%
+        \global\@topnum\z@
+        \@afterindentfalse
+        \tag_tool:n { sec-start-chapter= #2 }
+        \bool_lazy_any:nT
+          {
+            { #1 }
+            {
+              \int_compare_p:nNn {\c at secnumdepth}<{0}
+            }
+            {
+              %in book target also needed in frontmatter
+              \bool_lazy_and_p:nn
+                { \cs_if_exist_p:c { @mainmattertrue } }
+                { ! \legacy_if_p:n { @mainmatter } }
+            }
+          }
+          {
+            \MakeLinkTarget[chapter]{}
+            %todo public function for this update!
+            \tl_if_blank:VF \@currentHref
+              {
+                \prop_gput:Nxx \g__tag_struct_dest_num_prop {\@currentHref}{\tag_get:n{struct_num}}
+              }
+          }
+        \IfBooleanTF
+          {#1}
+          { \@schapter {#3} }
+          { \@chapter [#2]{#3} }
+        \tag_tool:n {sec-stop-chapter}
+      }
+     \RenewDocumentCommand\part{ s O{#3} m }
+      {
+        \if at openright
+          \cleardoublepage
+        \else
+          \clearpage
+        \fi
+        \thispagestyle{plain}%
+        \if at twocolumn
+          \onecolumn
+          \@tempswatrue
+        \else
+          \@tempswafalse
+        \fi
+        \null\vfil
+       \tag_tool:n {sec-start-part=#2}
+        \bool_lazy_any:nT
+          {
+            { #1 }
+            {
+              \int_compare_p:nNn {\c at secnumdepth}<{-1}
+            }
+            {
+              %in book target also needed in frontmatter
+              \bool_lazy_and_p:nn
+                { \cs_if_exist_p:c { @mainmattertrue } }
+                { ! \legacy_if_p:n { @mainmatter } }
+            }
+          }
+          {
+            \MakeLinkTarget[part]{}
+            \tl_if_blank:VF \@currentHref
+             {
+               \prop_gput:Nxx \g__tag_struct_dest_num_prop {\@currentHref}{\tag_get:n{struct_num}}
+             }
+          }
+        \IfBooleanTF
+          {#1}
+          { \@spart {#3} }
+          { \@part [#2]{#3} }
+        \tag_tool:n{sec-stop-part}
+      }
+    }
+ }
+\def\hyper at nopatch@sectioning{}
+\cs_new_protected:Npn \@hyp at section@target at nnn #1 #2 #3 %#1 optarg #2 name/counter, #3 indent
+ {
+   \makebox[0pt][l]
+     {
+       \skip_set:Nn \@tempskipa {#3}
+       \dim_compare:nNnF {\@tempskipa}<{0pt}{\kern-\@tempskipa}
+       \MakeLinkTarget#1{#2}
+     }
+   \tl_if_blank:VF \@currentHref
+    {
+      \prop_gput:Nxx \g__tag_struct_dest_num_prop {\@currentHref}{\tag_get:n{struct_num}}
+    }
+ }
+\def\@startsection#1#2#3#4#5#6{%
+  \if at noskipsec \leavevmode \fi
+  \par
+  \@tempskipa #4\relax
+  \@afterindenttrue
+  \ifdim \@tempskipa <\z@
+    \@tempskipa -\@tempskipa \@afterindentfalse
+  \fi
+  \if at nobreak
+    \everypar{}%
+  \else
+    \addpenalty\@secpenalty\addvspace\@tempskipa
+  \fi
+  \tag_tool:n { sec-start=#1}%new
+  \@ifstar
+    {\@ssect{#3}{#4}{#5}{#6}}%
+    {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
+\cs_new_protected:Npn \@kernel at tag@hangfrom #1
+  {
+     \tagstructbegin{tag=\l__tag_para_tag_tl}
+     \tagstructbegin{tag=Lbl}
+     \setbox\@tempboxa
+       \hbox
+         {
+           \bool_lazy_and:nnT
+            {\tag_if_active_p:}
+            {\g__tag_mode_lua_bool}
+            {\tagmcbegin{tag=Lbl}}
+           {#1}
+         }
+   \tag_stop:n{hangfrom}
+   \hangindent \wd\@tempboxa\noindent
+   \tag_start:n{hangfrom}
+   \tagmcbegin{}\box\@tempboxa\tagmcend\tagstructend\tagmcbegin{}}
+\cs_new_protected:Npn \@kernel at tag@svsec
+  {
+    \tag_mc_end_push:
+    \tag_struct_begin:n{tag=Lbl}
+    \tag_mc_begin:n{}
+    \@svsec
+    \tag_mc_end:
+    \tag_struct_end:
+    \tag_mc_begin_pop:n{}
+  }
+\def\@sect#1#2#3#4#5#6[#7]#8{%
+  \ifnum #2>\c at secnumdepth
+    \def\@svsec{\@hyp at section@target at nnn{[section]}{}{#3}}
+  \else
+    \LinkTargetOff
+    \refstepcounter{#1}%
+    \LinkTargetOn
+    \protected at edef\@svsec{\@hyp at section@target at nnn{}{#1}{#3}\@seccntformat{#1}\relax}%
+  \fi
+  \@tempskipa #5\relax
+  \ifdim \@tempskipa>\z@
+    \begingroup
+    \tagtool{para-flattened=true} % or \bool_set_true\l__tag_para_flattened_bool
+      #6{%
+         \ifnum #2>\c at secnumdepth
+          \@hangfrom {\hskip #3\relax\@svsec}%
+         \else
+          \@kernel at tag@hangfrom{\hskip #3\relax\@svsec}%
+         \fi
+          \interlinepenalty \@M #8\@@par}%
+    \endgroup
+    \csname #1mark\endcsname{#7}%
+    \addcontentsline{toc}{#1}{%
+      \ifnum #2>\c at secnumdepth \else
+        \protect\numberline{\csname the#1\endcsname}%
+      \fi
+      #7}%
+  \else
+    \def\@svsechd{%
+      #6{\hskip #3\relax
+      \ifnum #2>\c at secnumdepth
+       \@svsec
+      \else
+       \@kernel at tag@svsec
+      \fi  #8}%
+      \csname #1mark\endcsname{#7}%
+      \addcontentsline{toc}{#1}{%
+        \ifnum #2>\c at secnumdepth \else
+          \protect\numberline{\csname the#1\endcsname}%
+        \fi
+        #7}}%
+  \fi
+  \@xsect{#5}}
+\def\@ssect#1#2#3#4#5{%
+  \@tempskipa #3\relax
+  \ifdim \@tempskipa>\z@
+    \begingroup
+    \tagtool{para-flattened=true}
+      #4{%
+        \@hangfrom{\hskip #1\relax\@hyp at section@target at nnn{[section]}{}{#1}}%
+          \interlinepenalty \@M #5\@@par}%
+    \endgroup
+  \else
+    \def\@svsechd{#4{\hskip #1\relax\@hyp at section@target at nnn{[section]}{}{#3}\relax #5}}%
+  \fi
+  \@xsect{#3}}
+\def\@xsect#1{%
+  \@tempskipa #1\relax
+  \ifdim \@tempskipa>\z@
+    \par \nobreak
+    \vskip \@tempskipa
+    \tag_tool:n {restore-para}
+    \@afterheading
+  \else
+    \@nobreakfalse
+    \global\@noskipsectrue
+    \everypar{%
+      \if at noskipsec
+        \global\@noskipsecfalse
+       {\setbox\z@\lastbox}%
+        \clubpenalty\@M
+        \begingroup \@svsechd \endgroup
+        \unskip
+        \tag_tool:n {sec-split-para}
+        \@tempskipa #1\relax
+        \hskip -\@tempskipa
+      \else
+        \clubpenalty \@clubpenalty
+        \everypar{}%
+      \fi}%
+  \fi
+  \ignorespaces}
+
+\endinput
+%%
+%% End of file `latex-lab-testphase-sec.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-sec.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-toc-tagging.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-toc-tagging.sty	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-toc-tagging.sty	2023-05-26 21:07:56 UTC (rev 67224)
@@ -1,565 +0,0 @@
-%%
-%% This is file `latex-lab-testphase-toc-tagging.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% latex-lab-toc-tagging-functions.dtx  (with options: `header')
-%% latex-lab-toc-kernel-changes.dtx  (with options: `package')
-%% latex-lab-toc-tagging-functions.dtx  (with options: `package')
-%% latex-lab-toc-hyperref-changes.dtx  (with options: `package')
-%% 
-%% This is a generated file.
-%% 
-%% Copyright 2021-2023 LaTeX Project
-%% 
-%% This file was generated from file(s) of the  `LaTeX-lab Bundle'.
-%% ------------------------------------------------------------------------------------
-%% 
-%% It may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3c
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
-%%    http://www.latex-project.org/lppl.txt
-%% and version 1.3c or later is part of all distributions of LaTeX
-%% version 2008 or later.
-%% 
-%% This file may only be distributed together with a copy of the LaTeX
-%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle'
-%% without such generated files.
-%% 
-%% The newest sources can be found below
-%% 
-%%    https://github.com/latex3/latex2e/required/latex-lab
-%% 
-%% where one can also log issues in case there are any.
-%% 
-%% 
-%% File: toc-tagging-functions.dtx (C) Copyright 2022-2023 LaTeX Project
-\ProvidesExplPackage {latex-lab-testphase-toc-tagging} {2023-02-10} {0.81}
-  { commands related to the tagging of toc-like lists}
-%% File: toc-kernel-functions.dtx (C) Copyright 2022-2023 LaTeX Project
-\RequirePackage{latex-lab-kernel-changes}
-\def\@contentsline at cfgpoint@before#1#2#3#4{}
-\def\@contentsline at cfgpoint@after#1#2#3#4{}
-\def\@contentsline at arg@one{}%level
-\def\@contentsline at arg@two{}%text
-\def\@contentsline at arg@three{}%page
-\def\@contentsline at arg@four{}%destination
-\def\contentsline#1#2#3#4%
-  {%
-    \def\@contentsline at arg@one{#1}%level
-    \def\@contentsline at arg@two{#2}%text
-    \def\@contentsline at arg@three{#3}%page
-    \def\@contentsline at arg@four{#4}%destination
-    \@contentsline at cfgpoint@before{#1}{#2}{#3}{#4}%
-    %\gdef\@contentsline at destination{#4}%
-    \csname l@#1\endcsname{#2}{#3}%
-    \@contentsline at cfgpoint@after{#1}{#2}{#3}{#4}%
-  }
-\NewHook{cmd/addcontentsline/before}
-\def\addcontentsline#1#2#3{% toc extension, type, tag
-    \def\addcontentsline at arg@one{#1}% name??
-    \def\addcontentsline at arg@two{#2}%
-    \def\addcontentsline at arg@three{#3}%
-    \UseHook{cmd/addcontentsline/before}%
-    \addtocontents{#1}{%
-      \protect\contentsline{#2}{#3}{\thepage}{\@currentHref}\protected at file@percent
-    }}
-\def\@starttoc at cfgpoint@before#1{}
-\def\@starttoc at cfgpoint@after#1{}
-\def\@starttoc#1{%
-  \begingroup
-    \makeatletter
-    \@starttoc at cfgpoint@before{#1}%
-    \@input{\jobname.#1}%
-    \@starttoc at cfgpoint@after{#1}
-    \if at filesw
-      \expandafter\newwrite\csname tf@#1\endcsname
-      \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
-    \fi
-    \@nobreakfalse
-  \endgroup}
-\NewMirroredHookPair{contentsline/number/before}{contentsline/number/after}%
-\NewMirroredHookPair{contentsline/text/before}{contentsline/text/after}%
-\NewMirroredHookPair{contentsline/page/before}{contentsline/page/after}%
-\def\@dottedtocline at cfgpoint@leaders#1{#1}
-
-\def\@dottedtocline#1#2#3#4#5{%
-  \ifnum #1>\c at tocdepth \else
-    \vskip \z@ \@plus.2\p@
-    {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
-     \parindent #2\relax\@afterindenttrue
-     \interlinepenalty\@M
-     \leavevmode
-     \@tempdima #3\relax
-     \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
-     \UseHook{contentsline/text/before}%
-     \csname contentsline at text@#1 at format\endcsname{#4}%
-     \UseHook{contentsline/text/after}%
-     \nobreak
-     \@dottedtocline at cfgpoint@leaders{%
-       \leaders\hbox{$\m at th
-         \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
-          mu$}\hfill}%
-     \nobreak
-     \hb at xt@\@pnumwidth{\hfil\normalfont \normalcolor
-     \UseHook{contentsline/page/before}%
-     #5%
-     \UseHook{contentsline/page/after}%
-                        \kern-\p@\kern\p@}%
-     \par}%
-  \fi}
-\def\numberline#1{\hb at xt@\@tempdima{%
-  \UseHook{contentsline/number/before}%
-  #1\hfil
-  \UseHook{contentsline/number/after}%
-  }}
-\AddToHook{class/article/after}
- {
-  \renewcommand*\l at part[2]{%
-  \ifnum \c at tocdepth >-2\relax
-    \addpenalty\@secpenalty
-    \addvspace{2.25em \@plus\p@}%
-    \setlength\@tempdima{3em}%
-    \begingroup
-      \parindent \z@ \rightskip \@pnumwidth
-      \parfillskip -\@pnumwidth
-      {\leavevmode
-       \large \bfseries
-       \UseHook{contentsline/text/before}%
-       \csname contentsline at text@-1 at format\endcsname{#1}%
-       \UseHook{contentsline/text/after}%
-       \hfil
-       \hb at xt@\@pnumwidth{\hss
-       \UseHook{contentsline/page/before}%
-       #2%
-       \UseHook{contentsline/page/after}%
-                          \kern-\p@\kern\p@}}\par
-       \nobreak
-    \endgroup
-  \fi}
-\renewcommand*\l at section[2]{%
-  \ifnum \c at tocdepth >\z@
-    \addpenalty\@secpenalty
-    \addvspace{1.0em \@plus\p@}%
-    \setlength\@tempdima{1.5em}%
-    \begingroup
-      \parindent \z@ \rightskip \@pnumwidth
-      \parfillskip -\@pnumwidth
-      \leavevmode \bfseries
-      \advance\leftskip\@tempdima
-      \hskip -\leftskip
-       \UseHook{contentsline/text/before}%
-       \csname contentsline at text@1 at format\endcsname{#1}%
-       \UseHook{contentsline/text/after}%
-       \nobreak\hfil
-      \nobreak\hb at xt@\@pnumwidth{\hss
-      \UseHook{contentsline/page/before}%
-       #2%
-      \UseHook{contentsline/page/after}%
-      \kern-\p@\kern\p@}\par
-    \endgroup
-  \fi}
- }
-\AddToHook{class/report/after}
- {
-    \renewcommand*\l at part[2]{%
-     \ifnum \c at tocdepth >-2\relax
-       \addpenalty{-\@highpenalty}%
-       \addvspace{2.25em \@plus\p@}%
-       \setlength\@tempdima{3em}%
-       \begingroup
-         \parindent \z@ \rightskip \@pnumwidth
-         \parfillskip -\@pnumwidth
-         {\leavevmode
-          \large \bfseries
-          \UseHook{contentsline/text/before}%
-          \csname contentsline at text@-1 at format\endcsname{#1}%
-          \UseHook{contentsline/text/after}%
-          \hfil
-          \hb at xt@\@pnumwidth{\hss
-          \UseHook{contentsline/page/before}%
-          #2%
-          \UseHook{contentsline/page/after}%
-                             \kern-\p@\kern\p@}}\par
-          \nobreak
-       \endgroup
-     \fi}
-   \renewcommand*\l at chapter[2]{%
-     \ifnum \c at tocdepth >\m at ne
-       \addpenalty{-\@highpenalty}%
-       \vskip 1.0em \@plus\p@
-       \setlength\@tempdima{1.5em}%
-       \begingroup
-         \parindent \z@ \rightskip \@pnumwidth
-         \parfillskip -\@pnumwidth
-         \leavevmode \bfseries
-         \advance\leftskip\@tempdima
-         \hskip -\leftskip
-         \UseHook{contentsline/text/before}%
-         \csname contentsline at text@0 at format\endcsname
-           {#1}%
-         \UseHook{contentsline/text/after}%
-          \nobreak\hfil
-         \nobreak\hb at xt@\@pnumwidth{\hss
-          \UseHook{contentsline/page/before}%
-          #2%
-          \UseHook{contentsline/page/after}%
-                                    \kern-\p@\kern\p@}\par
-         \penalty\@highpenalty
-       \endgroup
-     \fi}
- }
-\AddToHook{class/book/after}
- {
-    \renewcommand*\l at part[2]{%
-     \ifnum \c at tocdepth >-2\relax
-       \addpenalty{-\@highpenalty}%
-       \addvspace{2.25em \@plus\p@}%
-       \setlength\@tempdima{3em}%
-       \begingroup
-         \parindent \z@ \rightskip \@pnumwidth
-         \parfillskip -\@pnumwidth
-         {\leavevmode
-          \large \bfseries
-          \UseHook{contentsline/text/before}%
-          \csname contentsline at text@-1 at format\endcsname{#1}%
-          \UseHook{contentsline/text/after}%
-          \hfil
-          \hb at xt@\@pnumwidth{\hss
-          \UseHook{contentsline/page/before}%
-          #2%
-          \UseHook{contentsline/page/after}%
-                             \kern-\p@\kern\p@}}\par
-          \nobreak
-       \endgroup
-     \fi}
-   \renewcommand*\l at chapter[2]{%
-     \ifnum \c at tocdepth >\m at ne
-       \addpenalty{-\@highpenalty}%
-       \vskip 1.0em \@plus\p@
-       \setlength\@tempdima{1.5em}%
-       \begingroup
-         \parindent \z@ \rightskip \@pnumwidth
-         \parfillskip -\@pnumwidth
-         \leavevmode \bfseries
-         \advance\leftskip\@tempdima
-         \hskip -\leftskip
-         \UseHook{contentsline/text/before}%
-         \csname contentsline at text@0 at format\endcsname
-           {#1}%
-         \UseHook{contentsline/text/after}%
-          \nobreak\hfil
-         \nobreak\hb at xt@\@pnumwidth{\hss
-          \UseHook{contentsline/page/before}%
-          #2%
-          \UseHook{contentsline/page/after}%
-                                    \kern-\p@\kern\p@}\par
-         \penalty\@highpenalty
-       \endgroup
-     \fi}
- }
-
-%% File: toc-tagging-functions.dtx (C) Copyright 2022-2023 LaTeX Project
-\tl_new:N \l__tag_toc_tmpa_tl
-\AddToHook{cmd/refstepcounter/after}
- {
-   \tl_if_blank:VF \@currentHref
-    {
-      \prop_if_exist:NT \g__tag_struct_dest_num_prop
-        {
-         \prop_gput:Nxx \g__tag_struct_dest_num_prop {\@currentHref}{\tag_get:n{struct_num}}
-        }
-    }
- }
-\AddToHook{cmd/H at refstepcounter/after}
- {
-   \tl_if_blank:VF \@currentHref
-    {
-      \prop_if_exist:NT \g__tag_struct_dest_num_prop
-        {
-          \prop_gput:Nxx \g__tag_struct_dest_num_prop {\@currentHref}{\tag_get:n{struct_num}}
-        }
-    }
- }
-\msg_new:nnn { tag } {struct-dest-unknown}
- {
-   Destination~#1~has~no~related~structure.\\
-   /Ref~for~structure~#2~not~updated
- }
-
-\cs_new_protected:Npn \g__tag_struct_ref_by_dest:
-  {
-    \prop_map_inline:Nn\g__tag_struct_ref_by_dest_prop
-      {
-        \prop_get:NnNTF \g__tag_struct_dest_num_prop {##2} \l__tag_tmpa_tl
-          {
-            \__tag_struct_gput_data_ref:ee
-              { ##1 }
-              { \tag_struct_object_ref:e{ \l__tag_tmpa_tl }}
-          }
-          {
-            \msg_warning:nnnn {tag}{struct-dest-unknown}{##2}{ ##1}
-          }
-      }
-  }
-\hook_gput_code:nnn {tagpdf/finish/before}{tagpdf/struct/Ref}{\g__tag_struct_ref_by_dest:}
-\int_new:N \g__tag_toc_level_int
-\seq_new:N \g__tag_toc_stack_seq
-
-\cs_new_protected:Npn \__tag_toc_starttoc_init:n #1
- {
-    \bool_set_false:N \l__tag_para_bool
-    \seq_gclear:N \g__tag_toc_stack_seq
-    \int_gset:Nn  \g__tag_toc_level_int {-100}
-    \tag_struct_begin:n{tag=TOC,title=#1}
- }
-\cs_set_protected:Npn\@starttoc at cfgpoint@before#1
-  {
-    \__tag_toc_starttoc_init:n{#1}
-  }
-\cs_new_protected:Npn \__tag_toc_starttoc_finalize:
- {
-    \int_step_inline:nn
-      {\seq_count:N \g__tag_toc_stack_seq }
-      {\tag_struct_end:}
-    \tag_struct_end:
-    \seq_gclear:N \g__tag_toc_stack_seq
- }
-\cs_set_protected:Npn\@starttoc at cfgpoint@after#1
-  {
-    \__tag_toc_starttoc_finalize:
-  }
-
-\cs_new_protected:Npn \__tag_toc_end:n #1
- {
-   \seq_get:NNT\g__tag_toc_stack_seq \l__tag_toc_tmpa_tl
-     {
-       \bool_lazy_and:nnT
-         {
-           \str_if_eq_p:ee{\tl_head:N\l__tag_toc_tmpa_tl}{TOC}
-         }
-         {
-           \int_compare_p:nNn {#1}<{\tl_tail:N \l__tag_toc_tmpa_tl}
-         }
-         {
-           \seq_gpop:NN\g__tag_toc_stack_seq \l__tag_toc_tmpa_tl
-           \tag_struct_end:
-           \__tag_toc_end:n{#1}
-         }
-     }
- }
-\cs_generate_variant:Nn \__tag_toc_end:n {e}
-\cs_new_protected:Npn \__tag_toc_contentsline_begin:nnn #1 #2 #3 %#1 level, #2 content, #3 destination
-  {
-   \tag_if_active:T
-     {
-       \ExpandArgs{c}\providecommand { toclevel@#1 }{ 1 } %  just in case ...
-       \int_compare:nNnF { \use:c{toclevel@#1} } > {\use:c{c at tocdepth}}
-        {
-          \bool_lazy_and:nnT
-            { \int_compare_p:nNn { \g__tag_toc_level_int } > {-100} }
-            { \int_compare_p:nNn { \use:c{toclevel@#1} }   > { \g__tag_toc_level_int } }
-            {
-              \seq_gpush:Nx \g__tag_toc_stack_seq {{TOC}\use:c{toclevel@#1}}
-              \tag_struct_begin:n{tag=TOC}
-            }
-          \int_compare:nNnT
-            { \use:c{toclevel@#1} } < { \g__tag_toc_level_int }
-            {
-              \__tag_toc_end:e { \use:c{toclevel@#1} }
-            }
-          \int_gset:Nn \g__tag_toc_level_int { \use:c{toclevel@#1} }
-          \group_begin:
-           \text_declare_expand_equivalent:Nn \numberline \use_none:n
-           \exp_args:Nx \tag_struct_begin:n{tag=TOCI,title={\text_purify:n {#2}}}
-           \prop_gput:Nxx \g__tag_struct_ref_by_dest_prop
-             { \tag_get:n {struct_num} }{#3}
-           \seq_gpush:Nx \g__tag_toc_stack_seq {{TOCI}\use:c{toclevel@#1}}
-          \group_end:
-       }
-    }
-  }
-\cs_set_protected:Npn\@contentsline at cfgpoint@before#1#2#3#4
-  {
-    \__tag_toc_contentsline_begin:nnn {#1}{#2}{#4}
-  }
-\msg_new:nnn {tag}{toc-no-TOCI}{Missing~TOCI~structure~on~toc~stack}
-
-\cs_new_protected:Npn \__tag_toc_contentsline_end:n #1 %#1 level name
-  {
-    \int_compare:nNnF { \use:c{toclevel@#1} } > {\use:c{c at tocdepth}}
-      {
-        \seq_gpop:NNT \g__tag_toc_stack_seq\l__tag_tmpa_tl
-          {
-            \str_if_eq:eeTF{\tl_head:N\l__tag_tmpa_tl}{TOCI}
-             {
-               \tag_struct_end:
-             }
-             {
-               \msg_warning:nn{tag}{toc-no-TOCI}
-             }
-          }
-      }
-  }
-\cs_set_protected:Npn \@contentsline at cfgpoint@after #1#2#3#4
- {
-   \__tag_toc_contentsline_end:n {#1}
- }
-\AddToHook{contentsline/text/before}[tagpdf]{%
-  \tag_struct_begin:n{tag=Reference}%
-  \tag_mc_begin:n{tag=Reference}}
-\AddToHook{contentsline/text/after}[tagpdf]{%
-  \tag_mc_end:}
-\AddToHook{contentsline/page/before}[tagpdf]{%
-  \tag_mc_begin:n{tag=Reference}}
-\AddToHook{contentsline/page/after}[tagpdf]{%
-  \tag_mc_end:
-  \tag_struct_end:} %Reference
-\AddToHook{contentsline/number/before}[tagpdf]{%
-  \tag_mc_end:
-  \tag_struct_begin:n{tag=Lbl}%
-  \tag_mc_begin:n{tag=Lbl}}
-\AddToHook{contentsline/number/after}[tagpdf]{%
-  \tag_mc_end:
-  \tag_struct_end:
-  \tag_mc_begin:n{tag=Reference}}
-\def\@dottedtocline at cfgpoint@leaders#1{%
- \tag_mc_begin:n{artifact}\nobreak#1\nobreak\tag_mc_end:}
-
-%% File: toc-hyperref-changes.dtx (C) Copyright 2022-2023 LaTeX Project
-\def\hyper at nopatch@toc{}
-\AddToHook{package/hyperref/after}
- {
-   \@ifpackagelater{hyperref}{2023-02-07}{}
-   {\PackageWarning{latex-lab-testphase-toc-tagging}{hyperref too old}{}}
- }
-\ExplSyntaxOn
-\AddToHook{package/hyperref/after}
- {
-   \AddToHook{contentsline/text/before}[hyp]
-     {
-       \tl_if_blank:VF \@contentsline at arg@two%text
-        {
-          \tl_if_blank:VF\@contentsline at arg@four%destination
-            {
-              \int_case:nnF {\Hy at linktoc}
-                {
-                  {0}{} %none
-                  {1}{\hyper at linkstart{link}{\@contentsline at arg@four}} %section
-                  {2}{} %page
-                }
-                {\hyper at linkstart{link}{\@contentsline at arg@four}} %all
-            }
-          }
-      }
-    \AddToHook{contentsline/text/after}[hyp]
-      {
-        \tl_if_blank:VF \@contentsline at arg@two
-         {
-           \tl_if_blank:VF\@contentsline at arg@four
-             {
-               \int_case:nnF {\Hy at linktoc}
-                 {
-                   {0}{} %none
-                   {1}{\hyper at linkend} %section
-                   {2}{} %page
-                 }
-                 {\hyper at linkend} %all
-             } % none
-           }
-       }
-
-    \AddToHook{contentsline/page/before}[hyp]
-      {
-        \tl_if_blank:VF \@contentsline at arg@three
-         {
-           \tl_if_blank:VF\@contentsline at arg@two
-             {
-               \int_case:nnF {\Hy at linktoc}
-                 {
-                   {0}{} %none
-                   {1}{} %section
-                   {2}{\hyper at linkstart{link}{\@contentsline at arg@four}} %page
-                 }
-                 {\hyper at linkstart{link}{\@contentsline at arg@four}} %all
-             } % none
-           }
-       }
-    \AddToHook{contentsline/page/after}[hyp]
-      {
-        \tl_if_blank:VF \@contentsline at arg@three
-         {
-           \tl_if_blank:VF\@contentsline at arg@four
-             {
-               \int_case:nnF {\Hy at linktoc}
-                 {
-                   {0}{} %none
-                   {1}{} %section
-                   {2}{\hyper at linkend} %page
-                 }
-                 {\hyper at linkend} %all
-             } % none
-           }
-       }
-    \AddToHook{cmd/addcontentsline/before}[hyp]
-     {%
-       \ExpandArgs{ooo}
-       \Hy at addcontentsline@addbookmark
-         {\addcontentsline at arg@one}
-         {\addcontentsline at arg@two}
-         {\addcontentsline at arg@three}%
-     }
-   }
-\ExplSyntaxOff
-\newcommand\Hy at addcontentsline@addbookmark[3]%#1 toc type, #2 level, #3 content
-  {%
-   \ifx\@currentHref\@empty
-    \Hy at Warning{%
-      No destination for bookmark of \string\addcontentsline,%
-      \MessageBreak destination is added%
-     }%
-    \phantomsection
-  \fi
-  \begingroup
-    \expandafter\ifx\csname toclevel@#2\endcsname\relax
-      \begingroup
-        \def\Hy at tempa{#1}%
-        \ifx\Hy at tempa\Hy at bookmarkstype
-          \Hy at WarningNoLine{%
-            bookmark level for unknown #2 defaults to 0%
-          }%
-        \else
-          \Hy at Info{bookmark level for unknown #2 defaults to 0}%
-        \fi
-      \endgroup
-      \expandafter\gdef\csname toclevel@#2\endcsname{0}%
-    \fi
-    \edef\Hy at toclevel{\csname toclevel@#2\endcsname}%
-    \Hy at writebookmark{\csname the#2\endcsname}%
-      {#3}%
-      {\@currentHref}%
-      {\Hy at toclevel}%
-      {#1}%
-    \ifHy at verbose
-      \begingroup
-        \def\Hy at tempa{#3}%
-        \@onelevel at sanitize\Hy at tempa
-        \let\temp at online\on at line
-        \let\on at line\@empty
-        \Hy at Info{%
-          bookmark\temp at online:\MessageBreak
-          thecounter {\csname the#2\endcsname}\MessageBreak
-          text {\Hy at tempa}\MessageBreak
-          reference {\@currentHref}\MessageBreak
-          toclevel {\Hy at toclevel}\MessageBreak
-          type {#1}%
-        }%
-      \endgroup
-    \fi
-   \endgroup
-  }
-\endinput
-%%
-%% End of file `latex-lab-testphase-toc-tagging.sty'.

Added: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-toc.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-toc.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-toc.sty	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,565 @@
+%%
+%% This is file `latex-lab-testphase-toc.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% latex-lab-toc-tagging-functions.dtx  (with options: `header')
+%% latex-lab-toc-kernel-changes.dtx  (with options: `package')
+%% latex-lab-toc-tagging-functions.dtx  (with options: `package')
+%% latex-lab-toc-hyperref-changes.dtx  (with options: `package')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright 2021-2023 LaTeX Project
+%% 
+%% This file was generated from file(s) of the  `LaTeX-lab Bundle'.
+%% ------------------------------------------------------------------------------------
+%% 
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008 or later.
+%% 
+%% This file may only be distributed together with a copy of the LaTeX
+%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle'
+%% without such generated files.
+%% 
+%% The newest sources can be found below
+%% 
+%%    https://github.com/latex3/latex2e/required/latex-lab
+%% 
+%% where one can also log issues in case there are any.
+%% 
+%% 
+%% File: latex-lab-toc-tagging-functions.dtx (C) Copyright 2022-2023 LaTeX Project
+\ProvidesExplPackage {latex-lab-testphase-toc} {2023-05-20} {0.82}
+  { commands related to the tagging of toc-like lists}
+%% File: latex-lab-toc-kernel-functions.dtx (C) Copyright 2022-2023 LaTeX Project
+\RequirePackage{latex-lab-kernel-changes}
+\def\@contentsline at cfgpoint@before#1#2#3#4{}
+\def\@contentsline at cfgpoint@after#1#2#3#4{}
+\def\@contentsline at arg@one{}%level
+\def\@contentsline at arg@two{}%text
+\def\@contentsline at arg@three{}%page
+\def\@contentsline at arg@four{}%destination
+\def\contentsline#1#2#3#4%
+  {%
+    \def\@contentsline at arg@one{#1}%level
+    \def\@contentsline at arg@two{#2}%text
+    \def\@contentsline at arg@three{#3}%page
+    \def\@contentsline at arg@four{#4}%destination
+    \@contentsline at cfgpoint@before{#1}{#2}{#3}{#4}%
+    %\gdef\@contentsline at destination{#4}%
+    \csname l@#1\endcsname{#2}{#3}%
+    \@contentsline at cfgpoint@after{#1}{#2}{#3}{#4}%
+  }
+\NewHook{cmd/addcontentsline/before}
+\def\addcontentsline#1#2#3{% toc extension, type, tag
+    \def\addcontentsline at arg@one{#1}% name??
+    \def\addcontentsline at arg@two{#2}%
+    \def\addcontentsline at arg@three{#3}%
+    \UseHook{cmd/addcontentsline/before}%
+    \addtocontents{#1}{%
+      \protect\contentsline{#2}{#3}{\thepage}{\@currentHref}\protected at file@percent
+    }}
+\def\@starttoc at cfgpoint@before#1{}
+\def\@starttoc at cfgpoint@after#1{}
+\def\@starttoc#1{%
+  \begingroup
+    \makeatletter
+    \@starttoc at cfgpoint@before{#1}%
+    \@input{\jobname.#1}%
+    \@starttoc at cfgpoint@after{#1}
+    \if at filesw
+      \expandafter\newwrite\csname tf@#1\endcsname
+      \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
+    \fi
+    \@nobreakfalse
+  \endgroup}
+\NewMirroredHookPair{contentsline/number/before}{contentsline/number/after}%
+\NewMirroredHookPair{contentsline/text/before}{contentsline/text/after}%
+\NewMirroredHookPair{contentsline/page/before}{contentsline/page/after}%
+\def\@dottedtocline at cfgpoint@leaders#1{#1}
+
+\def\@dottedtocline#1#2#3#4#5{%
+  \ifnum #1>\c at tocdepth \else
+    \vskip \z@ \@plus.2\p@
+    {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
+     \parindent #2\relax\@afterindenttrue
+     \interlinepenalty\@M
+     \leavevmode
+     \@tempdima #3\relax
+     \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
+     \UseHook{contentsline/text/before}%
+     \csname contentsline at text@#1 at format\endcsname{#4}%
+     \UseHook{contentsline/text/after}%
+     \nobreak
+     \@dottedtocline at cfgpoint@leaders{%
+       \leaders\hbox{$\m at th
+         \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
+          mu$}\hfill}%
+     \nobreak
+     \hb at xt@\@pnumwidth{\hfil\normalfont \normalcolor
+     \UseHook{contentsline/page/before}%
+     #5%
+     \UseHook{contentsline/page/after}%
+                        \kern-\p@\kern\p@}%
+     \par}%
+  \fi}
+\def\numberline#1{\hb at xt@\@tempdima{%
+  \UseHook{contentsline/number/before}%
+  #1\hfil
+  \UseHook{contentsline/number/after}%
+  }}
+\AddToHook{class/article/after}
+ {
+  \renewcommand*\l at part[2]{%
+  \ifnum \c at tocdepth >-2\relax
+    \addpenalty\@secpenalty
+    \addvspace{2.25em \@plus\p@}%
+    \setlength\@tempdima{3em}%
+    \begingroup
+      \parindent \z@ \rightskip \@pnumwidth
+      \parfillskip -\@pnumwidth
+      {\leavevmode
+       \large \bfseries
+       \UseHook{contentsline/text/before}%
+       \csname contentsline at text@-1 at format\endcsname{#1}%
+       \UseHook{contentsline/text/after}%
+       \hfil
+       \hb at xt@\@pnumwidth{\hss
+       \UseHook{contentsline/page/before}%
+       #2%
+       \UseHook{contentsline/page/after}%
+                          \kern-\p@\kern\p@}}\par
+       \nobreak
+    \endgroup
+  \fi}
+\renewcommand*\l at section[2]{%
+  \ifnum \c at tocdepth >\z@
+    \addpenalty\@secpenalty
+    \addvspace{1.0em \@plus\p@}%
+    \setlength\@tempdima{1.5em}%
+    \begingroup
+      \parindent \z@ \rightskip \@pnumwidth
+      \parfillskip -\@pnumwidth
+      \leavevmode \bfseries
+      \advance\leftskip\@tempdima
+      \hskip -\leftskip
+       \UseHook{contentsline/text/before}%
+       \csname contentsline at text@1 at format\endcsname{#1}%
+       \UseHook{contentsline/text/after}%
+       \nobreak\hfil
+      \nobreak\hb at xt@\@pnumwidth{\hss
+      \UseHook{contentsline/page/before}%
+       #2%
+      \UseHook{contentsline/page/after}%
+      \kern-\p@\kern\p@}\par
+    \endgroup
+  \fi}
+ }
+\AddToHook{class/report/after}
+ {
+    \renewcommand*\l at part[2]{%
+     \ifnum \c at tocdepth >-2\relax
+       \addpenalty{-\@highpenalty}%
+       \addvspace{2.25em \@plus\p@}%
+       \setlength\@tempdima{3em}%
+       \begingroup
+         \parindent \z@ \rightskip \@pnumwidth
+         \parfillskip -\@pnumwidth
+         {\leavevmode
+          \large \bfseries
+          \UseHook{contentsline/text/before}%
+          \csname contentsline at text@-1 at format\endcsname{#1}%
+          \UseHook{contentsline/text/after}%
+          \hfil
+          \hb at xt@\@pnumwidth{\hss
+          \UseHook{contentsline/page/before}%
+          #2%
+          \UseHook{contentsline/page/after}%
+                             \kern-\p@\kern\p@}}\par
+          \nobreak
+       \endgroup
+     \fi}
+   \renewcommand*\l at chapter[2]{%
+     \ifnum \c at tocdepth >\m at ne
+       \addpenalty{-\@highpenalty}%
+       \vskip 1.0em \@plus\p@
+       \setlength\@tempdima{1.5em}%
+       \begingroup
+         \parindent \z@ \rightskip \@pnumwidth
+         \parfillskip -\@pnumwidth
+         \leavevmode \bfseries
+         \advance\leftskip\@tempdima
+         \hskip -\leftskip
+         \UseHook{contentsline/text/before}%
+         \csname contentsline at text@0 at format\endcsname
+           {#1}%
+         \UseHook{contentsline/text/after}%
+          \nobreak\hfil
+         \nobreak\hb at xt@\@pnumwidth{\hss
+          \UseHook{contentsline/page/before}%
+          #2%
+          \UseHook{contentsline/page/after}%
+                                    \kern-\p@\kern\p@}\par
+         \penalty\@highpenalty
+       \endgroup
+     \fi}
+ }
+\AddToHook{class/book/after}
+ {
+    \renewcommand*\l at part[2]{%
+     \ifnum \c at tocdepth >-2\relax
+       \addpenalty{-\@highpenalty}%
+       \addvspace{2.25em \@plus\p@}%
+       \setlength\@tempdima{3em}%
+       \begingroup
+         \parindent \z@ \rightskip \@pnumwidth
+         \parfillskip -\@pnumwidth
+         {\leavevmode
+          \large \bfseries
+          \UseHook{contentsline/text/before}%
+          \csname contentsline at text@-1 at format\endcsname{#1}%
+          \UseHook{contentsline/text/after}%
+          \hfil
+          \hb at xt@\@pnumwidth{\hss
+          \UseHook{contentsline/page/before}%
+          #2%
+          \UseHook{contentsline/page/after}%
+                             \kern-\p@\kern\p@}}\par
+          \nobreak
+       \endgroup
+     \fi}
+   \renewcommand*\l at chapter[2]{%
+     \ifnum \c at tocdepth >\m at ne
+       \addpenalty{-\@highpenalty}%
+       \vskip 1.0em \@plus\p@
+       \setlength\@tempdima{1.5em}%
+       \begingroup
+         \parindent \z@ \rightskip \@pnumwidth
+         \parfillskip -\@pnumwidth
+         \leavevmode \bfseries
+         \advance\leftskip\@tempdima
+         \hskip -\leftskip
+         \UseHook{contentsline/text/before}%
+         \csname contentsline at text@0 at format\endcsname
+           {#1}%
+         \UseHook{contentsline/text/after}%
+          \nobreak\hfil
+         \nobreak\hb at xt@\@pnumwidth{\hss
+          \UseHook{contentsline/page/before}%
+          #2%
+          \UseHook{contentsline/page/after}%
+                                    \kern-\p@\kern\p@}\par
+         \penalty\@highpenalty
+       \endgroup
+     \fi}
+ }
+
+%% File: latex-lab-toc-tagging-functions.dtx (C) Copyright 2022-2023 LaTeX Project
+\tl_new:N \l__tag_toc_tmpa_tl
+\AddToHook{cmd/refstepcounter/after}
+ {
+   \tl_if_blank:VF \@currentHref
+    {
+      \prop_if_exist:NT \g__tag_struct_dest_num_prop
+        {
+         \prop_gput:Nxx \g__tag_struct_dest_num_prop {\@currentHref}{\tag_get:n{struct_num}}
+        }
+    }
+ }
+\AddToHook{cmd/H at refstepcounter/after}
+ {
+   \tl_if_blank:VF \@currentHref
+    {
+      \prop_if_exist:NT \g__tag_struct_dest_num_prop
+        {
+          \prop_gput:Nxx \g__tag_struct_dest_num_prop {\@currentHref}{\tag_get:n{struct_num}}
+        }
+    }
+ }
+\msg_new:nnn { tag } {struct-dest-unknown}
+ {
+   Destination~#1~has~no~related~structure.\\
+   /Ref~for~structure~#2~not~updated
+ }
+
+\cs_new_protected:Npn \g__tag_struct_ref_by_dest:
+  {
+    \prop_map_inline:Nn\g__tag_struct_ref_by_dest_prop
+      {
+        \prop_get:NnNTF \g__tag_struct_dest_num_prop {##2} \l__tag_tmpa_tl
+          {
+            \__tag_struct_gput_data_ref:ee
+              { ##1 }
+              { \tag_struct_object_ref:e{ \l__tag_tmpa_tl }}
+          }
+          {
+            \msg_warning:nnnn {tag}{struct-dest-unknown}{##2}{ ##1}
+          }
+      }
+  }
+\hook_gput_code:nnn {tagpdf/finish/before}{tagpdf/struct/Ref}{\g__tag_struct_ref_by_dest:}
+\int_new:N \g__tag_toc_level_int
+\seq_new:N \g__tag_toc_stack_seq
+
+\cs_new_protected:Npn \__tag_toc_starttoc_init:n #1
+ {
+    \bool_set_false:N \l__tag_para_bool
+    \seq_gclear:N \g__tag_toc_stack_seq
+    \int_gset:Nn  \g__tag_toc_level_int {-100}
+    \tag_struct_begin:n{tag=TOC,title=#1}
+ }
+\cs_set_protected:Npn\@starttoc at cfgpoint@before#1
+  {
+    \__tag_toc_starttoc_init:n{#1}
+  }
+\cs_new_protected:Npn \__tag_toc_starttoc_finalize:
+ {
+    \int_step_inline:nn
+      {\seq_count:N \g__tag_toc_stack_seq }
+      {\tag_struct_end:}
+    \tag_struct_end:
+    \seq_gclear:N \g__tag_toc_stack_seq
+ }
+\cs_set_protected:Npn\@starttoc at cfgpoint@after#1
+  {
+    \__tag_toc_starttoc_finalize:
+  }
+
+\cs_new_protected:Npn \__tag_toc_end:n #1
+ {
+   \seq_get:NNT\g__tag_toc_stack_seq \l__tag_toc_tmpa_tl
+     {
+       \bool_lazy_and:nnT
+         {
+           \str_if_eq_p:ee{\tl_head:N\l__tag_toc_tmpa_tl}{TOC}
+         }
+         {
+           \int_compare_p:nNn {#1}<{\tl_tail:N \l__tag_toc_tmpa_tl}
+         }
+         {
+           \seq_gpop:NN\g__tag_toc_stack_seq \l__tag_toc_tmpa_tl
+           \tag_struct_end:
+           \__tag_toc_end:n{#1}
+         }
+     }
+ }
+\cs_generate_variant:Nn \__tag_toc_end:n {e}
+\cs_new_protected:Npn \__tag_toc_contentsline_begin:nnn #1 #2 #3 %#1 level, #2 content, #3 destination
+  {
+   \tag_if_active:T
+     {
+       \ExpandArgs{c}\providecommand { toclevel@#1 }{ 1 } %  just in case ...
+       \int_compare:nNnF { \use:c{toclevel@#1} } > {\use:c{c at tocdepth}}
+        {
+          \bool_lazy_and:nnT
+            { \int_compare_p:nNn { \g__tag_toc_level_int } > {-100} }
+            { \int_compare_p:nNn { \use:c{toclevel@#1} }   > { \g__tag_toc_level_int } }
+            {
+              \seq_gpush:Nx \g__tag_toc_stack_seq {{TOC}\use:c{toclevel@#1}}
+              \tag_struct_begin:n{tag=TOC}
+            }
+          \int_compare:nNnT
+            { \use:c{toclevel@#1} } < { \g__tag_toc_level_int }
+            {
+              \__tag_toc_end:e { \use:c{toclevel@#1} }
+            }
+          \int_gset:Nn \g__tag_toc_level_int { \use:c{toclevel@#1} }
+          \group_begin:
+           \text_declare_expand_equivalent:Nn \numberline \use_none:n
+           \exp_args:Nx \tag_struct_begin:n{tag=TOCI,title={\text_purify:n {#2}}}
+           \prop_gput:Nxx \g__tag_struct_ref_by_dest_prop
+             { \tag_get:n {struct_num} }{#3}
+           \seq_gpush:Nx \g__tag_toc_stack_seq {{TOCI}\use:c{toclevel@#1}}
+          \group_end:
+       }
+    }
+  }
+\cs_set_protected:Npn\@contentsline at cfgpoint@before#1#2#3#4
+  {
+    \__tag_toc_contentsline_begin:nnn {#1}{#2}{#4}
+  }
+\msg_new:nnn {tag}{toc-no-TOCI}{Missing~TOCI~structure~on~toc~stack}
+
+\cs_new_protected:Npn \__tag_toc_contentsline_end:n #1 %#1 level name
+  {
+    \int_compare:nNnF { \use:c{toclevel@#1} } > {\use:c{c at tocdepth}}
+      {
+        \seq_gpop:NNT \g__tag_toc_stack_seq\l__tag_tmpa_tl
+          {
+            \str_if_eq:eeTF{\tl_head:N\l__tag_tmpa_tl}{TOCI}
+             {
+               \tag_struct_end:
+             }
+             {
+               \msg_warning:nn{tag}{toc-no-TOCI}
+             }
+          }
+      }
+  }
+\cs_set_protected:Npn \@contentsline at cfgpoint@after #1#2#3#4
+ {
+   \__tag_toc_contentsline_end:n {#1}
+ }
+\AddToHook{contentsline/text/before}[tagpdf]{%
+  \tag_struct_begin:n{tag=Reference}%
+  \tag_mc_begin:n{tag=Reference}}
+\AddToHook{contentsline/text/after}[tagpdf]{%
+  \tag_mc_end:}
+\AddToHook{contentsline/page/before}[tagpdf]{%
+  \tag_mc_begin:n{tag=Reference}}
+\AddToHook{contentsline/page/after}[tagpdf]{%
+  \tag_mc_end:
+  \tag_struct_end:} %Reference
+\AddToHook{contentsline/number/before}[tagpdf]{%
+  \tag_mc_end:
+  \tag_struct_begin:n{tag=Lbl}%
+  \tag_mc_begin:n{tag=Lbl}}
+\AddToHook{contentsline/number/after}[tagpdf]{%
+  \tag_mc_end:
+  \tag_struct_end:
+  \tag_mc_begin:n{tag=Reference}}
+\def\@dottedtocline at cfgpoint@leaders#1{%
+ \tag_mc_begin:n{artifact}\tag_stop:n{leaders}\nobreak#1\nobreak\tag_start:n{leaders}\tag_mc_end:}
+
+%% File: latex-lab-toc-hyperref-changes.dtx (C) Copyright 2022-2023 LaTeX Project
+\def\hyper at nopatch@toc{}
+\AddToHook{package/hyperref/after}
+ {
+   \@ifpackagelater{hyperref}{2023-02-07}{}
+   {\PackageWarning{latex-lab-testphase-toc-tagging}{hyperref too old}{}}
+ }
+\ExplSyntaxOn
+\AddToHook{package/hyperref/after}
+ {
+   \AddToHook{contentsline/text/before}[hyp]
+     {
+       \tl_if_blank:VF \@contentsline at arg@two%text
+        {
+          \tl_if_blank:VF\@contentsline at arg@four%destination
+            {
+              \int_case:nnF {\Hy at linktoc}
+                {
+                  {0}{} %none
+                  {1}{\hyper at linkstart{link}{\@contentsline at arg@four}} %section
+                  {2}{} %page
+                }
+                {\hyper at linkstart{link}{\@contentsline at arg@four}} %all
+            }
+          }
+      }
+    \AddToHook{contentsline/text/after}[hyp]
+      {
+        \tl_if_blank:VF \@contentsline at arg@two
+         {
+           \tl_if_blank:VF\@contentsline at arg@four
+             {
+               \int_case:nnF {\Hy at linktoc}
+                 {
+                   {0}{} %none
+                   {1}{\hyper at linkend} %section
+                   {2}{} %page
+                 }
+                 {\hyper at linkend} %all
+             } % none
+           }
+       }
+
+    \AddToHook{contentsline/page/before}[hyp]
+      {
+        \tl_if_blank:VF \@contentsline at arg@three
+         {
+           \tl_if_blank:VF\@contentsline at arg@two
+             {
+               \int_case:nnF {\Hy at linktoc}
+                 {
+                   {0}{} %none
+                   {1}{} %section
+                   {2}{\hyper at linkstart{link}{\@contentsline at arg@four}} %page
+                 }
+                 {\hyper at linkstart{link}{\@contentsline at arg@four}} %all
+             } % none
+           }
+       }
+    \AddToHook{contentsline/page/after}[hyp]
+      {
+        \tl_if_blank:VF \@contentsline at arg@three
+         {
+           \tl_if_blank:VF\@contentsline at arg@four
+             {
+               \int_case:nnF {\Hy at linktoc}
+                 {
+                   {0}{} %none
+                   {1}{} %section
+                   {2}{\hyper at linkend} %page
+                 }
+                 {\hyper at linkend} %all
+             } % none
+           }
+       }
+    \AddToHook{cmd/addcontentsline/before}[hyp]
+     {%
+       \ExpandArgs{ooo}
+       \Hy at addcontentsline@addbookmark
+         {\addcontentsline at arg@one}
+         {\addcontentsline at arg@two}
+         {\addcontentsline at arg@three}%
+     }
+   }
+\ExplSyntaxOff
+\newcommand\Hy at addcontentsline@addbookmark[3]%#1 toc type, #2 level, #3 content
+  {%
+   \ifx\@currentHref\@empty
+    \Hy at Warning{%
+      No destination for bookmark of \string\addcontentsline,%
+      \MessageBreak destination is added%
+     }%
+    \phantomsection
+  \fi
+  \begingroup
+    \expandafter\ifx\csname toclevel@#2\endcsname\relax
+      \begingroup
+        \def\Hy at tempa{#1}%
+        \ifx\Hy at tempa\Hy at bookmarkstype
+          \Hy at WarningNoLine{%
+            bookmark level for unknown #2 defaults to 0%
+          }%
+        \else
+          \Hy at Info{bookmark level for unknown #2 defaults to 0}%
+        \fi
+      \endgroup
+      \expandafter\gdef\csname toclevel@#2\endcsname{0}%
+    \fi
+    \edef\Hy at toclevel{\csname toclevel@#2\endcsname}%
+    \Hy at writebookmark{\csname the#2\endcsname}%
+      {#3}%
+      {\@currentHref}%
+      {\Hy at toclevel}%
+      {#1}%
+    \ifHy at verbose
+      \begingroup
+        \def\Hy at tempa{#3}%
+        \@onelevel at sanitize\Hy at tempa
+        \let\temp at online\on at line
+        \let\on at line\@empty
+        \Hy at Info{%
+          bookmark\temp at online:\MessageBreak
+          thecounter {\csname the#2\endcsname}\MessageBreak
+          text {\Hy at tempa}\MessageBreak
+          reference {\@currentHref}\MessageBreak
+          toclevel {\Hy at toclevel}\MessageBreak
+          type {#1}%
+        }%
+      \endgroup
+    \fi
+   \endgroup
+  }
+\endinput
+%%
+%% End of file `latex-lab-testphase-toc.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-testphase-toc.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/minipage-latex-lab-testphase.ltx
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/minipage-latex-lab-testphase.ltx	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/minipage-latex-lab-testphase.ltx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -0,0 +1,46 @@
+%%
+%% This is file `minipage-latex-lab-testphase.ltx',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% latex-lab-minipage.dtx  (with options: `latex-lab')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright 2021-2023 LaTeX Project
+%% 
+%% This file was generated from file(s) of the  `LaTeX-lab Bundle'.
+%% ------------------------------------------------------------------------------------
+%% 
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008 or later.
+%% 
+%% This file may only be distributed together with a copy of the LaTeX
+%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle'
+%% without such generated files.
+%% 
+%% The newest sources can be found below
+%% 
+%%    https://github.com/latex3/latex2e/required/latex-lab
+%% 
+%% where one can also log issues in case there are any.
+%% 
+%% 
+%% File: latex-lab-minipage.dtx (C) Copyright 2023 LaTeX Project
+
+\def\ltlistsversion{v0.81}
+\def\ltlistsdate{2023/05/10}
+
+
+\ProvidesFile{minipage-latex-lab-testphase.ltx}
+        [2022-10-26 v0.8 code related to the tagging of sectioning commands]
+\RequirePackage{latex-lab-testphase-minipage}
+\endinput
+%%
+%% End of file `minipage-latex-lab-testphase.ltx'.


Property changes on: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/minipage-latex-lab-testphase.ltx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/phase-III-latex-lab-testphase.ltx
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/phase-III-latex-lab-testphase.ltx	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/phase-III-latex-lab-testphase.ltx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -38,8 +38,11 @@
               [2023-03-06 v0.1a  latex-lab wrapper phase-III]
 \input{phase-II-latex-lab-testphase.ltx}
 \RequirePackage{latex-lab-testphase-block-tagging}
-\RequirePackage{latex-lab-testphase-sec-tagging}
-\RequirePackage{latex-lab-testphase-toc-tagging}
+\RequirePackage{latex-lab-testphase-sec}
+\RequirePackage{latex-lab-testphase-toc}
+\RequirePackage{latex-lab-testphase-minipage}
+\RequirePackage{latex-lab-testphase-graphic}
+\RequirePackage{latex-lab-testphase-float}
 \endinput
 %%
 %% End of file `phase-III-latex-lab-testphase.ltx'.

Modified: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/sec-tagging-latex-lab-testphase.ltx
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/sec-tagging-latex-lab-testphase.ltx	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/sec-tagging-latex-lab-testphase.ltx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -4,7 +4,7 @@
 %%
 %% The original source files were:
 %%
-%% latex-lab-sec-tagging.dtx  (with options: `latex-lab')
+%% latex-lab-sec.dtx  (with options: `latex-lab')
 %% 
 %% This is a generated file.
 %% 
@@ -32,11 +32,11 @@
 %% where one can also log issues in case there are any.
 %% 
 %% 
-%% File: sec-tagging.dtx (C) Copyright 2022-2023 LaTeX Project
+%% File: latex-lab-sec.dtx (C) Copyright 2022-2023 LaTeX Project
 
 \ProvidesFile{sec-tagging-latex-lab-testphase.ltx}
-        [2023-02-12 v0.81 code related to the tagging of sectioning commands]
-\RequirePackage{latex-lab-testphase-sec-tagging}
+        [2023-05-20 v0.82 code related to the tagging of sectioning commands]
+\RequirePackage{latex-lab-testphase-sec}
 \endinput
 %%
 %% End of file `sec-tagging-latex-lab-testphase.ltx'.

Modified: trunk/Master/texmf-dist/tex/latex-dev/latex-lab/toc-tagging-latex-lab-testphase.ltx
===================================================================
--- trunk/Master/texmf-dist/tex/latex-dev/latex-lab/toc-tagging-latex-lab-testphase.ltx	2023-05-26 21:07:21 UTC (rev 67223)
+++ trunk/Master/texmf-dist/tex/latex-dev/latex-lab/toc-tagging-latex-lab-testphase.ltx	2023-05-26 21:07:56 UTC (rev 67224)
@@ -32,12 +32,12 @@
 %% where one can also log issues in case there are any.
 %% 
 %% 
-%% File: toc-kernel-functions.dtx (C) Copyright 2022-2023 LaTeX Project
+%% File: latex-lab-toc-kernel-functions.dtx (C) Copyright 2022-2023 LaTeX Project
 
 \ProvidesFile{toc-tagging-latex-lab-testphase.ltx}
-        [2022-10-26 v0.8 code related to the tagging of toc and similar lists]
+        [2023-05-20 v0.81 code related to the tagging of toc and similar lists]
 
-\RequirePackage{latex-lab-testphase-toc-tagging}
+\RequirePackage{latex-lab-testphase-toc}
 
 \endinput
 %%



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