diff options
Diffstat (limited to 'Master/texmf-dist/source')
12 files changed, 85 insertions, 44 deletions
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx index 2f0e0fa8b9a..5b6acbf34ff 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.98g, released 2023-05-16} +% \date{Version 0.98h, released 2023-06-06} % \maketitle % \begin{implementation} % \begin{macrocode} %<@@=tag> %<*luatex> -\ProvidesExplFile {tagpdf-luatex.def} {2023-05-16} {0.98g} +\ProvidesExplFile {tagpdf-luatex.def} {2023-06-06} {0.98h} {tagpdf~driver~for~luatex} % \end{macrocode} % \section{Loading the lua} @@ -158,8 +158,8 @@ local ProvidesLuaModule = { name = "tagpdf", - version = "0.98g", --TAGVERSION - date = "2023-05-16", --TAGDATE + version = "0.98h", --TAGVERSION + date = "2023-06-06", --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 830e667b527..39b786ee418 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.98g, released 2023-05-16} +% \date{Version 0.98h, released 2023-06-06} % \maketitle % \begin{documentation} % \section{Commands} @@ -151,6 +151,11 @@ % & error % & in struct module % \\ +% |\@@_struct_write_obj:n| +% & |struct-orphan| +% & warning +% & in struct module +% \\ % |\tag_struct_begin:n| % & |struct-faulty-nesting| % & error @@ -295,7 +300,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-checks-code} {2023-05-16} {0.98g} +\ProvidesExplPackage {tagpdf-checks-code} {2023-06-06} {0.98h} {part of tagpdf - code related to checks, conditionals, debugging and messages} %</header> % \end{macrocode} @@ -370,6 +375,19 @@ \msg_new:nnn { tag } {struct-no-objnum} { objnum~missing~for~structure~#1 } % \end{macrocode} % \end{macro} +% \begin{macro}{struct-orphan} +% This indicates that there is a structure which has kids but no parent. +% This can happen if a structure is stashed but then not used. +% \begin{macrocode} +\msg_new:nnn { tag } {struct-orphan} + { + Structure~#1~has~#2~kids~but~no~parent.\\ + It~is~turned~into~an~artifact.\\ + Did~you~stashed~a~structure~and~then~didn't~use~it? + } + +% \end{macrocode} +% \end{macro} % \begin{macro}{struct-faulty-nesting} % This indicates that there is somewhere one |\tag_struct_end:| too much. % This should be normally an error. diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx index b2955c8a941..e66712cc7f3 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.98g, released 2023-05-16} +% \date{Version 0.98h, released 2023-06-06} % \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-05-16} {0.98g} +%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-06-06} {0.98h} %% {latex} {https://www.latex-project.org/ns/dflt/2022}{} title, Title, pdf2, part, Title, pdf2, @@ -92,7 +92,7 @@ text, P, pdf2, % It is bound to change % \begin{macrocode} %<*ns-latex-book> -%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-05-16} {0.98g} +%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-06-06} {0.98h} %% {latex-book} {https://www.latex-project.org/ns/book/2022}{} chapter, H1,pdf2, section, H2,pdf2, @@ -108,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-05-16} {0.98g} +%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-06-06} {0.98h} %% {latex-inline} {https://www.latex-project.org/ns/inline/2022}{} chapter, Span, pdf2, section, Span, pdf2, @@ -122,7 +122,7 @@ P, Span, pdf2, % \section{The pdf namespace data} % \begin{macrocode} %<*ns-pdf> -%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-05-16} {0.98g} +%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-06-06} {0.98h} %% {pdf} {http://iso.org/pdf/ssn}{} StructTreeRoot,StructTreeRoot,pdf,D, Document,Document,pdf,D, @@ -190,7 +190,7 @@ Strong,Span,pdf,I, % \section{The pdf 2.0 namespace data} % \begin{macrocode} %<*ns-pdf2> -%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-05-16} {0.98g} +%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-06-06} {0.98h} %% {pdf2} {http://iso.org/pdf2/ssn}{} Document,Document,pdf2,D, Part,Part,pdf2,G, @@ -246,7 +246,7 @@ Strong,Strong,pdf2,I, % \section{The mathml namespace data} % \begin{macrocode} %<*ns-mathml> -%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-05-16} {0.98g} +%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-06-06} {0.98h} % {mathml}{http://www.w3.org/1998/Math/MathML}{} abs,abs,mathml, and,and,mathml, @@ -481,7 +481,7 @@ xor,xor,mathml, % This will perhaps change in future. % \begin{macrocode} %<*parent-child> -%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-05-16} {0.98g} +%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-06-06} {0.98h} ,,,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,∅,∅ @@ -536,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-05-16} {0.98g} +%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-06-06} {0.98h} ,,,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 68479088a5c..a82cb685244 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.98g, released 2023-05-16} +% \date{Version 0.98h, released 2023-06-06} % \maketitle % \begin{documentation} % \end{documentation} @@ -55,11 +55,11 @@ % \begin{macrocode} %<@@=tag> %<*generic> -\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-05-16} {0.98g} +\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-06-06} {0.98h} {part of tagpdf - code related to marking chunks - generic mode} %</generic> %<*debug> -\ProvidesExplPackage {tagpdf-debug-generic} {2023-05-16} {0.98g} +\ProvidesExplPackage {tagpdf-debug-generic} {2023-06-06} {0.98h} {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 a4f61192df2..cf70950a28d 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.98g, released 2023-05-16} +% \date{Version 0.98h, released 2023-06-06} % \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-05-16} {0.98g} +\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-06-06} {0.98h} {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 cdc0aaa5a3c..2096e11d301 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.98g, released 2023-05-16} +% \date{Version 0.98h, released 2023-06-06} % \maketitle % \begin{documentation} % \section{Public Commands} @@ -174,7 +174,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-05-16} {0.98g} +\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-06-06} {0.98h} {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 ce860d71fa0..5876c4ba328 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.98g, released 2023-05-16} +% \date{Version 0.98h, released 2023-06-06} % \maketitle % \begin{documentation} % \begin{function} @@ -98,7 +98,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-roles-code} {2023-05-16} {0.98g} +\ProvidesExplPackage {tagpdf-roles-code} {2023-06-06} {0.98h} {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 e8c1edfd5c3..6e751618ee1 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.98g, released 2023-05-16} +% \date{Version 0.98h, released 2023-06-06} % \maketitle % \begin{documentation} % \begin{function}{interwordspace (setup-key)} @@ -64,7 +64,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-space-code} {2023-05-16} {0.98g} +\ProvidesExplPackage {tagpdf-space-code} {2023-06-06} {0.98h} {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 81211bd445f..542671bd152 100644 --- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx +++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Version 0.98g, released 2023-05-16} +% \date{Version 0.98h, released 2023-06-06} % \maketitle % \begin{documentation} % \section{Public Commands} @@ -247,7 +247,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-struct-code} {2023-05-16} {0.98g} +\ProvidesExplPackage {tagpdf-struct-code} {2023-06-06} {0.98h} {part of tagpdf - code related to storing structure} %</header> % \end{macrocode} @@ -837,16 +837,35 @@ { \pdf_object_if_exist:nTF { @@/struct/#1 } { +% \end{macrocode} +% It can happen that a structure is not used and so has not parent. +% Simply ignoring it is problematic as it is also recorded in +% the IDTree, so we make an artifact out of it. +% \begin{macrocode} + \prop_get:cnNF { g_@@_struct_#1_prop } {P}\l_@@_tmpb_tl + { + \prop_gput:cnx { g_@@_struct_#1_prop } {P}{\pdf_object_ref:n { @@/struct/0 }} + \prop_gput:cnx { g_@@_struct_#1_prop } {S}{/Artifact} + \seq_if_empty:cF {g_@@_struct_kids_#1_seq} + { + \msg_warning:nnxx + {tag} + {struct-orphan} + { #1 } + {\seq_count:c{g_@@_struct_kids_#1_seq}} + } + } \@@_struct_fill_kid_key:n { #1 } \@@_struct_get_dict_content:nN { #1 } \l_@@_tmpa_tl \exp_args:Nx - \pdf_object_write:nnx - { @@/struct/#1 } - {dict} - { - \l_@@_tmpa_tl\c_space_tl - /ID~\@@_struct_get_id:n{#1} - } + \pdf_object_write:nnx + { @@/struct/#1 } + {dict} + { + \l_@@_tmpa_tl\c_space_tl + /ID~\@@_struct_get_id:n{#1} + } + } { \msg_error:nnn { tag } { struct-no-objnum } { #1} @@ -1470,6 +1489,10 @@ { \tl_gset:Nx \g_@@_struct_tag_tl { \exp_last_unbraced:NV\use_i:nn \l_@@_tmpa_tl } + \prop_get:NVNT\g_@@_role_tags_NS_prop \g_@@_struct_tag_tl\l_@@_tmpa_tl + { + \tl_gset:Nx \g_@@_struct_tag_NS_tl { \l_@@_tmpa_tl } + } } %<debug>\@@_debug_struct_end_insert: } @@ -1703,7 +1726,7 @@ % \section{Attributes and attribute classes} % \begin{macrocode} %<*header> -\ProvidesExplPackage {tagpdf-attr-code} {2023-05-16} {0.98g} +\ProvidesExplPackage {tagpdf-attr-code} {2023-06-06} {0.98h} {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 decc64928fc..61f6db544ae 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.98g, released 2023-05-16} +% \date{Version 0.98h, released 2023-06-06} % \maketitle % \begin{implementation} % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-tree-code} {2023-05-16} {0.98g} +\ProvidesExplPackage {tagpdf-tree-code} {2023-06-06} {0.98h} {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 36da045bbad..8ebd1813dda 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.98g, released 2023-05-16} +% \date{Version 0.98h, released 2023-06-06} % \maketitle % \begin{documentation} % \section{Setup commands} @@ -68,7 +68,7 @@ % \begin{syntax} % \cs{tag_tool:n}\Arg{key val} % \end{syntax} -% The tagging of basic document elements will require a variaty of small commands +% The tagging of basic document elements will require a variety of small commands % to configure and adapt the tagging. This command will collect them under a command % interface. The argument is \emph{one} key-value like string. This is work in progress % and both syntax, known arguments and implementation can change! @@ -250,7 +250,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-user} {2023-05-16} {0.98g} +\ProvidesExplPackage {tagpdf-user} {2023-06-06} {0.98h} {tagpdf - user commands} %</header> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx index e9a394b5d49..b4c9e55090c 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-05-16} {0.98g} +\ProvidesExplPackage {tagpdf} {2023-06-06} {0.98h} { A package to experiment with pdf tagging } \bool_if:nF @@ -118,7 +118,7 @@ % \end{macrocode} %<*debug> % \begin{macrocode} -\ProvidesExplPackage {tagpdf-debug} {2023-05-16} {0.98g} +\ProvidesExplPackage {tagpdf-debug} {2023-06-06} {0.98h} { debug code for tagpdf } \@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput} % \end{macrocode} @@ -141,7 +141,7 @@ % we define a base package with dummy functions % \begin{macrocode} %<*base> -\ProvidesExplPackage {tagpdf-base} {2023-05-16} {0.98g} +\ProvidesExplPackage {tagpdf-base} {2023-06-06} {0.98h} {part of tagpdf - provide base, no-op versions of the user commands } %</base> % \end{macrocode} |