summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tagpdf
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/tagpdf')
-rw-r--r--macros/latex/contrib/tagpdf/README.md2
-rw-r--r--macros/latex/contrib/tagpdf/acrobat.pngbin0 -> 23311 bytes
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-backend.dtx6
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-checks.dtx7
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-code.pdfbin1523569 -> 1532339 bytes
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-data.dtx227
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx6
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx4
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx4
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-roles.dtx83
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-space.dtx4
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-struct.dtx20
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-tree.dtx15
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-user.dtx4
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf.dtx6
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf.pdfbin738728 -> 757067 bytes
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf.tex54
-rw-r--r--macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty27
18 files changed, 286 insertions, 183 deletions
diff --git a/macros/latex/contrib/tagpdf/README.md b/macros/latex/contrib/tagpdf/README.md
index dc8ac843f8..8f562a8716 100644
--- a/macros/latex/contrib/tagpdf/README.md
+++ b/macros/latex/contrib/tagpdf/README.md
@@ -1,5 +1,5 @@
#tagpdf — A package to create tagged pdf
-Packageversion: 0.98
+Packageversion: 0.98a
Packagedate: 2022/12/22
Author: Ulrike Fischer
diff --git a/macros/latex/contrib/tagpdf/acrobat.png b/macros/latex/contrib/tagpdf/acrobat.png
new file mode 100644
index 0000000000..6ffe1ba29d
--- /dev/null
+++ b/macros/latex/contrib/tagpdf/acrobat.png
Binary files differ
diff --git a/macros/latex/contrib/tagpdf/tagpdf-backend.dtx b/macros/latex/contrib/tagpdf/tagpdf-backend.dtx
index 47369b519b..e8fac1f6ec 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-backend.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-backend.dtx
@@ -47,13 +47,13 @@
% }^^A
% }
%
-% \date{Version 0.98, released 2022-12-22}
+% \date{Version 0.98a, released 2022-12-22}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*luatex>
-\ProvidesExplFile {tagpdf-luatex.def} {2022-12-22} {0.98}
+\ProvidesExplFile {tagpdf-luatex.def} {2022-12-22} {0.98a}
{tagpdf~driver~for~luatex}
% \end{macrocode}
% \section{Loading the lua}
@@ -158,7 +158,7 @@
local ProvidesLuaModule = {
name = "tagpdf",
- version = "0.98", --TAGVERSION
+ version = "0.98a", --TAGVERSION
date = "2022-12-22", --TAGDATE
description = "tagpdf lua code",
license = "The LATEX Project Public License 1.3c"
diff --git a/macros/latex/contrib/tagpdf/tagpdf-checks.dtx b/macros/latex/contrib/tagpdf/tagpdf-checks.dtx
index 52113f348f..6ec0e6aadc 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-checks.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-checks.dtx
@@ -48,7 +48,7 @@
% }^^A
% }
%
-% \date{Version 0.98, released 2022-12-22}
+% \date{Version 0.98a, released 2022-12-22}
% \maketitle
% \begin{documentation}
% \section{Commands}
@@ -295,7 +295,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-checks-code} {2022-12-22} {0.98}
+\ProvidesExplPackage {tagpdf-checks-code} {2022-12-22} {0.98a}
{part of tagpdf - code related to checks, conditionals, debugging and messages}
%</header>
% \end{macrocode}
@@ -546,8 +546,7 @@
%
% \subsection{checks for active tagging}
% \begin{macro}[TF]{\@@_check_if_active_mc:,\@@_check_if_active_struct:}
-% Structures must have a tag, so we check if the S entry is in the property.
-% It is an error if this is missing. The argument is a number.
+% This checks if mc are active.
% \begin{macrocode}
\prg_new_conditional:Npnn \@@_check_if_active_mc: {T,F,TF}
{
diff --git a/macros/latex/contrib/tagpdf/tagpdf-code.pdf b/macros/latex/contrib/tagpdf/tagpdf-code.pdf
index 6dfd5b74a4..b0bb3a8290 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-code.pdf
+++ b/macros/latex/contrib/tagpdf/tagpdf-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/tagpdf/tagpdf-data.dtx b/macros/latex/contrib/tagpdf/tagpdf-data.dtx
index 560856bf28..379c2114d7 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-data.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-data.dtx
@@ -47,7 +47,7 @@
% }^^A
% }
%
-% \date{Version 0.98, released 2022-12-22}
+% \date{Version 0.98a, released 2022-12-22}
% \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} {2022-12-22} {0.98}
+%% \ProvidesExplFile {tagpdf-ns-latex.def} {2022-12-22} {0.98a}
%% {latex} {https://www.latex-project.org/ns/dflt/2022}{}
title, Title, pdf2,
part, Title, pdf2,
@@ -86,7 +86,7 @@ footnotelabel,Lbl, pdf2,
% It is bound to change
% \begin{macrocode}
%<*ns-latex-book>
-%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2022-12-22} {0.98}
+%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2022-12-22} {0.98a}
%% {latex-book} {https://www.latex-project.org/ns/book/2022}{}
chapter, H1,pdf2,
section, H2,pdf2,
@@ -102,7 +102,7 @@ subparagraph, H6,pdf2,
% It is bound to change a lot!
% \begin{macrocode}
%<*ns-latex-inline>
-%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2022-12-22} {0.98}
+%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2022-12-22} {0.98a}
%% {latex-inline} {https://www.latex-project.org/ns/inline/2022}{}
chapter, Span, pdf2,
section, Span, pdf2,
@@ -116,120 +116,131 @@ P, Span, pdf2,
% \section{The pdf namespace data}
% \begin{macrocode}
%<*ns-pdf>
-%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2022-12-22} {0.98}
+%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2022-12-22} {0.98a}
%% {pdf} {http://iso.org/pdf/ssn}{}
-StructTreeRoot,,,D,
-Document,,,D,
-Part,,,G,
-Sect,,,G,
-Div,,,G,
-Caption,,,GB,
-NonStruct,,,G,
-H,,,B,
-H1,,,B,
-H2,,,B,
-H3,,,B,
-H4,,,B,
-H5,,,B,
-H6,,,B,
-P,,,B,
-L,,,BI,
-LI,,,L,
-Lbl,,,I,
-LBody,,,L,
-Table,,,B,
-TR,,,T,
-TH,,,T,
-TD,,,T,
-THead,,,T,
-TBody,,,T,
-TFoot,,,T,
-Span,,,I,
-Link,,,GBI,
-Annot,,,GBI,
-Figure,,,GBI,
-Formula,,,GBI,
-Form,,,GBI,
-Ruby,,,I,
-RB,,,I,
-RT,,,I,
-Warichu,,,I,
-WT,,,I,
-WP,,,I,
-Artifact,,,GBI,
-Art,,,,G, % only pdf, types unclear, needs correction later
-BlockQuote,,,G, %or GB?
-TOC,,,G,
-TOCI,,,G,
-Index,,,G,
-Private,,,G,
-Quote,,,I,
-Note,,,GBI, % I in reference, but
-Reference,,,B, %
-BibEntry,,,B, %
-Code,,,I, %
+StructTreeRoot,StructTreeRoot,pdf,D,
+Document,Document,pdf,D,
+Part,Part,pdf,G,
+Sect,Sect,pdf,G,
+Div,Div,pdf,G,
+Caption,Caption,pdf,GB,
+NonStruct,NonStruct,pdf,G,
+H,H,pdf,B,
+H1,H1,pdf,B,
+H2,H2,pdf,B,
+H3,H3,pdf,B,
+H4,H4,pdf,B,
+H5,H5,pdf,B,
+H6,H6,pdf,B,
+P,P,pdf,B,
+L,L,pdf,BI,
+LI,LI,pdf,L,
+Lbl,Lbl,pdf,I,
+LBody,LBody,pdf,L,
+Table,Table,pdf,B,
+TR,TR,pdf,T,
+TH,TH,pdf,T,
+TD,TD,pdf,T,
+THead,THead,pdf,T,
+TBody,TBody,pdf,T,
+TFoot,TFoot,pdf,T,
+Span,Span,pdf,I,
+Link,Link,pdf,GBI,
+Annot,Annot,pdf,GBI,
+Figure,Figure,pdf,GBI,
+Formula,Formula,pdf,GBI,
+Form,Form,pdf,GBI,
+Ruby,Ruby,pdf,I,
+RB,RB,pdf,I,
+RT,RT,pdf,I,
+Warichu,Warichu,pdf,I,
+WT,WT,pdf,I,
+WP,WP,pdf,I,
+Artifact,Artifact,pdf,GBI,
+Art,Art,pdf,,G, % only pdf, types unclear, needs correction later
+BlockQuote,BlockQuote,pdf,G, %or GB?
+TOC,TOC,pdf,G,
+TOCI,TOCI,pdf,G,
+Index,Index,pdf,G,
+Private,Private,pdf,G,
+Quote,Quote,pdf,I,
+Note,Note,pdf,GBI, % I in reference, but
+Reference,Reference,pdf,B, %
+BibEntry,BibEntry,pdf,B, %
+Code,Code,pdf,I, %
+DocumentFragment,Art,pdf,D, %from pdf2
+Aside,Note,pdf,G,
+H7,H6,pdf,B,
+H8,H6,pdf,B,
+H9,H6,pdf,B,
+H10,H6,pdf,B,
+Title,P,pdf,GB,
+FENote,Note,pdf,GBI,
+Sub,Span,pdf,I,
+Em,Span,pdf,I,
+Strong,Span,pdf,I,
%</ns-pdf>
% \end{macrocode}
% \section{The pdf 2.0 namespace data}
% \begin{macrocode}
%<*ns-pdf2>
-%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2022-12-22} {0.98}
+%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2022-12-22} {0.98a}
%% {pdf2} {http://iso.org/pdf2/ssn}{}
-Document,,,D,
-Part,,,G,
-Sect,,,G,
-Div,,,G,
-Caption,,,GB,
-NonStruct,,,G,
-H,,,B,
-H1,,,B,
-H2,,,B,
-H3,,,B,
-H4,,,B,
-H5,,,B,
-H6,,,B,
-P,,,B,
-L,,,BI,
-LI,,,L,
-Lbl,,,I,
-LBody,,,L,
-Table,,,B,
-TR,,,T,
-TH,,,T,
-TD,,,T,
-THead,,,T,
-TBody,,,T,
-TFoot,,,T,
-Span,,,I,
-Link,,,GBI,
-Annot,,,GBI,
-Figure,,,GBI,
-Formula,,,GBI,
-Form,,,GBI,
-Ruby,,,I,
-RB,,,I,
-RT,,,I,
-Warichu,,,I,
-WT,,,I,
-WP,,,I,
-Artifact,,,GBI,
-DocumentFragment,Art, pdf,D, %rest only pdf2
-Aside, Note, pdf,G,
-H7, H6, pdf,B,
-H8, H6, pdf,B,
-H9, H6, pdf,B,
-H10, H6, pdf,B,
-Title, P, pdf,GB,
-FENote, Note, pdf,GBI,
-Sub, Span, pdf,I,
-Em, Span, pdf,I,
-Strong, Span, pdf,I,
+Document,Document,pdf2,D,
+Part,Part,pdf2,G,
+Sect,Sect,pdf2,G,
+Div,Div,pdf2,G,
+Caption,Caption,pdf2,GB,
+NonStruct,NonStruct,pdf2,G,
+H,H,pdf2,B,
+H1,H1,pdf2,B,
+H2,H2,pdf2,B,
+H3,H3,pdf2,B,
+H4,H4,pdf2,B,
+H5,H5,pdf2,B,
+H6,H6,pdf2,B,
+P,P,pdf2,B,
+L,L,pdf2,BI,
+LI,LI,pdf2,L,
+Lbl,Lbl,pdf2,I,
+LBody,LBody,pdf2,L,
+Table,Table,pdf2,B,
+TR,TR,pdf2,T,
+TH,TH,pdf2,T,
+TD,TD,pdf2,T,
+THead,THead,pdf2,T,
+TBody,TBody,pdf2,T,
+TFoot,TFoot,pdf2,T,
+Span,Span,pdf2,I,
+Link,Link,pdf2,GBI,
+Annot,Annot,pdf2,GBI,
+Figure,Figure,pdf2,GBI,
+Formula,Formula,pdf2,GBI,
+Form,Form,pdf2,GBI,
+Ruby,Ruby,pdf2,I,
+RB,RB,pdf2,I,
+RT,RT,pdf2,I,
+Warichu,Warichu,pdf2,I,
+WT,WT,pdf2,I,
+WP,WP,pdf2,I,
+Artifact,Artifact,pdf2,GBI,
+DocumentFragment,DocumentFragment,pdf2,D, %rest only pdf2
+Aside,Aside,pdf2,G,
+H7,H7,pdf2,B,
+H8,H8,pdf2,B,
+H9,H9,pdf2,B,
+H10,H10,pdf2,B,
+Title,Title,pdf2,GB,
+FENote,FENote,pdf2,GBI,
+Sub,Sub,pdf2,I,
+Em,Em,pdf2,I,
+Strong,Strong,pdf2,I,
%</ns-pdf2>
% \end{macrocode}
% \section{The mathml namespace data}
% \begin{macrocode}
%<*ns-mathml>
-%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2022-12-22} {0.98}
+%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2022-12-22} {0.98a}
% {mathml}{http://www.w3.org/1998/Math/MathML}{}
abs,,,
and,,,
@@ -464,7 +475,7 @@ xor,,,
% This will perhaps change in future.
% \begin{macrocode}
%<*parent-child>
-%% \ProvidesExplFile {tagpdf-parent-child.csv} {2022-12-22} {0.98}
+%% \ProvidesExplFile {tagpdf-parent-child.csv} {2022-12-22} {0.98a}
,,,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,∅,∅
@@ -519,7 +530,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} {2022-12-22} {0.98}
+%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2022-12-22} {0.98a}
,,,StructTreeRoot,Document,DocumentFragment,Art,Part,Div,Sect,Aside,BlockQuote,NonStruct,TOC,TOCI,Index,Private,Title,Sub,Quote,Note,Reference,BibEntry,P,Hn,H,Lbl,Code,Em,Strong,Span,Link,Annot,Form,Ruby,RB,RT,RP,Warichu,WT,WP,FENote,L,LI,LBody,Table,TR,TH,TD,THead,TBody,TFoot,Caption,Figure,Formula,math,mathml,Artifact,MC
Document,both,document level,1,0..n,0..n,∅,‡,‡,∅,0..n,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,0..n,∅
DocumentFragment,2.0,document level,∅,0..n,0..n,0..n,‡,‡,0..n,0..n,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅*,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅*,∅*,∅,∅,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅,0..n,∅
diff --git a/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx b/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx
index ea460e0104..573604fa87 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98, released 2022-12-22}
+% \date{Version 0.98a, released 2022-12-22}
% \maketitle
% \begin{documentation}
% \end{documentation}
@@ -55,11 +55,11 @@
% \begin{macrocode}
%<@@=tag>
%<*generic>
-\ProvidesExplPackage {tagpdf-mc-code-generic} {2022-12-22} {0.98}
+\ProvidesExplPackage {tagpdf-mc-code-generic} {2022-12-22} {0.98a}
{part of tagpdf - code related to marking chunks - generic mode}
%</generic>
%<*debug>
-\ProvidesExplPackage {tagpdf-debug-generic} {2022-12-22} {0.98}
+\ProvidesExplPackage {tagpdf-debug-generic} {2022-12-22} {0.98a}
{part of tagpdf - debugging code related to marking chunks - generic mode}
%</debug>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx b/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx
index ca8645e76c..6195218abf 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98, released 2022-12-22}
+% \date{Version 0.98a, released 2022-12-22}
% \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} {2022-12-22} {0.98}
+\ProvidesExplPackage {tagpdf-mc-code-lua} {2022-12-22} {0.98a}
{tagpdf - mc code only for the luamode }
%</luamode>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx b/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx
index 2e49c84725..66ad8a922c 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98, released 2022-12-22}
+% \date{Version 0.98a, released 2022-12-22}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
@@ -174,7 +174,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-mc-code-shared} {2022-12-22} {0.98}
+\ProvidesExplPackage {tagpdf-mc-code-shared} {2022-12-22} {0.98a}
{part of tagpdf - code related to marking chunks -
code shared by generic and luamode }
%</header>
diff --git a/macros/latex/contrib/tagpdf/tagpdf-roles.dtx b/macros/latex/contrib/tagpdf/tagpdf-roles.dtx
index b17515882e..d24fae960e 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-roles.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-roles.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98, released 2022-12-22}
+% \date{Version 0.98a, released 2022-12-22}
% \maketitle
% \begin{documentation}
% \begin{function}
@@ -90,7 +90,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-roles-code} {2022-12-22} {0.98}
+\ProvidesExplPackage {tagpdf-roles-code} {2022-12-22} {0.98a}
{part of tagpdf - code related to roles and structure names}
%</header>
% \end{macrocode}
@@ -464,6 +464,26 @@
\cs_generate_variant:Nn \@@_role_add_tag:nn {VV,ne}
% \end{macrocode}
% \end{macro}
+%
+% For the parent-child test we must be able to get the role.
+% We use the same number of arguments as for the 2.0 command.
+% If there is no role, we assume a standard tag.
+% \begin{macro}{\@@_role_get:nnN}
+% \begin{macrocode}
+\pdf_version_compare:NnT < {2.0}
+ {
+ \cs_new:Npn \@@_role_get:nnN #1#2#3
+ {
+ \prop_get:NnNF \g_@@_role_rolemap_prop {#1}#3
+ {
+ \tl_set:Nn #3 {#1}
+ }
+ }
+ \cs_generate_variant:Nn \@@_role_get:nnN {VVN}
+ }
+
+% \end{macrocode}
+% \end{macro}
% \subsubsection{The pdf 2.0 version}
% \begin{macro}{\@@_role_add_tag:nnnn}
% The pdf 2.0 version takes four arguments:
@@ -481,15 +501,21 @@
{
\tl_set:Nn\l_@@_tmpa_tl{--UNKNOWN--}
}
- \@@_role_alloctag:nnV {#1}{#2}\l_@@_tmpa_tl
- \pdfdict_gput:nnx {g_@@_role/RoleMapNS_#2_dict}{#1}
- {
- [
- \pdf_name_from_unicode_e:n{#3}
- \c_space_tl
- \pdf_object_ref:n {tag/NS/#4}
- ]
- }
+ \@@_role_alloctag:nnV {#1}{#2}\l_@@_tmpa_tl
+% \end{macrocode}
+% Do not remap standard tags. TODO add warning?
+% \begin{macrocode}
+ \tl_if_in:nnF {-pdf-pdf2-mathml-}{-#2-}
+ {
+ \pdfdict_gput:nnx {g_@@_role/RoleMapNS_#2_dict}{#1}
+ {
+ [
+ \pdf_name_from_unicode_e:n{#3}
+ \c_space_tl
+ \pdf_object_ref:n {tag/NS/#4}
+ ]
+ }
+ }
% \end{macrocode}
% We resolve rolemapping recursively so that all targets are stored as standard
% tags for the tests.
@@ -511,6 +537,28 @@
% \end{macrocode}
% \end{macro}
%
+% For the parent-child test we must be able to get the role.
+% We use the same number of arguments as for the <2.0 command (and assume
+% that we don't need a name space)%
+% \begin{macro}{\@@_role_get:nnN}
+% \begin{macrocode}
+\pdf_version_compare:NnF < {2.0}
+ {
+ \cs_new:Npn \@@_role_get:nnN #1#2#3
+ {
+ \prop_get:cnNTF {g_@@_role_NS_#2_prop} {#1}\l_@@_get_tmpc_tl
+ {
+ \tl_set:Nx #3 {\exp_last_unbraced:NV\use_i:nn \l_@@_get_tmpc_tl}
+ }
+ {
+ \tl_set:Nn #3 {#1}
+ }
+ }
+ \cs_generate_variant:Nn \@@_role_get:nnN {VVN}
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Helper command to read the data from files}
% In this section we setup the helper command to read namespace files.
@@ -547,7 +595,7 @@
\tl_set:Nn \l_@@_tmpa_tl {#5}
}
\@@_role_alloctag:nnV {#2}{#1}\l_@@_tmpa_tl
- \tl_if_empty:nF {#3}
+ \tl_if_eq:nnF {#2}{#3}
{
\@@_role_add_tag:nn {#2}{#3}
}
@@ -581,9 +629,9 @@
\bool_lazy_and:nnT
{ ! \tl_if_empty_p:n {#3} }{! \str_if_eq_p:nn {#1}{pdf2}}
{
- \@@_role_add_tag:nnnn {#2}{#1}{#3}{#4}
- \prop_gput:cnn {g_@@_role_NS_#1_prop} {#2}{{#3}{#4}}
+ \@@_role_add_tag:nnnn {#2}{#1}{#3}{#4}
}
+ \prop_gput:cnn {g_@@_role_NS_#1_prop} {#2}{{#3}{#4}}
}
}
}
@@ -855,11 +903,14 @@
\seq_pop_left:NN \l_@@_role_tmpa_seq\l_@@_get_tmpc_tl
\seq_map_inline:Nn\l_@@_role_tmpa_seq
{
- \tl_if_in:nnF {-Part-Div-NonStruct-}{-##1-}
+ \tl_set:Nx\l_@@_tmpa_tl { \use_ii:nn ##1 }
+ \exp_args:Nne
+ \tl_if_in:nnF {-Part-Div-NonStruct-}{-\l_@@_tmpa_tl-}
{
\tl_set:Nn\l_@@_role_real_parent_tl {##1}
\int_zero:N\l_@@_tmpa_int
- \@@_role_get_parent_child_rule:nnN {##1}{#2}#3
+ \exp_args:NV
+ \@@_role_get_parent_child_rule:nnN \l_@@_tmpa_tl{#2}#3
\int_set:Nn\l_@@_tmpa_int{1}
\seq_map_break:
}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-space.dtx b/macros/latex/contrib/tagpdf/tagpdf-space.dtx
index ad5e17ff5b..26602a96b0 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-space.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-space.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98, released 2022-12-22}
+% \date{Version 0.98a, released 2022-12-22}
% \maketitle
% \begin{documentation}
% \begin{function}{interwordspace (setup-key)}
@@ -64,7 +64,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-space-code} {2022-12-22} {0.98}
+\ProvidesExplPackage {tagpdf-space-code} {2022-12-22} {0.98a}
{part of tagpdf - code related to real space chars}
%</header>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-struct.dtx b/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
index 6f6d60ba4b..1299cc10e9 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98, released 2022-12-22}
+% \date{Version 0.98a, released 2022-12-22}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
@@ -242,7 +242,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-struct-code} {2022-12-22} {0.98}
+\ProvidesExplPackage {tagpdf-struct-code} {2022-12-22} {0.98a}
{part of tagpdf - code related to storing structure}
%</header>
% \end{macrocode}
@@ -294,7 +294,7 @@
% numbered stack, lets build a tag stack too.
% \begin{macrocode}
\seq_new:N \g_@@_struct_tag_stack_seq
-\seq_gpush:Nn \g_@@_struct_tag_stack_seq {Root}
+\seq_gpush:Nn \g_@@_struct_tag_stack_seq {{Root}{StructTreeRoot}}
% \end{macrocode}
% \end{variable}
%
@@ -546,7 +546,7 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\cc}
+% \begin{macro}{\@@_struct_get_tag_info:nNN}
% We also need a way to get the tag info back from parent structures.
% \begin{macrocode}
\cs_new_protected:Npn \@@_struct_get_tag_info:nNN #1 #2 #3
@@ -1226,7 +1226,12 @@
}
}
\seq_gpush:NV \g_@@_struct_stack_seq \c@g_@@_struct_abs_int
- \seq_gpush:NV \g_@@_struct_tag_stack_seq \g_@@_struct_tag_tl
+ \@@_role_get:VVN
+ \g_@@_struct_tag_tl
+ \g_@@_struct_tag_NS_tl
+ \l_@@_get_tmpc_tl
+ \seq_gpush:Nx \g_@@_struct_tag_stack_seq
+ {{\g_@@_struct_tag_tl}{\l_@@_get_tmpc_tl}}
\tl_gset:NV \g_@@_struct_stack_current_tl \c@g_@@_struct_abs_int
%\seq_show:N \g_@@_struct_stack_seq
\bool_if:NF
@@ -1314,7 +1319,8 @@
}
\seq_get:NNT \g_@@_struct_tag_stack_seq \l_@@_tmpa_tl
{
- \tl_gset:NV \g_@@_struct_tag_tl \l_@@_tmpa_tl
+ \tl_gset:Nx \g_@@_struct_tag_tl
+ { \exp_last_unbraced:NV\use_i:nn \l_@@_tmpa_tl }
}
%<debug>\@@_debug_struct_end_insert:
}
@@ -1474,7 +1480,7 @@
% \section{Attributes and attribute classes}
% \begin{macrocode}
%<*header>
-\ProvidesExplPackage {tagpdf-attr-code} {2022-12-22} {0.98}
+\ProvidesExplPackage {tagpdf-attr-code} {2022-12-22} {0.98a}
{part of tagpdf - code related to attributes and attribute classes}
%</header>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-tree.dtx b/macros/latex/contrib/tagpdf/tagpdf-tree.dtx
index ecbd96f04e..f8c7aa27d7 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-tree.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-tree.dtx
@@ -47,13 +47,13 @@
% }^^A
% }
%
-% \date{Version 0.98, released 2022-12-22}
+% \date{Version 0.98a, released 2022-12-22}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-tree-code} {2022-12-22} {0.98}
+\ProvidesExplPackage {tagpdf-tree-code} {2022-12-22} {0.98a}
{part of tagpdf - code related to writing trees and dictionaries to the pdf}
%</header>
% \end{macrocode}
@@ -348,9 +348,12 @@
{
\prop_map_inline:Nn\g_@@_role_rolemap_prop
{
- \pdfdict_gput:nnx {g_@@_role/RoleMap_dict}
- {##1}
- {\pdf_name_from_unicode_e:n{##2}}
+ \tl_if_eq:nnF {##1}{##2}
+ {
+ \pdfdict_gput:nnx {g_@@_role/RoleMap_dict}
+ {##1}
+ {\pdf_name_from_unicode_e:n{##2}}
+ }
}
\pdf_object_write:nnx { @@/tree/rolemap }{dict}
{
@@ -418,7 +421,7 @@
\cs_new_protected:Npn \@@_tree_write_namespaces:
{
\pdf_version_compare:NnF < {2.0}
- {
+ {
\prop_map_inline:Nn \g_@@_role_NS_prop
{
\pdfdict_if_empty:nF {g_@@_role/RoleMapNS_##1_dict}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-user.dtx b/macros/latex/contrib/tagpdf/tagpdf-user.dtx
index a70c14bb21..a2a0475ccf 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-user.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-user.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98, released 2022-12-22}
+% \date{Version 0.98a, released 2022-12-22}
% \maketitle
% \begin{documentation}
% \section{Setup commands}
@@ -246,7 +246,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-user} {2022-12-22} {0.98}
+\ProvidesExplPackage {tagpdf-user} {2022-12-22} {0.98a}
{tagpdf - user commands}
%</header>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf.dtx b/macros/latex/contrib/tagpdf/tagpdf.dtx
index d9550ab7a7..59795d78a3 100644
--- a/macros/latex/contrib/tagpdf/tagpdf.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf.dtx
@@ -92,7 +92,7 @@
% \begin{macrocode}
%<@@=tag>
%<*package>
-\ProvidesExplPackage {tagpdf} {2022-12-22} {0.98}
+\ProvidesExplPackage {tagpdf} {2022-12-22} {0.98a}
{ A package to experiment with pdf tagging }
\bool_if:nF
@@ -118,7 +118,7 @@
% \end{macrocode}
%<*debug>
% \begin{macrocode}
-\ProvidesExplPackage {tagpdf-debug} {2022-12-22} {0.98}
+\ProvidesExplPackage {tagpdf-debug} {2022-12-22} {0.98a}
{ debug code for tagpdf }
\@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput}
% \end{macrocode}
@@ -159,7 +159,7 @@
% \end{macrocode}
% \begin{macrocode}
%<*base>
-\ProvidesExplPackage {tagpdf-base} {2022-12-22} {0.98}
+\ProvidesExplPackage {tagpdf-base} {2022-12-22} {0.98a}
{part of tagpdf - provide base, no-op versions of the user commands }
%</base>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf.pdf b/macros/latex/contrib/tagpdf/tagpdf.pdf
index a04314fa71..08ec9e590c 100644
--- a/macros/latex/contrib/tagpdf/tagpdf.pdf
+++ b/macros/latex/contrib/tagpdf/tagpdf.pdf
Binary files differ
diff --git a/macros/latex/contrib/tagpdf/tagpdf.tex b/macros/latex/contrib/tagpdf/tagpdf.tex
index c1fe9d2d35..fc096c338d 100644
--- a/macros/latex/contrib/tagpdf/tagpdf.tex
+++ b/macros/latex/contrib/tagpdf/tagpdf.tex
@@ -4,7 +4,7 @@
\DocumentMetadata{pdfversion=2.0,lang=en-UK,testphase=phase-II,testphase=toc-tagging,testphase=sec-tagging,pdfstandard=a-2b}
\makeatletter
-\def\UlrikeFischer@package@version{0.98}
+\def\UlrikeFischer@package@version{0.98a}
\def\UlrikeFischer@package@date{2022-12-22}
\makeatother
@@ -203,7 +203,9 @@ support \PDF{} 2.0. One example is the support for associated files, another the
The package doesn't try to suppress all 2.0 features if an older \PDF{} version is produced. It normally doesn't harm if a \PDF{} contains keys unknown in its version and it makes the code faster and easier to maintain if there aren't too many tests and code pathes; so for example associated files will always be added. But tests could be added in case this leads to incompabilities.
-It should be noted that some tools don't like \PDF{}~2.0. PAC3 for example simply crashes, and pdftk will create a \PDF{}~1.0 from it. This makes testing \PDF{}~2.0 files a bit of a challenge.
+It should be noted that some tools don't like \PDF{}~2.0. PAC~3 for example
+simply crashes, and pdftk will create a \PDF{}~1.0 from it. This makes
+testing \PDF{}~2.0 files a bit of a challenge.
\subsection{Validation}
@@ -223,10 +225,13 @@ One must check how good the accessibility is \emph{practically}.
\end{itemize}
-Syntax validation and formal standard validation can be done with preflight of the (non-free) adobe acrobat.
-It can also be done also with the free \PDF{} Accessibility Checker (PAC~3) \parencite{pac3}.
-There is also the validator veraPDF \parencite{verapdf}.
-A rather new and quite useful tool is \enquote{Next Generation PDF} \parencite{ngpdf}, a browser application which converts a tagged PDF to html, allows to inspect its structure and also to edit the structure.
+Syntax validation and formal standard validation can be done with preflight
+of the (non-free) adobe acrobat. It can also be done also with the free
+\PDF{} Accessibility Checker (PAC~3) \parencite{pac3}. There is also the
+validator veraPDF \parencite{verapdf}. A rather new and quite useful tool is
+\enquote{Next Generation PDF} \parencite{ngpdf}, a browser application which
+converts a tagged PDF to html, allows to inspect its structure and also to
+edit the structure.
Practical validation is naturally the more complicated part. It needs screen reader, users which actually knows how to handle them, can test documents and can report where a \PDF{} has real accessibility problems.
@@ -459,9 +464,23 @@ can improve the html export.
\subsection{Proof of concept: the tagging of the documentation itself}
-Starting with version 0.6 the documentation itself has been tagged. The tagging wasn't (and isn't) in no way perfect. The validator from Adobe didn't complain, but PAX3 wanted alternative text for all links (no idea why) and so I put everywhere simple text like \enquote{link} and \enquote{ref}. The links to footnotes gave warnings, so I disabled them. I used types from the \PDF{} version 1.7, mostly as I have no idea what should be used for code in 2.0. Margin notes were simply wrong \ldots
+Starting with version 0.6 the documentation itself has been tagged. The
+tagging wasn't (and isn't) in no way perfect. The validator from Adobe didn't
+complain, but PAC~3 wanted alternative text for all links (no idea why) and
+so I put everywhere simple text like \enquote{link} and \enquote{ref}. The
+links to footnotes gave warnings, so I disabled them. I used types from the
+\PDF{} version 1.7, mostly as I had no idea what should be used for code in
+2.0. Margin notes were simply wrong \ldots
+
+The tagging has been improved and automated over time in sync with
+improvements and new features in the LaTeX kernel and the \PDF\ management
+code and is now much better. Sadly the output of the validators don't quite
+reflect the improvements. The documentation uses now \PDF~2.0 and PAC~3
+can't handle this, it claims that the file is damaged. The Adobe validator
+has a bug and doesn't like the (valid) use of the \texttt{Lbl} tag for the
+section numbers (see figure~\ref{fig:adobe}).
+
-The tagging has been improved and automated over time in sync with improvements and new features in the LaTeX kernel and the \PDF\ management code.
But even if the documentation passed the tests of the validators: as mentioned above passing a formal test doesn't mean that the content is really good and usable. I have a lot doubts that the code parts are really readable. The bibliography and the references must be improved. The user commands used for the tagging and also some of the patches used are still rather crude. So there is lot space for improvement.
@@ -471,12 +490,29 @@ Be aware that to create the tagged version a current lualatex-dev and a current
\tagpdfparaOff
-\tagstructbegin{tag=Figure,alt=PAC3 report,attribute=bbox}\tagmcbegin{tag=Figure}
+\tagstructbegin{tag=Figure,alt=PAC 3
+report,attribute=bbox}\tagmcbegin{tag=Figure}
\includegraphics{pac3}
\tagmcend\tagstructend
\tagpdfparaOn
+\begin{figure}
+\tagpdfparaOff
+
+\tagstructbegin{tag=Figure,alt={Adobe report},attribute=bbox}%
+\tagmcbegin{}%
+\includegraphics{acrobat}
+\tagmcend
+
+\tagstructbegin{tag=Caption}\tagmcbegin{}\caption{Adobe Acrobat complaining
+about the \texttt{Lbl} use}\label{fig:adobe} \tagmcend\tagstructend
+\tagstructend
+
+\tagpdfparaOn
+\end{figure}
+
+
\section{Loading}
The package requires the new PDF management. With a current \LaTeX{} (2022-06-01 or newer)
diff --git a/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty b/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty
index 9e39ec1547..cc4eb9f4b7 100644
--- a/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty
+++ b/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty
@@ -1,5 +1,5 @@
%\RequirePackage[enable-debug]{expl3}[2018/06/14]
-\ProvidesExplPackage {tagpdfdocu-patches} {2022-12-22} {0.98}
+\ProvidesExplPackage {tagpdfdocu-patches} {2022-12-22} {0.98a}
{patches/commands for the tagpdf documentation}
\RequirePackage{etoolbox,xpatch}
@@ -10,17 +10,16 @@
\tag_mc_end_push:
\tag_struct_begin:n{tag=Span,alt=TeX,actualtext=TeX}
\tagmcbegin{}
- \kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\@
+ T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\@
\tagmcend
\tag_struct_end:
\tag_mc_begin_pop:n{}}
-\DeclareRobustCommand{\LaTeX}{
+\DeclareRobustCommand{\LaTeX}{L\kern-.36em%
{
- \tag_mc_end_push:
- \tag_struct_begin:n{tag=Span,alt=LaTeX,actualtext=LaTeX}
- \tagmcbegin{}
- L\kern-.36em%
- \sbox\z@ T%
+ \tag_mc_end_push:
+ \tag_struct_begin:n{tag=Span,alt=LaTeX,actualtext=LaTeX}
+ \tagmcbegin{}
+ \sbox\z@ T%
\vbox to\ht\z@{\hbox{\check@mathfonts
\fontsize\sf@size\z@
\math@fontsfalse\selectfont
@@ -28,13 +27,11 @@
\vss}%
}%
\kern-.15em%
- \TeX
- \tagmcend
- \tag_struct_end:
- \tag_mc_begin_pop:n{}
- }
-
-
+ T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\@
+ \tagmcend
+ \tag_struct_end:
+ \tag_mc_begin_pop:n{}
+ }
% textbf
\AddToHook{cmd/textbf/before}