summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-03-07 22:21:48 +0000
committerKarl Berry <karl@freefriends.org>2023-03-07 22:21:48 +0000
commit1f1bfd29f1134e183376ffe9a2c09532eaecfde2 (patch)
tree270a572d404266fd9b2ea1969597be117adcc8b5 /Master/texmf-dist
parent402087280b756fd1a5df45aec31ddf0ac337c428 (diff)
tagpdf (7mar23)
git-svn-id: svn://tug.org/texlive/trunk@66439 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/tagpdf/README.md4
-rw-r--r--Master/texmf-dist/doc/latex/tagpdf/tagpdf-code.pdfbin1514352 -> 1544550 bytes
-rw-r--r--Master/texmf-dist/doc/latex/tagpdf/tagpdf.pdfbin858479 -> 1001257 bytes
-rw-r--r--Master/texmf-dist/doc/latex/tagpdf/tagpdf.tex272
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx8
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx28
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx24
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx6
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx4
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx4
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx4
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx4
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx26
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx4
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx67
-rw-r--r--Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx21
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty5
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug-generic.sty2
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug.sty30
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def2
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty2
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-lua.sty2
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-book.def2
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-inline.def2
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex.def8
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-mathml.def2
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf.def2
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf2.def2
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child-2.csv2
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child.csv2
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf.lua4
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty48
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty131
33 files changed, 466 insertions, 258 deletions
diff --git a/Master/texmf-dist/doc/latex/tagpdf/README.md b/Master/texmf-dist/doc/latex/tagpdf/README.md
index fd324960da2..7b3f9c74a63 100644
--- a/Master/texmf-dist/doc/latex/tagpdf/README.md
+++ b/Master/texmf-dist/doc/latex/tagpdf/README.md
@@ -1,6 +1,6 @@
#tagpdf — A package to create tagged pdf
-Packageversion: 0.98d
-Packagedate: 2023/02/15
+Packageversion: 0.98e
+Packagedate: 2023/03/07
Author: Ulrike Fischer
## License
diff --git a/Master/texmf-dist/doc/latex/tagpdf/tagpdf-code.pdf b/Master/texmf-dist/doc/latex/tagpdf/tagpdf-code.pdf
index d3c692b9d07..9d2b42fe9cf 100644
--- a/Master/texmf-dist/doc/latex/tagpdf/tagpdf-code.pdf
+++ b/Master/texmf-dist/doc/latex/tagpdf/tagpdf-code.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/tagpdf/tagpdf.pdf b/Master/texmf-dist/doc/latex/tagpdf/tagpdf.pdf
index 8266cfc1b3d..3ae1de58e9d 100644
--- a/Master/texmf-dist/doc/latex/tagpdf/tagpdf.pdf
+++ b/Master/texmf-dist/doc/latex/tagpdf/tagpdf.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/tagpdf/tagpdf.tex b/Master/texmf-dist/doc/latex/tagpdf/tagpdf.tex
index 364fcce88f2..2fe592b0b5c 100644
--- a/Master/texmf-dist/doc/latex/tagpdf/tagpdf.tex
+++ b/Master/texmf-dist/doc/latex/tagpdf/tagpdf.tex
@@ -10,13 +10,13 @@
\DocumentMetadata
{
% comment the following line to compile an untagged documentation:
- testphase=phase-II,testphase=toc-tagging,testphase=sec-tagging,
- pdfversion=2.0,lang=en-UK,pdfstandard=a-2b
+ testphase=phase-III,
+ pdfversion=2.0,lang=en-UK,pdfstandard=a-4,
}
-
+\DebugBlocksOff
\makeatletter
-\def\UlrikeFischer@package@version{0.98d}
-\def\UlrikeFischer@package@date{2023-02-15}
+\def\UlrikeFischer@package@version{0.98e}
+\def\UlrikeFischer@package@date{2023-03-07}
\makeatother
\documentclass[DIV=12,parskip=half-,bibliography=totoc,a4paper]{article}
@@ -52,8 +52,6 @@
\tikzset{operator/.style = {font=\footnotesize\ttfamily, anchor=base,draw, rounded corners,node distance=4mm and 4mm}}
-\usepackage{enumitem}
-
\usepackage{listings}
\lstset{basicstyle=\ttfamily, columns=fullflexible,language=[LaTeX]TeX,
escapechar=*,
@@ -486,6 +484,23 @@ added. The ID of a structure can be retrieved with |\tag_get:n|
see~\ref{sec:retrieve}.
+\subsection{Changes in version 0.98d}
+The main change is from now on every structure has an ID and an IDtree is
+added. The ID of a structure can be retrieved with |\tag_get:n|
+see~\ref{sec:retrieve}.
+
+
+\subsection{Changes in version 0.98e}
+
+\begin{itemize}
+\item The main change is that the automatic paratagging uses now a two-level structure. This accompanies development
+in the LaTeX github inthe \texttt{latex-lab} package regarding the tagging of blocks like lists or verbatim.
+See~\ref{sec:paratagging} and also \texttt{latex-lab-block-tagging.dtx} for more background.
+
+\item The command |tag_struct_end:n| has been add to improve debugging.
+\end{itemize}
+
+
\subsection{Proof of concept: the tagging of the documentation itself}
Starting with version 0.6 the documentation itself has been tagged. The
@@ -549,7 +564,7 @@ Various parts of the code differentiate between \PDF{} version 2.0 and lower ver
\PDF{} 2.0 is wanted it is required to set the version early in the \cs{DocumentMetadata}
command so that \pkg{tagpdf} can pick up the correct code path.
-\begin{lstlisting}
+\begin{taglstlisting}
\DocumentMetadata
{
% testphase = phase-I, % tagging without paragraph tagging
@@ -560,7 +575,7 @@ command so that \pkg{tagpdf} can pick up the correct code path.
\begin{document}
some text
\end{document}
-\end{lstlisting}
+\end{taglstlisting}
\minisec{Activation needed!}
@@ -635,15 +650,15 @@ Boolean, initially false. Activates the code related to trees. Should be used on
Boolean.\sidenote{luamode}
That's a debug option, it helps in lua mode to see where space glyph will be inserted if \PrintKeyName{interwordspace} is activated.
-\item[\PrintKeyName{paratagging}] Boolean. This activate/deactivates the automatic tagging of paragraphs.
+\item[\PrintKeyName{paratagging}] Boolean. This activate/deactivates the automatic tagging of paragraphs, see
+ \ref{sec:paratagging} for more background.
It uses the \texttt{para/begin} and \texttt{para/end} hooks of the newest \LaTeX{} version (2021-05-01).
- This is a first try to use this hooks, and the code is bound to change. Paragraphs can appear in many unexpected
- places and the code can easily break, so there is also an option to see where such paragraphs are:
+ With more tagging support conditions will be added, that means the code is bound to change! Paragraphs can appear in many unexpected places and the code can easily break, so there is also an option to see where such paragraphs are:
-\item[\PrintKeyName{paratagging-show}] Boolean. This activate/deactivates small red numbers in the places where the paratagging hook code is used.
-
-\item[\PrintKeyName{paratag}] String. This key changes the tag used by the paratagging code. The default tag is \texttt{P}. A useful local setting here can be \texttt{NonStruct}, which creates a structure \enquote{without meaning}.
+\item[\PrintKeyName{paratagging-show}] Boolean. This activate/deactivates small red and green numbers in the places where the paratagging hook code is used.
+\item[\PrintKeyName{paratag}] String. This key changes the second tag used by the paratagging code. The default tag is \texttt{text}, a \LaTeX{} specific tag that is role mapped to \texttt{P}. A useful local setting here can be \texttt{NonStruct}, which creates a structure \enquote{without meaning}. For local changes it is recommended
+ to use the newer \cs{tagtool} command described below instead of \cs{tagpdfsetup}.
\item[\PrintKeyName{tabsorder}]
Choice key, possible values are \PrintKeyName{row}, \PrintKeyName{column}, \PrintKeyName{structure}, \PrintKeyName{none}. This decides if a \verb+/Tabs+ value is written to the dictionary of the page objects. Not really needed for tagging itself, but one of the things you probably need for accessibility checks. So I added it. Currently the tabsorder is the same for all pages. Perhaps this should be changed \ldots.
@@ -667,7 +682,11 @@ arguments are supported
\begin{description}
\item[\PrintKeyName{para}] Boolean. It will replace the \cs{tagpdfparaOn} and \cs{tagpdfparaOff} command.
-\item[\PrintKeyName{paratag}] String. It allows to change the tag used in the following automatically tagged paragraphs.
+\item[\PrintKeyName{unittag}] String. It allows to change the outer tag used in the following automatically tagged paragraphs. The setting is local.
+\item[\PrintKeyName{paratag}] String. It allows to change the inner tag used in the following automatically tagged paragraphs. The setting is local.
+\item[\PrintKeyName{para-flattened}] Boolean. If set it will suppress the outer structure in the automatic paratagging.
+This should be applied to the start and end hook in the same way! The setting is local.
+
\end{description}
@@ -677,7 +696,7 @@ arguments are supported
pdf is a page orientated graphic format. It simply puts ink and glyphs at various coordinates on a page. A simple stream of a page can look like this\footnote{The appendix contains some remarks about the syntax of a \PDF{} file}:
-\begin{lstlisting}[columns=fixed]
+\begin{taglstlisting}[columns=fixed]
stream
BT
/F27 14.3462 Tf %select font
@@ -690,7 +709,7 @@ stream
[(1)]TJ %print text
ET
endstream
-\end{lstlisting}
+\end{taglstlisting}
From this stream one can extract the characters and their placement on the page
@@ -835,11 +854,11 @@ called \enquote{marked content}. The three main variants needed here are:
complain.
-\begin{lstlisting}
+\begin{taglstlisting}
/Artifact BMC
text to be marked
/EMC
-\end{lstlisting}
+\end{taglstlisting}
@@ -852,11 +871,11 @@ called \enquote{marked content}. The three main variants needed here are:
in header and footer can e.g. be declared as pagination like this:
-\begin{lstlisting}
+\begin{taglstlisting}
/Artifact <</Type /Pagination>> BDC
text to be marked
/EMC
-\end{lstlisting}
+\end{taglstlisting}
@@ -876,11 +895,11 @@ data can be stored. \emph{Required} is an \texttt{/MCID}-key which takes an
integer as a value:
-\begin{lstlisting}
+\begin{taglstlisting}
/H1 <</MCID 3>> BDC
text to be marked
/EMC
-\end{lstlisting}
+\end{taglstlisting}
This integer is used to identify the chunk when building the structure
@@ -898,11 +917,11 @@ title, alternative text or a local language setting.
The needed markers can be added with low level code e.g. like this (in pdftex syntax):
-\begin{lstlisting}
+\begin{taglstlisting}
\pdfliteral page {/H1 <</MCID 3>> BDC}%
text to be marked
\pdfliteral page {EMC}%
-\end{lstlisting}
+\end{taglstlisting}
This sounds easy. But there are quite a number of traps, mostly with pdfLaTeX:
@@ -915,11 +934,11 @@ This sounds easy. But there are quite a number of traps, mostly with pdfLaTeX:
section could end on the previous page:
-\begin{lstlisting}
+\begin{taglstlisting}
\pdfliteral page {/H1 <</MCID 3>> BDC} %problem: possible pagebreak here
\section{mysection}
\pdfliteral page {EMC}%
-\end{lstlisting}
+\end{taglstlisting}
Using the literals \emph{inside} the section argument is better, but then
@@ -1076,10 +1095,10 @@ The key-val list understands the following keys:
That means that you can do something like in the following listing
and it will insert \verb+\frac{a}{b}+ (hex encoded) in the \PDF{}.
- \begin{lstlisting}
+ \begin{taglstlisting}
\newcommand\myalttext{\frac{a}{b}}
\tagmcbegin{tag=P,alt=\myalttext}
- \end{lstlisting}
+ \end{taglstlisting}
@@ -1095,10 +1114,10 @@ The key-val list understands the following keys:
and it will insert \verb+X+ (hex encoded) in the \PDF{}.
- \begin{lstlisting}
+ \begin{taglstlisting}
\newcommand\myactualtext{X}
\tagmcbegin{tag=Span,actualtext=\myactualtext}
- \end{lstlisting}
+ \end{taglstlisting}
According to the PDF reference, \texttt{/ActualText} should only be used
on marked content sequence of type Span. This is not enforced by the code
@@ -1131,9 +1150,9 @@ the command, as the effect of the begin command ends with a new
%Consider a code like this:
%
%
-%\begin{lstlisting}
+%\begin{taglstlisting}
%\tagmcbegin{tag=P} Block 1 {\tagmcbegin{tag=P} Block 2} Block 3 \tagmcend
-%\end{lstlisting}
+%\end{taglstlisting}
%
%
%Block 3 will here get the same id number as Block 1 and be stored in the structure \emph{before} Block 2. The \PDF{} will record the chunks in the order \texttt{Block 1 -- Block 3 -- Block 2}. See also section~\ref{sec:global-local}.
@@ -1193,7 +1212,7 @@ This had the advantage that the attributes didn't spill over in area where they
But it had the disadvantage that it was difficult for an inner structure to correctly interrupt the outer
mc-chunk if it can't control the group level. For example this didn't work due to the grouping inserted by the user:
-\begin{lstlisting}
+\begin{taglstlisting}
\tagstructbegin{tag=P}
\tagmcbegin{tag=P}
Start paragraph
@@ -1209,7 +1228,7 @@ mc-chunk if it can't control the group level. For example this didn't work due t
Continuation of paragraph
\tagmcend
\tagstructend
-\end{lstlisting}
+\end{taglstlisting}
The reading order was then wrong, and the \emph{emphasized text} moved in the structure at the end.
@@ -1217,7 +1236,7 @@ So starting with version 0.9 this has been reverted. The attribute is now global
This solves the \enquote{interruption} problem, but has its price: Material inserted by the output routine
must be properly guarded. For example
-\begin{lstlisting}
+\begin{taglstlisting}
\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{uncompress}
\documentclass{article}
@@ -1232,7 +1251,7 @@ must be properly guarded. For example
\tagmcbegin{tag=P}Page 1\newpage Page 2\tagmcend
\tagstructend
\end{document}
-\end{lstlisting}
+\end{taglstlisting}
Here the header and the background code on the \emph{first} page will be marked up as paragraph
and added as chunk to the document structure. The header and the background code on
@@ -1317,7 +1336,7 @@ automatic tagging, the value \texttt{pagination} add additionally an \texttt{/Ar
If some additional markup (or even a structure) is wanted, something like this should be used (here with
the syntax of the \pkg{fancyhdr} package) to close the open mc-chunk and restart if after the content:
-\begin{lstlisting}
+\begin{taglstlisting}
\ExplSyntaxOn
\cfoot{\leavevmode
\tag_mc_end_push:
@@ -1326,7 +1345,7 @@ the syntax of the \pkg{fancyhdr} package) to close the open mc-chunk and restart
\tagmcend
\tag_mc_begin_pop:n{artifact}}
\ExplSyntaxOff
-\end{lstlisting}
+\end{taglstlisting}
\subsubsection{Links and other annotations}\label{sec:link+annot}
@@ -1364,7 +1383,7 @@ the \pkg{l3pdffield-testphase} package will be handle by this package.
The following listing shows low-level to create link where the two commands are used:
-\begin{lstlisting}
+\begin{taglstlisting}
\pdfextension startlink
attr
{
@@ -1382,7 +1401,7 @@ The following listing shows low-level to create link where the two commands are
This is a link.
\pdfextension endlink
\tag_struct_insert_annot:xx {\pdfannot_link_ref_last:}{\tag_struct_parent_int:}
-\end{lstlisting}
+\end{taglstlisting}
@@ -1394,13 +1413,13 @@ Math is a problem. I have seen an example where \emph{every single symbol} has b
The \PDF{} then looked like this
-\begin{lstlisting}
+\begin{taglstlisting}
/mn <</MCID 6 /ActualText<FEFF0034>/Alt( : open bracket: four )>>BDC
...
/mn <</MCID 7 /ActualText<FEFF0033>/Alt( third s )>>BDC
...
/mo <</MCID 8 /ActualText<FEFF2062>/Alt( times )>>BDC
-\end{lstlisting}
+\end{taglstlisting}
If this is really the way to go one would need some script to add the mark-up as doing it manually is too much work and would make the source unreadable -- at least with pdflatex and the generic mode. In lua mode is it possible to hook into the \texttt{mlist\_to\_hlist} callback and add marker automatically. Some first implementation is done by Marcel Krüger in the luamml project.
@@ -1421,7 +1440,7 @@ So with pdflatex in generic mode one until now had to do the splitting manually.
The example \texttt{mc-manual-para-split} demonstrates how this can be done. The general idea was to use \verb+\vadjust+ in the right place:
-\begin{lstlisting}
+\begin{taglstlisting}
\tagmcbegin{tag=P}
...
fringilla, ligula wisi commodo felis, ut adipiscing felis dui in
@@ -1430,7 +1449,7 @@ enim. Suspendisse malesuada ultrices ante.% page break
Pellentesque scelerisque
...
sit amet, lacus.\tagmcend
-\end{lstlisting}
+\end{taglstlisting}
Starting with version 0.92 there is code which tries to resolve this problem. Basically it works like this: every mc-command
issues a mark command (actually two slightly different). When the page is built in the output routine this mark commands are inspected
@@ -1451,20 +1470,70 @@ rerun.
\subsubsection{Automatic tagging of paragraphs}\label{sec:paratagging}
-\begin{docCommand}[nosep]{tagpdfparaOn}{}\end{docCommand}
-\begin{docCommand}{tagpdfparaOff}{}\end{docCommand}
-
Another feature that emerged from the \LaTeX{} tagged PDF project are hooks at the begin and end of paragraphs.
-\pkg{tagpdf} makes use of these hooks to tag paragraphs. This can be activated/deactivated (also locally) with
-options of \cs{tagpdfsetup} or with the two commands above.
+\pkg{tagpdf} makes use of these hooks to tag paragraphs. In the first version it added only one structure, but this proved to be not adequate:
+
+Paragraphs in \LaTeX{} can be nested, e.g., you can have a paragraph
+containing a display quote, which in turn consists of more than one
+(sub)paragraph, followed by some more text which all belongs to the
+same outer paragraph.
+
+In the \PDF{} model and in the HTML model that is not supported: the rules
+in \PDF{} specification do not allow \texttt{P}-structures to be nested --- a
+limitation that conflicts with real live, given that such
+constructs are quite normal in spoken and written language.
+
+The approach we take (starting with march 2023, version 0.98e)
+to resolve this is to model such \enquote{big}
+paragraphs with a structure named \texttt{text-unit} and use \texttt{P} (under the name \texttt{text})
+only for (portions of) the actual paragraph text in a way that the
+\texttt{P}s are not nested. As a result we have for a simple
+paragraph two structures:
+
+\begin{taglstlisting}
+<text-unit>
+ <P>
+ The paragraph text ...
+ </P>
+</text-unit
+\end{taglstlisting}
+
+ In the case of an element, such as a display quote or a display list
+ inside the paragraph, we then have
+\begin{taglstlisting}
+<text-unit>
+ <text>
+ The paragraph text before the display element ...
+ </text>
+ <display element structure>
+ Content of the display structure possibly involving inner <text-unit> tags
+ </display element structure>
+ <text>
+ ... continuing the outer paragraph text
+ </text>
+</text-unit>
+\end{taglstlisting}
+
+In other words such a display block is always embedded in a
+|<text-unit>| structure, possibly preceded by a |<text>|\ldots|</text>| block
+and possibly followed by one, though both such blocks are optional.
+More information about this can be found in the documentation of \texttt{latex-lab-block-tagging}.
+
+As a consequence \pkg{tagpdf} now adds two structures if paratagging is activated. The new code
+to tag display blocks extends this code to handle the nesting of lists and other display structures.
The automatic tagging require that for every begin of a paragraph with the begin hook code
there a corresponding end with the closing hook code. This can fail, e.g if a |vbox| doesn't correctly issue a |\par| at the end.
-If this happens the tagging structure can get every confused. At the end of the document \pkg{tagpdf} checks if
-the number of start and end paragraph structures created here are equal and it will error if not.
+If this happens the tagging structure can get very confused. At the end of the document \pkg{tagpdf} checks if
+the number of outer and inner start and end paragraph structures created with the automatic paratagging code
+are equal and it will error if not.
+
+The automatic tagging of paragraphs can be deactivated completely or only the outer level with the |\tagtool| keys
+|para| and |para-flattened| or with the (now deprecated) commands |\tagpdfparaOn| and |\tagpdfparaOff|.
-Nesting the activation and deactivation of the tagging of paragraphs can be quite difficult. For example if it is unclear if the inner code issues a |\par| or not it is not trivial to exclude an end hook for every excluded begin hook.
-In such cases it can be easier to use the new |paratag| key with the value |NonStruct| to convert some |P|-structures
+
+Nesting the activation and deactivation of the tagging of paragraphs can be quite difficult. For example if it is unclear if the inner code issues a |\par| or not it is not trivial to exclude an end hook for every excluded begin hook.
+In such cases it can be easier to use the |paratag| key with the value |NonStruct| to convert some |P|-structures
into |NonStruct|-structures without real meaning.
\subsection{Task 2: Marking the structure}
@@ -1482,12 +1551,12 @@ The structure is represented in the \PDF{} with a number of objects of type \tex
The tree should reflect the \emph{semantic} meaning of the text. That means that the text should be marked as section, list, table head, table cell and so on. A number of standard structure types is predefined, see section \ref{sec:new-tag} but it is allowed to create more. If you want to use types of your own you must declare them. E.g. this declares two new types \texttt{TAB} and {FIG} and bases them on \texttt{P}:
-\begin{lstlisting}
+\begin{taglstlisting}
\tagpdfsetup{
add-new-tag = TAB/P,
add-new-tag = FIG/P,
}
-\end{lstlisting}
+\end{taglstlisting}
@@ -1499,12 +1568,12 @@ The sectioning units can be structured in two ways: a flat, html-like and a more
The flat version creates a structure like this:
-\begin{lstlisting}
+\begin{taglstlisting}
<H1>section header</H1>
<P> text</P>
<H2>subsection header</H2>
...
-\end{lstlisting}
+\end{taglstlisting}
So here the headings are marked according their level with \texttt{H1}, \texttt{H2}, etc.
@@ -1512,7 +1581,7 @@ So here the headings are marked according their level with \texttt{H1}, \texttt{
In the xml-like tree the complete text of a sectioning unit is surrounded with the \texttt{Sect} tag, and all headers with the tag \texttt{H}. Here the nesting defines the level of a sectioning heading.
-\begin{lstlisting}
+\begin{taglstlisting}
<Sect>
<H>section heading</H>
<P> text</p>
@@ -1521,7 +1590,7 @@ In the xml-like tree the complete text of a sectioning unit is surrounded with t
...
</Sect>
</Sect>
-\end{lstlisting}
+\end{taglstlisting}
The flat version is more \LaTeX-like and it is rather straightforward to patch \verb+\chapter+, \verb+\section+ and so on to insert the appropriates \texttt{H\ldots} start and end markers. The xml-like tree is more difficult to automate. If such a tree is wanted I would recommend to use -- like the context format -- explicit commands to start and end a sectioning unit.
@@ -1570,10 +1639,10 @@ The key-val list understands the following keys:
This key inserts an \texttt{/Alt} value in the dictionary of structure object, see section~\ref{sec:alt}. The value is handled as verbatim string and hex encoded. The value will be expanded first once (so works like the key \texttt{alttext-o} in previous versions which has been removed). That means that you can do something like this:
- \begin{lstlisting}
+ \begin{taglstlisting}
\newcommand\myalttext{\frac{a}{b}}
\tagstructbegin{tag=P,alt=\myalttext}
- \end{lstlisting}
+ \end{taglstlisting}
@@ -1584,10 +1653,10 @@ The key-val list understands the following keys:
\item[\PrintKeyName{actualtext}]
This key inserts an \texttt{/ActualText} value in the dictionary of structure object, see section~\ref{sec:alt}. The value is handled as verbatim string, The value will be expanded first once (so works like the key \texttt{alttext-o} in previous versions which has been removed). That means that you can do something like this:
- \begin{lstlisting}
+ \begin{taglstlisting}
\newcommand\myactualtext{X}
\tagstructbegin{tag=P,actualtext=\myactualtext}
- \end{lstlisting}
+ \end{taglstlisting}
@@ -1597,9 +1666,9 @@ The key-val list understands the following keys:
\item[\PrintKeyName{attribute}]
This key takes as argument a comma list of attribute names (use braces to protect the commas from the external key-val parser) and allows to add one or more attribute dictionary entries in the structure object. As an example
- \begin{lstlisting}
+ \begin{taglstlisting}
\tagstructbegin{tag=TH,attribute= TH-row}
- \end{lstlisting}
+ \end{taglstlisting}
See also section~\ref{sec:attributes}.
@@ -1607,9 +1676,9 @@ The key-val list understands the following keys:
This key takes as argument a comma list of attribute names (use braces to protect the commas from the external key-val parser) and allows to add them as attribute classes to the structure object. As an example
- \begin{lstlisting}
+ \begin{taglstlisting}
\tagstructbegin{tag=TH,attribute-class= TH-row}
- \end{lstlisting}
+ \end{taglstlisting}
See also section~\ref{sec:attributes}.
@@ -1626,13 +1695,13 @@ The key-val list understands the following keys:
\verb+\pdf_object_ref:n+ from a current \texttt{l3kernel}.
For example:
- \begin{lstlisting}
+ \begin{taglstlisting}
\group_begin:
\pdfdict_put:nnn {l_pdffile/Filespec} {AFRelationship}{/Supplement}
\pdffile_embed_file:nnn{example-input-file.tex}{}{tag/AFtest}
\group_end:
\tagstructbegin{tag=P,AF=tag/AFtest}
- \end{lstlisting}
+ \end{taglstlisting}
As shown, the wanted AFRelationship can be set
by filling the dictionary with the value. The mime type
@@ -1651,14 +1720,14 @@ The key-val list understands the following keys:
This key allows to embed an associated file with inline content. The value is some text,
which is embedded in the PDF as a text file with mime type text/plain.
- \begin{lstlisting}
+ \begin{taglstlisting}
\tagstructbegin{tag=P,AFinline=Some extra text}
- \end{lstlisting}
+ \end{taglstlisting}
\item[\PrintKeyName{AFinline-o}]
- This is like verb+AFinline+, but it expands the value once.
+ This is like \verb+AFinline+, but it expands the value once.
-\item[\PrintKeyName{texsource}] This is like verb+AFinline-o+, but it
+\item[\PrintKeyName{texsource}] This is like \verb+AFinline-o+, but it
creates a tex-file, with mime type \texttt{application/x-tex} and the
AFRelationship \texttt{Source}.
@@ -1706,9 +1775,9 @@ Structure Element can have so-called attributes. A single attribute is a diction
with at least the required key \verb+/O+ (for \enquote{Owner} which describes the scope the attribute applies too.
As an example here an attribute that can be attached to tabular header (type TH) and adds the info that the header is a column header:
-\begin{lstlisting}
+\begin{taglstlisting}
<</O /Table /Scope /Column>>
-\end{lstlisting}
+\end{taglstlisting}
One or more such attributes can be attached to a structure element. It is also possible to store such an attribute under a symbolic name in a so-called \enquote{ClassedMap} and then to attach references to such classes to a structure.
@@ -1718,7 +1787,7 @@ The name should be a sensible key name, it is converted to a pdf name with
-\begin{lstlisting}
+\begin{taglstlisting}
\tagpdfsetup
{
newattribute =
@@ -1726,7 +1795,7 @@ The name should be a sensible key name, it is converted to a pdf name with
newattribute =
{TH-row}{/O /Table /Scope /Row},
}
-\end{lstlisting}
+\end{taglstlisting}
@@ -1742,12 +1811,12 @@ Attributes can then be used with the key \PrintKeyName{attribute} or \PrintKeyNa
-\begin{lstlisting}
+\begin{taglstlisting}
\tagstructbegin{tag=TH,
attribute-class= {TH-row,TH-col},
attribute = {TH-row,TH-col},
}
-\end{lstlisting}
+\end{taglstlisting}
@@ -1766,7 +1835,7 @@ This will hopefully write all the needed objects and values to the \PDF{}. (Besi
The following shows the marking needed for a section, a sentence and a list with two items. It is obvious that one wouldn't like to have to do this for real documents. If tagging should be usable, the commands must be hidden as much as possible inside suitable \LaTeX\ commands and enviroments.
-\begin{lstlisting}
+\begin{taglstlisting}
\begin{document}
\tagstructbegin{tag=Document}
@@ -1814,7 +1883,7 @@ The following shows the marking needed for a section, a sentence and a list with
\tagstructend %Sect
\tagstructend %Document
\end{document}
-\end{lstlisting}
+\end{taglstlisting}
\subsection{Interrupting the tagging}
@@ -1842,7 +1911,7 @@ only restarts if the corresponding |tag_stop:n| actually
stopped something. This is meant for a situation like the following,
where you don't want that the inner |\tag_start:n| restarts tagging.
-\begin{lstlisting}
+\begin{taglstlisting}
\tag_stop:n{outer}
...
\tag_stop:n{inner}
@@ -1850,7 +1919,7 @@ where you don't want that the inner |\tag_start:n| restarts tagging.
\tag_start:n{inner}
...
\tag_start:n{outer}
-\end{lstlisting}
+\end{taglstlisting}
\subsection{Lazy and automatic tagging}\label{sec:lazy}
@@ -1868,11 +1937,11 @@ This means that even if you don't care about a proper structure you should try t
As mentioned above the mc-markers should not be nested. Basically you write:
-\begin{lstlisting}
+\begin{taglstlisting}
\tagmcbegin{..}some text ...\tagmcend
<optional structure commands>
\tagmcbegin{..}some other text\tagmcend
-\end{lstlisting}
+\end{taglstlisting}
This is quite workable as long as you mark everything manually. But when defining commands you have to ensure that they correctly push and pop the mc-chunks where needed.
@@ -1912,9 +1981,9 @@ a known set of standard types or are \enquote{role mapped} to such a standard ty
So instead of |H1| the type |section| could be used. The role mapping can then be declared
with the |add-new-tag| key:
-\begin{lstlisting}
+\begin{taglstlisting}
\tagpdfsetup{add-new-tag = section/H1}
-\end{lstlisting}
+\end{taglstlisting}
In PDF 2.0 the situation is a bit more complicated. At first PDF~2.0 introduced \emph{name spaces}.
That means that a type can have more than one \enquote{meaning} depending on the name space it belongs to.
@@ -1990,10 +2059,10 @@ syntax |section/H1| should in most cases do the right thing.
\item[unknown key] An unknown key is interpreted as a |tag/role|, this preserves the old syntax. So this two calls are equivalent:
- \begin{lstlisting}
+ \begin{taglstlisting}
\tagpdfsetup{add-new-tag = section/H1}
\tagpdfsetup{add-new-tag = {tag=section,role=H1}}
- \end{lstlisting}
+ \end{taglstlisting}
\end{description}
@@ -2035,13 +2104,13 @@ will only be visible if the log-level is increased.
Typical messages will look then like this
-\begin{lstlisting}[mathescape]
+\begin{taglstlisting}[mathescape]
Package tagpdf Info: The rule between parent 'Sect (from Sect/pdf2)'
(tagpdf) and child 'H10 (from H10/pdf2)' is '1 (0..n)'
Package tagpdf Info: The rule between parent 'H2 (from subsection/latex)'
(tagpdf) and child 'H1 (from section/latex)' is '-1 ($\emptyset$)'
-\end{lstlisting}
+\end{taglstlisting}
The descriptions of the parent and childs are rather verbose as the checks have to take role mapping and name spaces into account. The result of a check is a number---negative if the relation is not allowed,
positive if allowed. The text in the parentheses show the symbols used in the \PDF-matrix.
@@ -2133,11 +2202,10 @@ A tagged \PDF{} is needed for accessibility but this is not enough. As already m
\item The language must be declared by adding a \texttt{/Lang xx-XX} to the \PDF{} catalog or -- if the language changes for a part of the text to the structure or the marked content. Setting the document language can be rather easily done with existing packages. With the new \PDF{} resource management it should be done with \verb+\pdfmanagement_add:nnn{Catalog}{Lang}{(en-US)}+. For settings in marked content and structure I will have to add keys.
\item All characters must have an unicode representation or a suitable alternative text.
With lualatex and open type (unicode) fonts this is normally not a problem. With pdflatex it could need
-
- \begin{verbatim}
+ \begin{taglstlisting}
\input{glyphtounicode}
\pdfgentounicode=1
- \end{verbatim}
+ \end{taglstlisting}
and perhaps some\verb+\pdfglyphtounicode+ commands.
\item Hard and soft hyphen must be distinct.
@@ -2322,7 +2390,7 @@ Dictionaries are enclosed by double angle brackets. They contain key-value pairs
Dictionaries can be written all in one line:\\ \texttt{<</Type/Page/Contents 3 0 R/Resources 1 0 R/Parent 5 0 R>>}\\
but at least for examples a layout with line breaks and indentation is more readable:
- \begin{lstlisting}
+ \begin{taglstlisting}
<<
/Type /Page
/Contents 3 0 R
@@ -2330,7 +2398,7 @@ Dictionaries are enclosed by double angle brackets. They contain key-value pairs
/MediaBox [0 0 595.276 841.89]
/Parent 5 0 R
>>
- \end{lstlisting}
+ \end{taglstlisting}
@@ -2342,7 +2410,7 @@ Dictionaries are enclosed by double angle brackets. They contain key-value pairs
Here an example of a stream, an object definition and reference. In the object 2 (a page object) the \texttt{/Contents} key references the object 3 and this then contains the text of the page in a stream. \texttt{Tf}, \texttt{Tm} and \texttt{TJ} are (postfix) operators, the first chooses the font with the name \texttt{/F15} at the size 10.9, the second displaces the reference point on the page and the third inserts the text.
- \begin{lstlisting}
+ \begin{taglstlisting}
% a page object (shortened)
2 0 obj
<<
@@ -2362,13 +2430,13 @@ Dictionaries are enclosed by double angle brackets. They contain key-value pairs
ET
endstream
endobj
- \end{lstlisting}
+ \end{taglstlisting}
In such a stream the \texttt{BT}--\texttt{ET} pair encloses texts while drawing and graphics are outside of such pairs.
\item[Number tree] This is a more complex data structure that is meant to index objects by numbers. In the core is an array with number-value pairs. A simple version of number tree which has the keys 0 and 3 is
-\begin{lstlisting}
+\begin{taglstlisting}
6 0 obj
<<
/Nums [
@@ -2377,7 +2445,7 @@ Dictionaries are enclosed by double angle brackets. They contain key-value pairs
]
>>
endobj
-\end{lstlisting}
+\end{taglstlisting}
This maps 0 to an array and 2 to the object reference \texttt{21 0 R}. Number trees can be split over various nodes -- root, intermediate and leaf nodes. We will need such a tree for the \emph{parent tree}.
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx
index 012321bba50..9c947ca0b3a 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx
@@ -47,13 +47,13 @@
% }^^A
% }
%
-% \date{Version 0.98d, released 2023-02-15}
+% \date{Version 0.98e, released 2023-03-07}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*luatex>
-\ProvidesExplFile {tagpdf-luatex.def} {2023-02-15} {0.98d}
+\ProvidesExplFile {tagpdf-luatex.def} {2023-03-07} {0.98e}
{tagpdf~driver~for~luatex}
% \end{macrocode}
% \section{Loading the lua}
@@ -158,8 +158,8 @@
local ProvidesLuaModule = {
name = "tagpdf",
- version = "0.98d", --TAGVERSION
- date = "2023-02-15", --TAGDATE
+ version = "0.98e", --TAGVERSION
+ date = "2023-03-07", --TAGDATE
description = "tagpdf lua code",
license = "The LATEX Project Public License 1.3c"
}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx
index 6219d00192e..2eba24c8892 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx
@@ -48,7 +48,7 @@
% }^^A
% }
%
-% \date{Version 0.98d, released 2023-02-15}
+% \date{Version 0.98e, released 2023-03-07}
% \maketitle
% \begin{documentation}
% \section{Commands}
@@ -295,7 +295,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-checks-code} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf-checks-code} {2023-03-07} {0.98e}
{part of tagpdf - code related to checks, conditionals, debugging and messages}
%</header>
% \end{macrocode}
@@ -493,7 +493,7 @@
% and breaks the structure.
% \begin{macrocode}
\msg_new:nnnn { tag } {para-hook-count-wrong}
- {The~number~of~automatic~begin~(#1)~and~end~(#2)~para~hooks~differ!}
+ {The~number~of~automatic~begin~(#1)~and~end~(#2)~#3~para~hooks~differ!}
{This~quite~probably~a~coding~error~and~the~structure~will~be~wrong!}
%</package>
% \end{macrocode}
@@ -950,6 +950,10 @@
{
Struct~end~#1~[\msg_line_context:]
}
+\msg_new:nnn { tag / debug } {struct-end-wrong}
+ {
+ Struct~end~'#1'~doesn't~fit~start~'#2'~[\msg_line_context:]
+ }
\cs_new_protected:Npn \@@_debug_struct_begin_insert:n #1
{
@@ -981,6 +985,24 @@
\msg_note:nnn { tag / debug } {struct-end } {ignored}
}
}
+\cs_new_protected:Npn \@@_debug_struct_end_check:n #1
+ {
+ \int_compare:nNnT { \l_@@_loglevel_int } > {0}
+ {
+ \seq_get:NNT \g_@@_struct_tag_stack_seq \l_@@_tmpa_tl
+ {
+ \str_if_eq:eeF
+ {#1}
+ {\exp_last_unbraced:NV\use_i:nn \l_@@_tmpa_tl}
+ {
+ \msg_warning:nnxx { tag/debug }{ struct-end-wrong }
+ {#1}
+ {\exp_last_unbraced:NV\use_i:nn \l_@@_tmpa_tl}
+ }
+ }
+ }
+ }
+
% \end{macrocode}
% \begin{macrocode}
%</debug>
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx
index 89b6d09d261..77c08c16028 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx
@@ -47,7 +47,7 @@
% }^^A
% }
%
-% \date{Version 0.98d, released 2023-02-15}
+% \date{Version 0.98e, released 2023-03-07}
% \maketitle
% \begin{documentation}
% This files contains a various data files which are read in
@@ -60,7 +60,7 @@
% It lists the new tag, the rolemap and the namespace of the rolemap.
% \begin{macrocode}
%<*ns-latex>
-%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-02-15} {0.98d}
+%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-03-07} {0.98e}
%% {latex} {https://www.latex-project.org/ns/dflt/2022}{}
title, Title, pdf2,
part, Title, pdf2,
@@ -69,15 +69,21 @@ subsection, H2, pdf2,
subsubsection,H3, pdf2,
paragraph, H4, pdf2,
subparagraph, H5, pdf2,
+list, L, pdf2,
itemize, L, pdf2,
enumerate, L, pdf2,
description, L, pdf2,
+quote, BlockQuote,pdf,
+quotation, BlockQuote,pdf,
+verbatim, Div, pdf2,
item, LI, pdf2,
itemlabel, Lbl, pdf2,
itembody, LBody, pdf2,
footnote, FENote, pdf2,
footnotemark, Lbl, pdf2,
footnotelabel,Lbl, pdf2,
+text-unit, Part, pdf2,
+text, P, pdf2,
%</ns-latex>
% \end{macrocode}
% \section{The LaTeX-book namespace}
@@ -86,7 +92,7 @@ footnotelabel,Lbl, pdf2,
% It is bound to change
% \begin{macrocode}
%<*ns-latex-book>
-%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-02-15} {0.98d}
+%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-03-07} {0.98e}
%% {latex-book} {https://www.latex-project.org/ns/book/2022}{}
chapter, H1,pdf2,
section, H2,pdf2,
@@ -102,7 +108,7 @@ subparagraph, H6,pdf2,
% It is bound to change a lot!
% \begin{macrocode}
%<*ns-latex-inline>
-%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-02-15} {0.98d}
+%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-03-07} {0.98e}
%% {latex-inline} {https://www.latex-project.org/ns/inline/2022}{}
chapter, Span, pdf2,
section, Span, pdf2,
@@ -116,7 +122,7 @@ P, Span, pdf2,
% \section{The pdf namespace data}
% \begin{macrocode}
%<*ns-pdf>
-%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-02-15} {0.98d}
+%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-03-07} {0.98e}
%% {pdf} {http://iso.org/pdf/ssn}{}
StructTreeRoot,StructTreeRoot,pdf,D,
Document,Document,pdf,D,
@@ -184,7 +190,7 @@ Strong,Span,pdf,I,
% \section{The pdf 2.0 namespace data}
% \begin{macrocode}
%<*ns-pdf2>
-%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-02-15} {0.98d}
+%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-03-07} {0.98e}
%% {pdf2} {http://iso.org/pdf2/ssn}{}
Document,Document,pdf2,D,
Part,Part,pdf2,G,
@@ -240,7 +246,7 @@ Strong,Strong,pdf2,I,
% \section{The mathml namespace data}
% \begin{macrocode}
%<*ns-mathml>
-%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-02-15} {0.98d}
+%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-03-07} {0.98e}
% {mathml}{http://www.w3.org/1998/Math/MathML}{}
abs,,,
and,,,
@@ -475,7 +481,7 @@ xor,,,
% This will perhaps change in future.
% \begin{macrocode}
%<*parent-child>
-%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-02-15} {0.98d}
+%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-03-07} {0.98e}
,,,StructTreeRoot,Document,Art,Part,Div,Sect,BlockQuote,NonStruct,TOC,TOCI,Index,Private,Quote,Note,Reference,BibEntry,P,Hn,H,Lbl,Code,Span,Link,Annot,Form,Ruby,RB,RT,RP,Warichu,WT,WP,L,LI,LBody,Table,TR,TH,TD,THead,TBody,TFoot,Caption,Figure,Formula,MC
Document,both,document level,1,0..n,∅,‡,‡,∅,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅
Art,1.7,grouping,∅,0..n,∅,‡,‡,0..n,0..n,‡,∅,∅,∅,0..n,∅,0..n,∅,∅,∅,0..1,0..1,∅,∅,∅,0..n,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,0..n,∅,∅,0..n,0..n,∅,∅,∅,0..n,0..n,∅,∅
@@ -530,7 +536,7 @@ MC,both,---,∅,∅,∅,∅,∅,∅,0..n,‡,∅,∅,∅,0..n,0..n,0..n,0..n,0..
% This will perhaps change in future.
% \begin{macrocode}
%<*parent-child-2>
-%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-02-15} {0.98d}
+%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-03-07} {0.98e}
,,,StructTreeRoot,Document,DocumentFragment,Art,Part,Div,Sect,Aside,BlockQuote,NonStruct,TOC,TOCI,Index,Private,Title,Sub,Quote,Note,Reference,BibEntry,P,Hn,H,Lbl,Code,Em,Strong,Span,Link,Annot,Form,Ruby,RB,RT,RP,Warichu,WT,WP,FENote,L,LI,LBody,Table,TR,TH,TD,THead,TBody,TFoot,Caption,Figure,Formula,math,mathml,Artifact,MC
Document,both,document level,1,0..n,0..n,∅,‡,‡,∅,0..n,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,0..n,∅
DocumentFragment,2.0,document level,∅,0..n,0..n,0..n,‡,‡,0..n,0..n,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅*,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅*,∅*,∅,∅,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅,0..n,∅
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx
index 8061a5d18d0..e2973a593b5 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98d, released 2023-02-15}
+% \date{Version 0.98e, released 2023-03-07}
% \maketitle
% \begin{documentation}
% \end{documentation}
@@ -55,11 +55,11 @@
% \begin{macrocode}
%<@@=tag>
%<*generic>
-\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-03-07} {0.98e}
{part of tagpdf - code related to marking chunks - generic mode}
%</generic>
%<*debug>
-\ProvidesExplPackage {tagpdf-debug-generic} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf-debug-generic} {2023-03-07} {0.98e}
{part of tagpdf - debugging code related to marking chunks - generic mode}
%</debug>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx
index 1b03011ddf2..8e006f6c5b3 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98d, released 2023-02-15}
+% \date{Version 0.98e, released 2023-03-07}
% \maketitle
% \begin{implementation}
% The code is splitted into three parts: code shared by all engines,
@@ -86,7 +86,7 @@
% \begin{macrocode}
%<@@=tag>
%<*luamode>
-\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-03-07} {0.98e}
{tagpdf - mc code only for the luamode }
%</luamode>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx
index ba5516dc4c9..300eb1ee3b1 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98d, released 2023-02-15}
+% \date{Version 0.98e, released 2023-03-07}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
@@ -174,7 +174,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-03-07} {0.98e}
{part of tagpdf - code related to marking chunks -
code shared by generic and luamode }
%</header>
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx
index 8557552f9a6..07598ca1484 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98d, released 2023-02-15}
+% \date{Version 0.98e, released 2023-03-07}
% \maketitle
% \begin{documentation}
% \begin{function}
@@ -98,7 +98,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-roles-code} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf-roles-code} {2023-03-07} {0.98e}
{part of tagpdf - code related to roles and structure names}
%</header>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx
index ffb891fdc5b..bbcb91bff19 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98d, released 2023-02-15}
+% \date{Version 0.98e, released 2023-03-07}
% \maketitle
% \begin{documentation}
% \begin{function}{interwordspace (setup-key)}
@@ -64,7 +64,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-space-code} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf-space-code} {2023-03-07} {0.98e}
{part of tagpdf - code related to real space chars}
%</header>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx
index c488ad823d7..796ecf34e49 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx
@@ -46,17 +46,22 @@
% }^^A
% }
%
-% \date{Version 0.98d, released 2023-02-15}
+% \date{Version 0.98e, released 2023-03-07}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
-% \begin{function}{\tag_struct_begin:n,\tag_struct_end:}
+% \begin{function}{\tag_struct_begin:n,\tag_struct_end:,\tag_struct_end:n}
% \begin{syntax}
% \cs{tag_struct_begin:n}\Arg{key-values}\\
-% \cs{tag_struct_end:}
+% \cs{tag_struct_end:}\\
+% \cs{tag_struct_end:n}\Arg{tag}
% \end{syntax}
% These commands start and end a new structure.
% They don't start a group. They set all their values globally.
+% \cs{tag_struct_end:n} does nothing special normally (apart from
+% swallowing its argument, but if \texttt{tagpdf-debug} is loaded,
+% it will check if the \Arg{tag} (after expansion)
+% is identical to the current structure on the stack. The tag is not role mapped!
% \end{function}
% \begin{function}{\tag_struct_use:n}
% \begin{syntax}
@@ -242,7 +247,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-struct-code} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf-struct-code} {2023-03-07} {0.98e}
{part of tagpdf - code related to storing structure}
%</header>
% \end{macrocode}
@@ -416,7 +421,9 @@
% to reference them in a Ref. The key is the destination.
% It is currently used by the toc-tagging and sec-tagging code.
% \begin{macrocode}
-\prop_new:N \g_@@_struct_dest_num_prop
+%</package>
+%<base>\prop_new:N \g_@@_struct_dest_num_prop
+%<*package>
% \end{macrocode}
% \end{variable}
%
@@ -1251,6 +1258,7 @@
% \begin{macrocode}
%<base>\cs_new_protected:Npn \tag_struct_begin:n #1 {\int_gincr:N \c@g_@@_struct_abs_int}
%<base>\cs_new_protected:Npn \tag_struct_end:{}
+%<base>\cs_new_protected:Npn \tag_struct_end:n{}
%<*package|debug>
%<package>\cs_set_protected:Npn \tag_struct_begin:n #1 %#1 key-val
%<debug>\cs_set_protected:Npn \tag_struct_begin:n #1 %#1 key-val
@@ -1398,6 +1406,12 @@
}
%<debug>{\@@_debug_struct_end_ignore:}
}
+
+\cs_set_protected:Npn \tag_struct_end:n #1
+ {
+%<debug>\@@_debug_struct_end_check:n{#1}
+ \tag_struct_end:
+ }
%</package|debug>
% \end{macrocode}
% \end{macro}
@@ -1552,7 +1566,7 @@
% \section{Attributes and attribute classes}
% \begin{macrocode}
%<*header>
-\ProvidesExplPackage {tagpdf-attr-code} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf-attr-code} {2023-03-07} {0.98e}
{part of tagpdf - code related to attributes and attribute classes}
%</header>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx
index c757e9e54d4..c682386fc22 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx
@@ -47,13 +47,13 @@
% }^^A
% }
%
-% \date{Version 0.98d, released 2023-02-15}
+% \date{Version 0.98e, released 2023-03-07}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-tree-code} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf-tree-code} {2023-03-07} {0.98e}
{part of tagpdf - code related to writing trees and dictionaries to the pdf}
%</header>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx
index 01de768a15c..5b1534be044 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98d, released 2023-02-15}
+% \date{Version 0.98e, released 2023-03-07}
% \maketitle
% \begin{documentation}
% \section{Setup commands}
@@ -250,7 +250,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-user} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf-user} {2023-03-07} {0.98e}
{tagpdf - user commands}
%</header>
% \end{macrocode}
@@ -554,7 +554,7 @@
{ \cs_if_exist_p:N \pdf_activate_structure_destination: }
}
{
- \tl_set:Nn \l_pdf_current_structure_destination_tl { __tag/struct/\g__tag_struct_stack_current_tl }
+ \tl_set:Nn \l_pdf_current_structure_destination_tl { __tag/struct/\g_@@_struct_stack_current_tl }
\pdf_activate_structure_destination:
}
}
@@ -580,17 +580,34 @@
% Probably one should add some checks if we are already in a paragraph.
%
%
-% \begin{macro}{\l_@@_para_bool,\l_@@_para_show_bool,\g_@@_para_int,\l_@@_para_tag_default_tl}
+% \begin{macro}{
+% \l_@@_para_bool,
+% \l_@@_para_flattened_bool,
+% \l_@@_para_show_bool,
+% \g_@@_para_begin_int,
+% \g_@@_para_end_int,
+% \g_@@_para_main_begin_int,
+% \g_@@_para_main_end_int,
+% \l_@@_para_tag_default_tl,
+% \l_@@_para_tag_tl,
+% \l_@@_para_main_tag_tl}
% At first some variables.
% \begin{macrocode}
\bool_new:N \l_@@_para_bool
+%</package>
+%<base>\bool_new:N \l_@@_para_flattened_bool
+%<*package>
\bool_new:N \l_@@_para_show_bool
\int_new:N \g_@@_para_begin_int
\int_new:N \g_@@_para_end_int
+\int_new:N \g_@@_para_main_begin_int
+\int_new:N \g_@@_para_main_end_int
\tl_new:N \l_@@_para_tag_default_tl
-\tl_set:Nn \l_@@_para_tag_default_tl { P }
+\tl_set:Nn \l_@@_para_tag_default_tl { text }
\tl_new:N \l_@@_para_tag_tl
\tl_set:Nn \l_@@_para_tag_tl { \l_@@_para_tag_default_tl }
+\tl_new:N \l_@@_para_main_tag_tl
+\tl_set:Nn \l_@@_para_main_tag_tl {text-unit}
% \end{macrocode}
% \end{macro}
%
@@ -601,6 +618,8 @@
% paratagging-show (setup-key),
% paratag (setup-key),
% paratag (tool-key),
+% unittag (tool-key),
+% para-flattened (tool-key),
% }
% These keys enable/disable locally paratagging, and the debug modus.
% It can affect the typesetting if |paratagging-show| is used. The small numbers
@@ -615,7 +634,9 @@
}
\keys_define:nn { tag / tool}
{
- paratag .tl_set:N = \l_@@_para_tag_tl
+ paratag .tl_set:N = \l_@@_para_tag_tl,
+ unittag .tl_set:N = \l_@@_para_main_tag_tl,
+ para-flattened .bool_set:N = \l_@@_para_flattened_bool
}
% \end{macrocode}
% \end{macro}
@@ -647,6 +668,14 @@
{
\bool_if:NT \l_@@_para_bool
{
+ \bool_if:NF \l_@@_para_flattened_bool
+ {
+ \int_gincr:N \g_@@_para_main_begin_int
+ \tag_struct_begin:n
+ {
+ tag=\l_@@_para_main_tag_tl,
+ }
+ }
\int_gincr:N \g_@@_para_begin_int
\tag_struct_begin:n {tag=\l_@@_para_tag_tl}
\@@_check_para_begin_show:nn {green}{}
@@ -661,17 +690,32 @@
\tag_mc_end:
\@@_check_para_end_show:nn {red}{}
\tag_struct_end:
+ \bool_if:NF \l_@@_para_flattened_bool
+ {
+ \int_gincr:N \g_@@_para_main_end_int
+ \tag_struct_end:
+ }
}
}
\AddToHook{enddocument/info}
{
- \int_compare:nNnF {\g__tag_para_begin_int}={\g__tag_para_end_int}
+ \int_compare:nNnF {\g_@@_para_main_begin_int}={\g_@@_para_main_end_int}
+ {
+ \msg_error:nnxxx
+ {tag}
+ {para-hook-count-wrong}
+ {\int_use:N\g_@@_para_main_begin_int}
+ {\int_use:N\g_@@_para_main_end_int}
+ {text-unit}
+ }
+ \int_compare:nNnF {\g_@@_para_begin_int}={\g_@@_para_end_int}
{
- \msg_error:nnxx
+ \msg_error:nnxxx
{tag}
{para-hook-count-wrong}
- {\int_use:N\g__tag_para_begin_int}
- {\int_use:N\g__tag_para_end_int}
+ {\int_use:N\g_@@_para_begin_int}
+ {\int_use:N\g_@@_para_end_int}
+ {text}
}
}
% \end{macrocode}
@@ -720,7 +764,8 @@
\renewcommand\tagpdfparaOff{\bool_set_false:N \l_@@_para_bool}
\keys_define:nn { tag / tool}
{
- para .bool_set:N = \l_@@_para_bool
+ para .bool_set:N = \l_@@_para_bool,
+ para-flattened .bool_set:N = \l_@@_para_flattened_bool,
}
% \end{macrocode}
% \end{macro}
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx
index 67a3e411d46..ab81e9573a2 100644
--- a/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx
+++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx
@@ -92,7 +92,7 @@
% \begin{macrocode}
%<@@=tag>
%<*package>
-\ProvidesExplPackage {tagpdf} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf} {2023-03-07} {0.98e}
{ A package to experiment with pdf tagging }
\bool_if:nF
@@ -118,7 +118,7 @@
% \end{macrocode}
%<*debug>
% \begin{macrocode}
-\ProvidesExplPackage {tagpdf-debug} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf-debug} {2023-03-07} {0.98e}
{ debug code for tagpdf }
\@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput}
% \end{macrocode}
@@ -136,12 +136,21 @@
\prop_gput:Nnn \g_msg_module_name_prop { tag / debug }{tagpdf~DEBUG}
%</debug>
% \end{macrocode}
+%\section{base package}
+% To avoid to have to test everywhere if tagpdf has been loaded and is active,
+% we define a base package with dummy functions
+% \begin{macrocode}
+%<*base>
+\ProvidesExplPackage {tagpdf-base} {2023-03-07} {0.98e}
+ {part of tagpdf - provide base, no-op versions of the user commands }
+%</base>
+% \end{macrocode}
%\section{Package options}
% There are only two options to switch for luatex between generic and luamode,
% TODO try to get rid of them.
% \begin{macrocode}
%<*package>
-\bool_new:N\g_@@_mode_lua_bool
+\bool_new:N\g_@@_mode_lua_bool
\DeclareOption {luamode} { \sys_if_engine_luatex:T { \bool_gset_true:N \g_@@_mode_lua_bool } }
\DeclareOption {genericmode}{ \bool_gset_false:N\g_@@_mode_lua_bool }
\ExecuteOptions{luamode}
@@ -157,12 +166,6 @@
\RequirePackage{tagpdf-base}
%</package>
% \end{macrocode}
-% \begin{macrocode}
-%<*base>
-\ProvidesExplPackage {tagpdf-base} {2023-02-15} {0.98d}
- {part of tagpdf - provide base, no-op versions of the user commands }
-%</base>
-% \end{macrocode}
% The no-op version should behave a near enough to the real code as
% possible, so we define a command which a special in the relevant backends:
% \begin{macrocode}
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty
index 3ba34d0d46a..93139afe872 100644
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty
@@ -25,7 +25,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf.dtx
-\ProvidesExplPackage {tagpdf-base} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf-base} {2023-03-07} {0.98e}
{part of tagpdf - provide base, no-op versions of the user commands }
\AddToHook{begindocument}
{
@@ -60,12 +60,14 @@
\int_gzero:N \c@g__tag_struct_abs_int
\tl_new:N \g__tag_struct_stack_current_tl
\tl_gset:Nn \g__tag_struct_stack_current_tl {\int_use:N\c@g__tag_struct_abs_int}
+\prop_new:N \g__tag_struct_dest_num_prop
\cs_new:Npn \__tag_get_data_struct_num:
{
\g__tag_struct_stack_current_tl
}
\cs_new_protected:Npn \tag_struct_begin:n #1 {\int_gincr:N \c@g__tag_struct_abs_int}
\cs_new_protected:Npn \tag_struct_end:{}
+\cs_new_protected:Npn \tag_struct_end:n{}
\cs_new_protected:Npn \tag_struct_use:n #1 {}
%% File: tagpdf-checks.dtx
@@ -108,6 +110,7 @@
{
\tag_struct_use:n {#1}
}
+\bool_new:N \l__tag_para_flattened_bool
\newcommand\tagpdfparaOn {}
\newcommand\tagpdfparaOff{}
%% File: tagpdf-roles.dtx
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug-generic.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug-generic.sty
index c7447b08b4d..bbd7ce6bc32 100644
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug-generic.sty
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug-generic.sty
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-mc-generic.dtx
-\ProvidesExplPackage {tagpdf-debug-generic} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf-debug-generic} {2023-03-07} {0.98e}
{part of tagpdf - debugging code related to marking chunks - generic mode}
\cs_set_protected:Npn \tag_mc_begin:n #1 %#1 keyval
{
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug.sty
index 659ca6f0b38..0e1b80d35c2 100644
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug.sty
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug.sty
@@ -26,7 +26,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf.dtx
-\ProvidesExplPackage {tagpdf-debug} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf-debug} {2023-03-07} {0.98e}
{ debug code for tagpdf }
\@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput}
\prop_gput:Nnn \g_msg_module_type_prop { tag / debug} {}
@@ -80,6 +80,10 @@
{
Struct~end~#1~[\msg_line_context:]
}
+\msg_new:nnn { tag / debug } {struct-end-wrong}
+ {
+ Struct~end~'#1'~doesn't~fit~start~'#2'~[\msg_line_context:]
+ }
\cs_new_protected:Npn \__tag_debug_struct_begin_insert:n #1
{
@@ -111,6 +115,24 @@
\msg_note:nnn { tag / debug } {struct-end } {ignored}
}
}
+\cs_new_protected:Npn \__tag_debug_struct_end_check:n #1
+ {
+ \int_compare:nNnT { \l__tag_loglevel_int } > {0}
+ {
+ \seq_get:NNT \g__tag_struct_tag_stack_seq \l__tag_tmpa_tl
+ {
+ \str_if_eq:eeF
+ {#1}
+ {\exp_last_unbraced:NV\use_i:nn \l__tag_tmpa_tl}
+ {
+ \msg_warning:nnxx { tag/debug }{ struct-end-wrong }
+ {#1}
+ {\exp_last_unbraced:NV\use_i:nn \l__tag_tmpa_tl}
+ }
+ }
+ }
+ }
+
%% File: tagpdf-user.dtx
@@ -250,6 +272,12 @@
{\__tag_debug_struct_end_ignore:}
}
+\cs_set_protected:Npn \tag_struct_end:n #1
+ {
+\__tag_debug_struct_end_check:n{#1}
+ \tag_struct_end:
+ }
+
%% File: tagpdf-space.dtx
%%
%%
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def
index c3d7495aab4..cbc9edbe798 100644
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-backend.dtx
-\ProvidesExplFile {tagpdf-luatex.def} {2023-02-15} {0.98d}
+\ProvidesExplFile {tagpdf-luatex.def} {2023-03-07} {0.98e}
{tagpdf~driver~for~luatex}
{
\fontencoding{TU}\fontfamily{lmr}\fontseries{m}\fontshape{n}\fontsize{10pt}{10pt}\selectfont
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty
index 4caa3a5285e..2323af69fe8 100644
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-mc-generic.dtx
-\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-03-07} {0.98e}
{part of tagpdf - code related to marking chunks - generic mode}
\__tag_prop_new:N \g__tag_MCID_byabspage_prop
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-lua.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-lua.sty
index 45bd2d4539e..16fd28a6d1a 100644
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-lua.sty
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-lua.sty
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-mc-luacode.dtx
-\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-03-07} {0.98e}
{tagpdf - mc code only for the luamode }
\hook_gput_code:nnn{begindocument}{tagpdf/mc}
{
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-book.def b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-book.def
index d05c1aa5f00..3f5f86e580e 100644
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-book.def
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-book.def
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-02-15} {0.98d}
+%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-03-07} {0.98e}
%% {latex-book} {https://www.latex-project.org/ns/book/2022}{}
chapter, H1,pdf2,
section, H2,pdf2,
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-inline.def b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-inline.def
index 5f157ddc740..d930a8f97f7 100644
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-inline.def
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-inline.def
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-02-15} {0.98d}
+%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-03-07} {0.98e}
%% {latex-inline} {https://www.latex-project.org/ns/inline/2022}{}
chapter, Span, pdf2,
section, Span, pdf2,
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex.def b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex.def
index 383578f2adf..7ef10a4bd28 100644
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex.def
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex.def
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-02-15} {0.98d}
+%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-03-07} {0.98e}
%% {latex} {https://www.latex-project.org/ns/dflt/2022}{}
title, Title, pdf2,
part, Title, pdf2,
@@ -28,15 +28,21 @@ subsection, H2, pdf2,
subsubsection,H3, pdf2,
paragraph, H4, pdf2,
subparagraph, H5, pdf2,
+list, L, pdf2,
itemize, L, pdf2,
enumerate, L, pdf2,
description, L, pdf2,
+quote, BlockQuote,pdf,
+quotation, BlockQuote,pdf,
+verbatim, Div, pdf2,
item, LI, pdf2,
itemlabel, Lbl, pdf2,
itembody, LBody, pdf2,
footnote, FENote, pdf2,
footnotemark, Lbl, pdf2,
footnotelabel,Lbl, pdf2,
+text-unit, Part, pdf2,
+text, P, pdf2,
%%
%%
%% End of file `tagpdf-ns-latex.def'.
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-mathml.def b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-mathml.def
index 2ad2154bd76..0f04fbbdc04 100644
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-mathml.def
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-mathml.def
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-02-15} {0.98d}
+%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-03-07} {0.98e}
abs,,,
and,,,
annotation,,,
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf.def b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf.def
index a6b07b70fa9..7c99f3115aa 100644
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf.def
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf.def
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-02-15} {0.98d}
+%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-03-07} {0.98e}
%% {pdf} {http://iso.org/pdf/ssn}{}
StructTreeRoot,StructTreeRoot,pdf,D,
Document,Document,pdf,D,
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf2.def b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf2.def
index 08c829cf819..2edcec9a0ca 100644
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf2.def
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf2.def
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-02-15} {0.98d}
+%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-03-07} {0.98e}
%% {pdf2} {http://iso.org/pdf2/ssn}{}
Document,Document,pdf2,D,
Part,Part,pdf2,G,
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child-2.csv b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child-2.csv
index d68bff84bba..12b6780f0fe 100644
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child-2.csv
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child-2.csv
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-02-15} {0.98d}
+%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-03-07} {0.98e}
,,,StructTreeRoot,Document,DocumentFragment,Art,Part,Div,Sect,Aside,BlockQuote,NonStruct,TOC,TOCI,Index,Private,Title,Sub,Quote,Note,Reference,BibEntry,P,Hn,H,Lbl,Code,Em,Strong,Span,Link,Annot,Form,Ruby,RB,RT,RP,Warichu,WT,WP,FENote,L,LI,LBody,Table,TR,TH,TD,THead,TBody,TFoot,Caption,Figure,Formula,math,mathml,Artifact,MC
Document,both,document level,1,0..n,0..n,∅,‡,‡,∅,0..n,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,0..n,∅
DocumentFragment,2.0,document level,∅,0..n,0..n,0..n,‡,‡,0..n,0..n,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅*,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅*,∅*,∅,∅,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅,0..n,∅
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child.csv b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child.csv
index 831dcece77a..2312c16a1c2 100644
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child.csv
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child.csv
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-02-15} {0.98d}
+%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-03-07} {0.98e}
,,,StructTreeRoot,Document,Art,Part,Div,Sect,BlockQuote,NonStruct,TOC,TOCI,Index,Private,Quote,Note,Reference,BibEntry,P,Hn,H,Lbl,Code,Span,Link,Annot,Form,Ruby,RB,RT,RP,Warichu,WT,WP,L,LI,LBody,Table,TR,TH,TD,THead,TBody,TFoot,Caption,Figure,Formula,MC
Document,both,document level,1,0..n,∅,‡,‡,∅,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅
Art,1.7,grouping,∅,0..n,∅,‡,‡,0..n,0..n,‡,∅,∅,∅,0..n,∅,0..n,∅,∅,∅,0..1,0..1,∅,∅,∅,0..n,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,0..n,∅,∅,0..n,0..n,∅,∅,∅,0..n,0..n,∅,∅
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf.lua b/Master/texmf-dist/tex/latex/tagpdf/tagpdf.lua
index 2bd02458eac..5e75b67eb3d 100644
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf.lua
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf.lua
@@ -24,8 +24,8 @@
local ProvidesLuaModule = {
name = "tagpdf",
- version = "0.98d", --TAGVERSION
- date = "2023-02-15", --TAGDATE
+ version = "0.98e", --TAGVERSION
+ date = "2023-03-07", --TAGDATE
description = "tagpdf lua code",
license = "The LATEX Project Public License 1.3c"
}
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty
index ab618dc7099..048f96beee2 100644
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty
@@ -28,7 +28,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf.dtx
-\ProvidesExplPackage {tagpdf} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdf} {2023-03-07} {0.98e}
{ A package to experiment with pdf tagging }
\bool_if:nF
@@ -317,7 +317,7 @@
{engine/output~mode~#1~doesn't~support~the~interword~spaces}
\cs_set_eq:NN \__tag_check_typeout_v:n \use_none:n
\msg_new:nnnn { tag } {para-hook-count-wrong}
- {The~number~of~automatic~begin~(#1)~and~end~(#2)~para~hooks~differ!}
+ {The~number~of~automatic~begin~(#1)~and~end~(#2)~#3~para~hooks~differ!}
{This~quite~probably~a~coding~error~and~the~structure~will~be~wrong!}
\prg_set_conditional:Npnn \tag_if_active: { p , T , TF, F }
{
@@ -1872,7 +1872,6 @@
\tl_new:N \g__tag_struct_tag_NS_tl
\tl_new:N \l__tag_struct_key_label_tl
\bool_new:N \l__tag_struct_elem_stash_bool
-\prop_new:N \g__tag_struct_dest_num_prop
\prop_new:N \g__tag_struct_ref_by_dest_prop
\cs_new:Npn \__tag_struct_output_prop_aux:nn #1 #2 %#1 num, #2 key
{
@@ -2560,6 +2559,11 @@
}
}
}
+
+\cs_set_protected:Npn \tag_struct_end:n #1
+ {
+ \tag_struct_end:
+ }
\cs_set_protected:Npn \tag_struct_use:n #1 %#1 is the label
{
\__tag_check_if_active_struct:T
@@ -3005,10 +3009,14 @@
\bool_new:N \l__tag_para_show_bool
\int_new:N \g__tag_para_begin_int
\int_new:N \g__tag_para_end_int
+\int_new:N \g__tag_para_main_begin_int
+\int_new:N \g__tag_para_main_end_int
\tl_new:N \l__tag_para_tag_default_tl
-\tl_set:Nn \l__tag_para_tag_default_tl { P }
+\tl_set:Nn \l__tag_para_tag_default_tl { text }
\tl_new:N \l__tag_para_tag_tl
\tl_set:Nn \l__tag_para_tag_tl { \l__tag_para_tag_default_tl }
+\tl_new:N \l__tag_para_main_tag_tl
+\tl_set:Nn \l__tag_para_main_tag_tl {text-unit}
\keys_define:nn { __tag / setup }
{
paratagging .bool_set:N = \l__tag_para_bool,
@@ -3017,7 +3025,9 @@
}
\keys_define:nn { tag / tool}
{
- paratag .tl_set:N = \l__tag_para_tag_tl
+ paratag .tl_set:N = \l__tag_para_tag_tl,
+ unittag .tl_set:N = \l__tag_para_main_tag_tl,
+ para-flattened .bool_set:N = \l__tag_para_flattened_bool
}
\cs_new_protected:Npn \__tag_check_para_begin_show:nn #1 #2
%#1 color, #2 prefix
@@ -3045,6 +3055,14 @@
{
\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
\tag_struct_begin:n {tag=\l__tag_para_tag_tl}
\__tag_check_para_begin_show:nn {green}{}
@@ -3059,17 +3077,32 @@
\tag_mc_end:
\__tag_check_para_end_show:nn {red}{}
\tag_struct_end:
+ \bool_if:NF \l__tag_para_flattened_bool
+ {
+ \int_gincr:N \g__tag_para_main_end_int
+ \tag_struct_end:
+ }
}
}
\AddToHook{enddocument/info}
{
+ \int_compare:nNnF {\g__tag_para_main_begin_int}={\g__tag_para_main_end_int}
+ {
+ \msg_error:nnxxx
+ {tag}
+ {para-hook-count-wrong}
+ {\int_use:N\g__tag_para_main_begin_int}
+ {\int_use:N\g__tag_para_main_end_int}
+ {text-unit}
+ }
\int_compare:nNnF {\g__tag_para_begin_int}={\g__tag_para_end_int}
{
- \msg_error:nnxx
+ \msg_error:nnxxx
{tag}
{para-hook-count-wrong}
{\int_use:N\g__tag_para_begin_int}
{\int_use:N\g__tag_para_end_int}
+ {text}
}
}
\AddToHook{begindocument/before}
@@ -3102,7 +3135,8 @@
\renewcommand\tagpdfparaOff{\bool_set_false:N \l__tag_para_bool}
\keys_define:nn { tag / tool}
{
- para .bool_set:N = \l__tag_para_bool
+ para .bool_set:N = \l__tag_para_bool,
+ para-flattened .bool_set:N = \l__tag_para_flattened_bool,
}
\NewDocumentCommand\tagpdfsuppressmarks{m}
{{\use:c{__tag_mc_disable_marks:} #1}}
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty
index df9d084a393..2501381ded3 100644
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty
@@ -1,9 +1,9 @@
%\RequirePackage[enable-debug]{expl3}[2018/06/14]
-\ProvidesExplPackage {tagpdfdocu-patches} {2023-02-15} {0.98d}
+\ProvidesExplPackage {tagpdfdocu-patches} {2023-03-07} {0.98e}
{patches/commands for the tagpdf documentation}
\RequirePackage{etoolbox,xpatch}
-%vLogos
+%Logos
\ExplSyntaxOn
\DeclareRobustCommand\TeX{
@@ -48,7 +48,7 @@
\AddToHook{cmd/emph/after}
{\tag_mc_end:\tag_struct_end:\tag_mc_begin_pop:n{}}
-
+% minisec, correct tagging is still unclear.
\newcommand\minisec[1]{%
\if@noskipsec \leavevmode \fi
\par
@@ -66,75 +66,34 @@
\@afterheading
}
-
+% listings. Unclear how to make it work for the original lstlisting, so we make a
+% copy taglstlisting for now
+\DeclareInstance{blockenv}{lstlisting}{display}
+{
+ env-name = lstlisting,
+ tag-name = verbatim,
+ tag-class = ,
+ tagging-recipe = standard,
+ inner-level-counter = ,
+ level-increase = false,
+ setup-code = ,
+ block-instance = displayblock ,
+ inner-instance = ,
+ final-code = \tl_set:Nn \l__tag_para_main_tag_tl {codeline}\tagtool{paratag=Code},
+}
+
+\lstnewenvironment{taglstlisting}[2][]{%
+ \UseInstance{blockenv}{lstlisting} {}
+ \lst@TestEOLChar{#2}%
+ \lstset{#1}%
+ \csname\@lst @SetFirstNumber\endcsname%
+ }{%
+ \@nobreakfalse
+ \csname\@lst @SaveFirstNumber\endcsname%
+ \endblockenv
+ }
-%%%%
-%% Lists
-%% patches enumitem internals!
-%%%%
-\tagpdfsetup
- {
- newattribute =
- {itemize}{/O /List /ListNumbering/Unordered},
- newattribute =
- {enumerate}{/O /List /ListNumbering/Ordered},
- newattribute =
- {description}{/O /List /ListNumbering/Description},
- }
-\AddToHook{env/itemize/begin}{\par\tagstructbegin{tag=L,attribute-class=itemize}}%\par is needed to close the paragraph before.
-\AddToHook{env/itemize/end}{\par\tagstructend\tagstructend\tagstructend}%LBody,LI,L
-\AddToHook{env/enumerate/begin}{\par\tagstructbegin{tag=L,attribute-class=enumerate}}
-\AddToHook{env/enumerate/end}{\par\tagstructend\tagstructend\tagstructend}%LBody,LI,L
-\AddToHook{env/description/begin}{\par\tagstructbegin{tag=L,attribute-class=description}}
-\AddToHook{env/description/end}{\par\tagstructend\tagstructend\tagstructend}%LBody,LI,L
-
-\newcommand\tag@enit@format@preset[1]{%
- \str_if_eq:eeTF { \prop_item:cn { g__tag_struct_\g__tag_struct_stack_current_tl _prop }{S} }{/L}
- {
- %\typeout{BEGIN~OF~LIST}
- }
- {%\typeout{NEXT ITEM}
- \tagstructend\tagstructend} % for the LBody/LI
- \tagstructbegin{tag=LI}
- \tagstructbegin{tag=Lbl}
- \tagmcbegin{}
- #1
- \tagmcend
- \tagstructend
- \tagstructbegin{tag=LBody}
- }
-
-\ExplSyntaxOff
-\xpatchcmd\enit@preset{\@firstofone}{\tag@enit@format@preset}{}{\fail}
-%close mc from paratagging and reopen ...
-% this disturbs someone docCommand which has then a MC outside a P.
-\xpatchcmd\@item{\box\@labels}{\tagmcend \box\@labels \tagmcbegin{tag=P}}{}{\fail}
-\ExplSyntaxOn
-
-% keys that overwrite \enit@format must be patched, eg like the follow
-% the font key should be patched in a similar way
-\enitkv@key{}{format}{% new enumitem don't use first argument
- \def\enit@format{%
- \tagstructbegin{tag=LI}%
- \tagstructbegin{tag=Lbl}%
- \tagmcbegin{}%
- #1\tagmcend}}
-
-
-% listings + verbatim
-% the paragraph code could create span around the lines ...
-% we use Code for every line.
-
-\AddToHook{env/lstlisting/begin}{\tagpdfsetup{paratag=Code}}
-\AddToHook{env/lstlisting/end}{}
-
-\AddToHook{env/verbatim/begin}{\tagpdfsetup{paratag=Code}}
-\AddToHook{env/verbatim/end}{}
-
-\AddToHook{env/docCommand/begin}{\tagstructbegin{tag=P}\tagpdfsetup{paratag=Code}}
-\AddToHook{env/docCommand/end} {\tagstructend}
-
-% ======== marginnote ==========
+ % ======== marginnote ==========
% TODO marginnote has a bug (a \par is missing) so it messes up tagging.
% but currently unneeded as we marked them up as artifacts anyway as they don't contain
% meaningful contents
@@ -144,6 +103,7 @@
\tag_mc_artifact_group_begin:n{notype}\tagpdfparaOff\marginnote{#1}\tag_mc_artifact_group_end:
}
+\ExplSyntaxOff
% ======== tikzpicture ==========
% TODO this needs some investigation: it messes up the stack if one add paraOff
@@ -153,12 +113,21 @@
% We switch of paratagging at the begin and reenable it locally in before upper.
% the before upper setting is dangerous as it can be overwritten by
% users. So a more stable hook is needed.
-%\AddToHook{env/tcolorbox/begin}{\tagpdfparaOff}
-%\AddToHook{env/docCommand/begin}{\tagpdfparaOff}
-%\tcbset{before~upper=\tagpdfparaOn}
-\AddToHook{env/tcolorbox/begin}{\tagpdfparaOff \tcbset{before~upper=\tagpdfparaOn}}
-\AddToHook{env/docCommand/begin}{\tagpdfparaOff \tcbset{before~upper=\tagpdfparaOn}}
+% we force also a \par and add a div structure, to avoid clashes with the block
+% tagging code. This needs revisting!
+
+\AddToHook{env/tcolorbox/before}{\par\tagstructbegin{tag=Div}}
+\AddToHook{env/tcolorbox/begin}{\tagpdfparaOff \tcbset{before upper=\tagpdfparaOn}}
+\AddToHook{env/tcolorbox/after}{\par\tagstructend}
+
+% this is not good and only temporary, but it is still unclear how to handle internal lists.
+\ExplSyntaxOn
+\AddToHook{env/docCommand/before}{\par\tagtool{para=false}\tagstructbegin{tag=Code}\tagmcbegin{}\tag_stop:}
+\AddToHook{env/docCommand/after}{\par\tag_start:\tagmcend\tagstructend\tagtool{para=true}}
\ExplSyntaxOff
+
+%\AddToHook{env/docCommand/begin}{\tagpdfparaOff \tcbset{before upper=\tagpdfparaOn}\tagtool{paratag=Code}\tagtool{para-flattened=true}}
+
% ======= footnote ========
% done in testphase code
@@ -170,6 +139,16 @@
\newbibmacro*{begentry}{\tagstructbegin{tag=BibEntry}\tagmcbegin{}}
\newbibmacro*{finentry}{\finentry\tagmcend\tagstructend}
+\def\blx@endbibliography{%
+ \csuse{blx@endenv@\blx@theenv}%
+ \blx@noitem
+ \blx@locallabelwidth@finish
+ \endgroup
+ \blx@bibnote\blx@thepostnote
+% \endgroup
+ \expandafter\endgroup\if@endpe\@doendpe\fi
+}
+
% ====== hyperref ========
% this should probably go into tagpdf, but it is related to
% problem of pdf strings and context ....