[latex3-commits] [latex3/tagpdf] develop: correct list of standard elements, issue #92 (d562e48)

github at latex-project.org github at latex-project.org
Sat Jan 6 22:09:42 CET 2024


Repository : https://github.com/latex3/tagpdf
On branch  : develop
Link       : https://github.com/latex3/tagpdf/commit/d562e4832bd6419c178ece581cb4a242f6dff6e8

>---------------------------------------------------------------

commit d562e4832bd6419c178ece581cb4a242f6dff6e8
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sat Jan 6 22:09:42 2024 +0100

    correct list of standard elements, issue #92


>---------------------------------------------------------------

d562e4832bd6419c178ece581cb4a242f6dff6e8
 doc/tagpdf.tex                         | 52 ++++++++++++++++++++--------------
 tagpdf-data.dtx                        |  1 +
 testfiles-pdftex/parent-child-20.tlg   |  3 +-
 testfiles-pdftex/show-variables-17.tlg |  4 ++-
 testfiles-pdftex/show-variables-20.tlg |  4 ++-
 testfiles/mc-parent-child.luatex.tlg   |  6 ++--
 testfiles/mc-parent-child.tlg          |  6 ++--
 7 files changed, 46 insertions(+), 30 deletions(-)

diff --git a/doc/tagpdf.tex b/doc/tagpdf.tex
index 0e65b1c..c5198b1 100644
--- a/doc/tagpdf.tex
+++ b/doc/tagpdf.tex
@@ -2131,20 +2131,31 @@ of the PDF types can be looked up in the \PDF{}-references
 
 \begin{enumerate}
 \item The \emph{standard structure namespace for PDF 1.7}, also called 
-  the \emph{default standard structure namespace}. The public name of
-  the namespace is |tag/NS/pdf|. This can be used to reference the
-  namespace e.g. in attributes. These are the structure names from PDF
-  1.7: \ExplSyntaxOn \clist_clear:N\l_tmpa_clist \prop_map_inline:cn {
-    g__tag_role_NS_pdf_prop } { \clist_put_right:Nn \l_tmpa_clist {#1}
-  } \clist_use:Nn \l_tmpa_clist {,\c_space_tl } \ExplSyntaxOff
+    the \emph{default standard structure namespace}. The public name of 
+    the namespace is |tag/NS/pdf|. This can be used to reference the 
+    namespace e.g. in attributes. These are the structure names from PDF 
+    1.7 (\texttt{StructTreeRoot} is a bit special, it is not really a structure
+    name but nevertheless listed here): 
+    \ExplSyntaxOn %%
+    \clist_clear:N\l_tmpa_clist 
+    \prop_map_inline:cn 
+      {g__tag_role_NS_pdf_prop} 
+      {
+       \str_if_eq:eeT 
+         {#1} 
+         {\use_i:nn #2}  
+         { \clist_put_right:Nn \l_tmpa_clist {#1}  } 
+      }
+    \clist_use:Nn \l_tmpa_clist {,\c_space_tl }. %%
+    \ExplSyntaxOff 
 
 \item The \emph{standard structure namespace for PDF 2.0}.  The public
   name of the namespace is |tag/NS/pdf2|. This can be used to
   reference the namespace e.g. in attributes.  These are more or less
   same types as in PDF. The following types have been removed from
-  this set:\\
+  this set\footnote{They still can be used in a PDF 2.0 document!}:\\
 %
-\ExplSyntaxOn
+\ExplSyntaxOn %
 \clist_clear:N\l_tmpa_clist
 \prop_map_inline:cn { g__tag_role_NS_pdf_prop }
  { 
@@ -2153,20 +2164,19 @@ of the PDF types can be looked up in the \PDF{}-references
     {#1}
     { \clist_put_right:Nn \l_tmpa_clist {#1} } 
  }
-\clist_use:Nn \l_tmpa_clist {,\c_space_tl }\\
-\ExplSyntaxOff
+\clist_use:Nn \l_tmpa_clist {,\c_space_tl },\\
+\ExplSyntaxOff %
 and the following are new:\\
-\ExplSyntaxOn
-\clist_clear:N\l_tmpa_clist
-\prop_map_inline:cn { g__tag_role_NS_pdf2_prop }
- { 
-  \prop_if_in:cnF 
-    { g__tag_role_NS_pdf_prop }
-    {#1}
-    { \clist_put_right:Nn \l_tmpa_clist {#1}  } 
- }
-\clist_use:Nn \l_tmpa_clist {,\c_space_tl }
-\ExplSyntaxOff
+\ExplSyntaxOn %
+ \clist_clear:N\l_tmpa_clist %
+ \prop_map_inline:cn { g__tag_role_NS_pdf_prop } 
+   { 
+    \str_if_eq:eeF {#1}
+     {\use_i:nn #2}  
+     { \clist_put_right:Nn \l_tmpa_clist {#1}  } 
+   } 
+ \clist_use:Nn \l_tmpa_clist {,\c_space_tl }. 
+\ExplSyntaxOff %
 
 \item MathML 3.0 as an \emph{other namespaces}.  The public name of
   the namespace is |tag/NS/mathml|. This can be used to reference the
diff --git a/tagpdf-data.dtx b/tagpdf-data.dtx
index 350b5d6..8fb975c 100644
--- a/tagpdf-data.dtx
+++ b/tagpdf-data.dtx
@@ -192,6 +192,7 @@ Strong,Span,pdf,I,
 %<*ns-pdf2>
 %% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-12-18} {0.98r} 
 %%  {pdf2}  {http://iso.org/pdf2/ssn}{}
+StructTreeRoot,StructTreeRoot,pdf2,D,
 Document,Document,pdf2,D,   
 Part,Part,pdf2,G,       
 Sect,Sect,pdf2,G,       
diff --git a/testfiles-pdftex/parent-child-20.tlg b/testfiles-pdftex/parent-child-20.tlg
index 3d7e708..0a2d4a2 100644
--- a/testfiles-pdftex/parent-child-20.tlg
+++ b/testfiles-pdftex/parent-child-20.tlg
@@ -155,7 +155,8 @@ TEST 15: Root: StructTreeRoot-MC no
 ============================================================
 Package tagpdf Info: Parent-Child 'StructTreeRoot' --> 'MC'.
 (tagpdf)             Relation is -1 (='^^e2^^88^^85')
-(tagpdf)             Rolemapped from 'StructTreeRoot/pdf' --> 'MC' on line ...
+(tagpdf)             Rolemapped from 'StructTreeRoot/pdf2' --> 'MC' on line
+(tagpdf)             109
 > \l_tmpa_tl=-1.
 <recently read> }
 l. ... }
diff --git a/testfiles-pdftex/show-variables-17.tlg b/testfiles-pdftex/show-variables-17.tlg
index 8631ef1..3df6ff5 100644
--- a/testfiles-pdftex/show-variables-17.tlg
+++ b/testfiles-pdftex/show-variables-17.tlg
@@ -5,7 +5,7 @@ TEST 1: show tags -> NS
 ============================================================
 The property list \g__tag_role_tags_NS_prop contains the pairs (without outer
 braces):
->  {StructTreeRoot}  =>  {pdf}
+>  {StructTreeRoot}  =>  {pdf2}
 >  {Document}  =>  {pdf2}
 >  {Part}  =>  {pdf2}
 >  {Sect}  =>  {pdf2}
@@ -335,6 +335,7 @@ TEST 7: show tags of namespace pdf2
 ============================================================
 The property list \g__tag_role_NS_pdf2_prop contains the pairs (without outer
 braces):
+>  {StructTreeRoot}  =>  {{StructTreeRoot}{}}
 >  {Document}  =>  {{Document}{}}
 >  {Part}  =>  {{Part}{}}
 >  {Sect}  =>  {{Sect}{}}
@@ -572,6 +573,7 @@ TEST 13: show class of tags in namespace pdf2
 ============================================================
 The property list \g__tag_role_NS_pdf2_class_prop contains the pairs (without
 outer braces):
+>  {StructTreeRoot}  =>  {--UNUSED--}
 >  {Document}  =>  {--UNUSED--}
 >  {Part}  =>  {--UNUSED--}
 >  {Sect}  =>  {--UNUSED--}
diff --git a/testfiles-pdftex/show-variables-20.tlg b/testfiles-pdftex/show-variables-20.tlg
index 7d76c24..59a4f14 100644
--- a/testfiles-pdftex/show-variables-20.tlg
+++ b/testfiles-pdftex/show-variables-20.tlg
@@ -5,7 +5,7 @@ TEST 1: show tags -> NS
 ============================================================
 The property list \g__tag_role_tags_NS_prop contains the pairs (without outer
 braces):
->  {StructTreeRoot}  =>  {pdf}
+>  {StructTreeRoot}  =>  {pdf2}
 >  {Document}  =>  {pdf2}
 >  {Part}  =>  {pdf2}
 >  {Sect}  =>  {pdf2}
@@ -673,6 +673,7 @@ TEST 6: show tags of namespace pdf2
 ============================================================
 The property list \g__tag_role_NS_pdf2_prop contains the pairs (without outer
 braces):
+>  {StructTreeRoot}  =>  {{StructTreeRoot}{pdf2}}
 >  {Document}  =>  {{Document}{pdf2}}
 >  {Part}  =>  {{Part}{pdf2}}
 >  {Sect}  =>  {{Sect}{pdf2}}
@@ -1070,6 +1071,7 @@ TEST 13: show class of tags in namespace pdf2
 ============================================================
 The property list \g__tag_role_NS_pdf2_class_prop contains the pairs (without
 outer braces):
+>  {StructTreeRoot}  =>  {D}
 >  {Document}  =>  {D}
 >  {Part}  =>  {G}
 >  {Sect}  =>  {G}
diff --git a/testfiles/mc-parent-child.luatex.tlg b/testfiles/mc-parent-child.luatex.tlg
index f3115fd..2172dc9 100644
--- a/testfiles/mc-parent-child.luatex.tlg
+++ b/testfiles/mc-parent-child.luatex.tlg
@@ -6,12 +6,12 @@ Package tagpdf Info: Parent-Child 'Document' --> 'Part'.
 (tagpdf)             line 17
 Package tagpdf Info: Parent-Child 'Document' --> 'StructTreeRoot'.
 (tagpdf)             Relation is 0 (='unknown')
-(tagpdf)             Rolemapped from 'Document/pdf2' --> 'StructTreeRoot/pdf'
+(tagpdf)             Rolemapped from 'Document/pdf2' --> 'StructTreeRoot/pdf2'
 (tagpdf)             on line ...
 Package tagpdf Info: Parent-Child 'StructTreeRoot' --> 'MC'.
 (tagpdf)             Relation is -1 (='∅')
-(tagpdf)             Rolemapped from 'StructTreeRoot/pdf' --> 'MC' on line ...
-Package tagpdf Warning: Parent-Child 'StructTreeRoot/pdf' --> 'MC
+(tagpdf)             Rolemapped from 'StructTreeRoot/pdf2' --> 'MC' on line ...
+Package tagpdf Warning: Parent-Child 'StructTreeRoot/pdf2' --> 'MC
 (tagpdf)                (realcontent)'.
 (tagpdf)                Relation is not allowed (struct 3, /StructTreeRoot) on
 (tagpdf)                line 17
diff --git a/testfiles/mc-parent-child.tlg b/testfiles/mc-parent-child.tlg
index 8ba6c8f..45eedb7 100644
--- a/testfiles/mc-parent-child.tlg
+++ b/testfiles/mc-parent-child.tlg
@@ -6,12 +6,12 @@ Package tagpdf Info: Parent-Child 'Document' --> 'Part'.
 (tagpdf)             line 17
 Package tagpdf Info: Parent-Child 'Document' --> 'StructTreeRoot'.
 (tagpdf)             Relation is 0 (='unknown')
-(tagpdf)             Rolemapped from 'Document/pdf2' --> 'StructTreeRoot/pdf'
+(tagpdf)             Rolemapped from 'Document/pdf2' --> 'StructTreeRoot/pdf2'
 (tagpdf)             on line ...
 Package tagpdf Info: Parent-Child 'StructTreeRoot' --> 'MC'.
 (tagpdf)             Relation is -1 (='^^e2^^88^^85')
-(tagpdf)             Rolemapped from 'StructTreeRoot/pdf' --> 'MC' on line ...
-Package tagpdf Warning: Parent-Child 'StructTreeRoot/pdf' --> 'MC
+(tagpdf)             Rolemapped from 'StructTreeRoot/pdf2' --> 'MC' on line ...
+Package tagpdf Warning: Parent-Child 'StructTreeRoot/pdf2' --> 'MC
 (tagpdf)                (realcontent)'.
 (tagpdf)                Relation is not allowed (struct 3, /StructTreeRoot) on
 (tagpdf)                line 17





More information about the latex3-commits mailing list.