diff options
33 files changed, 344 insertions, 184 deletions
diff --git a/Master/texmf-dist/doc/latex/tagpdf/README.md b/Master/texmf-dist/doc/latex/tagpdf/README.md index e6db86a9e40..fd324960da2 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.98c -Packagedate: 2023/01/30 +Packageversion: 0.98d +Packagedate: 2023/02/15 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 Binary files differindex c8c3c146cb1..d3c692b9d07 100644 --- a/Master/texmf-dist/doc/latex/tagpdf/tagpdf-code.pdf +++ b/Master/texmf-dist/doc/latex/tagpdf/tagpdf-code.pdf diff --git a/Master/texmf-dist/doc/latex/tagpdf/tagpdf.pdf b/Master/texmf-dist/doc/latex/tagpdf/tagpdf.pdf Binary files differindex 3edd2185eb3..8266cfc1b3d 100644 --- a/Master/texmf-dist/doc/latex/tagpdf/tagpdf.pdf +++ b/Master/texmf-dist/doc/latex/tagpdf/tagpdf.pdf diff --git a/Master/texmf-dist/doc/latex/tagpdf/tagpdf.tex b/Master/texmf-dist/doc/latex/tagpdf/tagpdf.tex index 299763001c3..364fcce88f2 100644 --- a/Master/texmf-dist/doc/latex/tagpdf/tagpdf.tex +++ b/Master/texmf-dist/doc/latex/tagpdf/tagpdf.tex @@ -15,8 +15,8 @@ } \makeatletter -\def\UlrikeFischer@package@version{0.98c} -\def\UlrikeFischer@package@date{2023-01-30} +\def\UlrikeFischer@package@version{0.98d} +\def\UlrikeFischer@package@date{2023-02-15} \makeatother \documentclass[DIV=12,parskip=half-,bibliography=totoc,a4paper]{article} @@ -655,6 +655,21 @@ That's a debug option, it helps in lua mode to see where space glyph will be ins \end{description} +\begin{docCommand}[nosep]{tagtool}{\marg{key-val}}\end{docCommand} +\begin{docCommand}{tag_tool:n}{\marg{key-val}}\end{docCommand} + +The tagging of document elements require a variety of small commands. This command +will unify them under a common interface. This is work-in-progress and syntax and implementation +can change! While the argument looks like a key-val \emph{list} (and currently is actually one), +this should not be relied on. Instead only +one argument should be used as the implementation will change to improve the speed. Currently the following +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. +\end{description} + \section{Tagging} @@ -1643,6 +1658,10 @@ The key-val list understands the following keys: \item[\PrintKeyName{AFinline-o}] This is like verb+AFinline+, but it expands the value once. +\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}. + \item[\PrintKeyName{lang}] This key allows to set the language for a structure element. The value should be a bcp-identifier, e.g. |de-De|. diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx index 0a2c4f693fe..012321bba50 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.98c, released 2023-01-30} +% \date{Version 0.98d, released 2023-02-15} % \maketitle % \begin{implementation} % \begin{macrocode} %<@@=tag> %<*luatex> -\ProvidesExplFile {tagpdf-luatex.def} {2023-01-30} {0.98c} +\ProvidesExplFile {tagpdf-luatex.def} {2023-02-15} {0.98d} {tagpdf~driver~for~luatex} % \end{macrocode} % \section{Loading the lua} @@ -158,8 +158,8 @@ local ProvidesLuaModule = { name = "tagpdf", - version = "0.98c", --TAGVERSION - date = "2023-01-30", --TAGDATE + version = "0.98d", --TAGVERSION + date = "2023-02-15", --TAGDATE description = "tagpdf lua code", license = "The LATEX Project Public License 1.3c" } @@ -802,6 +802,7 @@ local function @@_space_chars_shipout (box) end end end + box.head = head end end diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx index a20017a77c2..6219d00192e 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.98c, released 2023-01-30} +% \date{Version 0.98d, released 2023-02-15} % \maketitle % \begin{documentation} % \section{Commands} @@ -295,7 +295,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-checks-code} {2023-01-30} {0.98c} +\ProvidesExplPackage {tagpdf-checks-code} {2023-02-15} {0.98d} {part of tagpdf - code related to checks, conditionals, debugging and messages} %</header> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx index a62f6d3cdb3..89b6d09d261 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.98c, released 2023-01-30} +% \date{Version 0.98d, released 2023-02-15} % \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-01-30} {0.98c} +%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-02-15} {0.98d} %% {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} {2023-01-30} {0.98c} +%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-02-15} {0.98d} %% {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} {2023-01-30} {0.98c} +%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-02-15} {0.98d} %% {latex-inline} {https://www.latex-project.org/ns/inline/2022}{} chapter, Span, pdf2, section, Span, pdf2, @@ -116,7 +116,7 @@ P, Span, pdf2, % \section{The pdf namespace data} % \begin{macrocode} %<*ns-pdf> -%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-01-30} {0.98c} +%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-02-15} {0.98d} %% {pdf} {http://iso.org/pdf/ssn}{} StructTreeRoot,StructTreeRoot,pdf,D, Document,Document,pdf,D, @@ -184,7 +184,7 @@ Strong,Span,pdf,I, % \section{The pdf 2.0 namespace data} % \begin{macrocode} %<*ns-pdf2> -%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-01-30} {0.98c} +%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-02-15} {0.98d} %% {pdf2} {http://iso.org/pdf2/ssn}{} Document,Document,pdf2,D, Part,Part,pdf2,G, @@ -240,7 +240,7 @@ Strong,Strong,pdf2,I, % \section{The mathml namespace data} % \begin{macrocode} %<*ns-mathml> -%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-01-30} {0.98c} +%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-02-15} {0.98d} % {mathml}{http://www.w3.org/1998/Math/MathML}{} abs,,, and,,, @@ -475,7 +475,7 @@ xor,,, % This will perhaps change in future. % \begin{macrocode} %<*parent-child> -%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-01-30} {0.98c} +%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-02-15} {0.98d} ,,,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 +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} {2023-01-30} {0.98c} +%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-02-15} {0.98d} ,,,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 1d04a193680..8061a5d18d0 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.98c, released 2023-01-30} +% \date{Version 0.98d, released 2023-02-15} % \maketitle % \begin{documentation} % \end{documentation} @@ -55,11 +55,11 @@ % \begin{macrocode} %<@@=tag> %<*generic> -\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-01-30} {0.98c} +\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-02-15} {0.98d} {part of tagpdf - code related to marking chunks - generic mode} %</generic> %<*debug> -\ProvidesExplPackage {tagpdf-debug-generic} {2023-01-30} {0.98c} +\ProvidesExplPackage {tagpdf-debug-generic} {2023-02-15} {0.98d} {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 066d2e22436..1b03011ddf2 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.98c, released 2023-01-30} +% \date{Version 0.98d, released 2023-02-15} % \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-01-30} {0.98c} +\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-02-15} {0.98d} {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 88c5937f575..ba5516dc4c9 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.98c, released 2023-01-30} +% \date{Version 0.98d, released 2023-02-15} % \maketitle % \begin{documentation} % \section{Public Commands} @@ -174,7 +174,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-01-30} {0.98c} +\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-02-15} {0.98d} {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 8948b890550..8557552f9a6 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.98c, released 2023-01-30} +% \date{Version 0.98d, released 2023-02-15} % \maketitle % \begin{documentation} % \begin{function} @@ -98,7 +98,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-roles-code} {2023-01-30} {0.98c} +\ProvidesExplPackage {tagpdf-roles-code} {2023-02-15} {0.98d} {part of tagpdf - code related to roles and structure names} %</header> % \end{macrocode} @@ -913,7 +913,7 @@ { \tl_set:Nx\l_@@_tmpa_tl { \use_ii:nn ##1 } \exp_args:Nne - \tl_if_in:nnF {-Part-Div-NonStruct-}{-\l_@@_tmpa_tl-} + \str_if_in:nnF {-Part-Div-NonStruct-}{-\l_@@_tmpa_tl-} { \tl_set:Nn\l_@@_role_real_parent_tl {##1} \int_zero:N\l_@@_tmpa_int diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx index 5e21bb0f6a5..ffb891fdc5b 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.98c, released 2023-01-30} +% \date{Version 0.98d, released 2023-02-15} % \maketitle % \begin{documentation} % \begin{function}{interwordspace (setup-key)} @@ -64,7 +64,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-space-code} {2023-01-30} {0.98c} +\ProvidesExplPackage {tagpdf-space-code} {2023-02-15} {0.98d} {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 229989dad1c..c488ad823d7 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.98c, released 2023-01-30} +% \date{Version 0.98d, released 2023-02-15} % \maketitle % \begin{documentation} % \section{Public Commands} @@ -242,7 +242,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-struct-code} {2023-01-30} {0.98c} +\ProvidesExplPackage {tagpdf-struct-code} {2023-02-15} {0.98d} {part of tagpdf - code related to storing structure} %</header> % \end{macrocode} @@ -1080,9 +1080,78 @@ % extension. % AF is an array and can be used more than once, so we store it in a tl. % which is expanded. -% AFinline can be use only once (more quite probably doesn't make sense). +% AFinline currently uses the fix extention txt. +% texsource is a special variant which creates a tex-file, it expects a +% tl-var as value (e.g. from math grabbing) +% +% \begin{variable}{\g_@@_struct_AFobj_int} +% This variable is used to number the AF-object names +% \begin{macrocode} +\int_new:N\g_@@_struct_AFobj_int +% \end{macrocode} +% \end{variable} +% +% \begin{macrocode} +\cs_if_free:NTF \pdffile_embed_stream:nnN + { + \cs_new_protected:Npn \@@_struct_add_inline_AF:nn #1 #2 + % #1 content, #2 extension + { + \group_begin: + \int_gincr:N \g_@@_struct_AFobj_int + \pdf_object_if_exist:eF {@@/fileobj\int_use:N\g_@@_struct_AFobj_int} + { + \pdffile_embed_stream:nxx + {#1} + {tag-AFfile\int_use:N\g_@@_struct_AFobj_int.#2} + {@@/fileobj\int_use:N\g_@@_struct_AFobj_int} + \@@_struct_add_AF:ee + { \int_eval:n {\c@g_@@_struct_abs_int} } + { \pdf_object_ref:e {@@/fileobj\int_use:N\g_@@_struct_AFobj_int} } + \@@_prop_gput:cnx + { g_@@_struct_\int_use:N\c@g_@@_struct_abs_int _prop } + { AF } + { + [ + \tl_use:c + { g_@@_struct_\int_eval:n {\c@g_@@_struct_abs_int}_AF_tl } + ] + } + } + \group_end: + } + } + { + \cs_generate_variant:Nn \pdffile_embed_stream:nnN {nxN} + \cs_new_protected:Npn \@@_struct_add_inline_AF:nn #1 #2 + % #1 content, #2 extension + { + \group_begin: + \int_gincr:N \g_@@_struct_AFobj_int + \pdffile_embed_stream:nxN + {#1} + {tag-AFfile\int_use:N\g_@@_struct_AFobj_int.#2} + \l_@@_tmpa_tl + \@@_struct_add_AF:ee + { \int_eval:n {\c@g_@@_struct_abs_int} } + { \l_@@_tmpa_tl } + \@@_prop_gput:cnx + { g_@@_struct_\int_use:N\c@g_@@_struct_abs_int _prop } + { AF } + { + [ + \tl_use:c + { g_@@_struct_\int_eval:n {\c@g_@@_struct_abs_int}_AF_tl } + ] + } + \group_end: + } + } +\cs_generate_variant:Nn \@@_struct_add_inline_AF:nn {on} +% \end{macrocode} +% % \begin{macrocode} -\cs_new_protected:Npn \@@_struct_add_AF:nn #1 #2 % #1 struct num #2 object name +\cs_new_protected:Npn \@@_struct_add_AF:nn #1 #2 % #1 struct num #2 object reference { \tl_if_exist:cTF { @@ -1091,14 +1160,14 @@ { \tl_gput_right:cx { g_@@_struct_#1_AF_tl } - { ~ \pdf_object_ref:n {#2} } + { \c_space_tl #2 } } { \tl_new:c { g_@@_struct_#1_AF_tl } \tl_gset:cx { g_@@_struct_#1_AF_tl } - { \pdf_object_ref:n {#2} } + { #2 } } } \cs_generate_variant:Nn \@@_struct_add_AF:nn {en,ee} @@ -1108,7 +1177,7 @@ { \pdf_object_if_exist:nTF {#1} { - \@@_struct_add_AF:en { \int_eval:n {\c@g_@@_struct_abs_int} }{#1} + \@@_struct_add_AF:ee { \int_eval:n {\c@g_@@_struct_abs_int} }{\pdf_object_ref:n {#1}} \@@_prop_gput:cnx { g_@@_struct_\int_eval:n {\c@g_@@_struct_abs_int}_prop } { AF } @@ -1125,52 +1194,25 @@ }, ,AFinline .code:n = { - \group_begin: - \pdf_object_if_exist:eF {@@/fileobj\int_use:N\c@g_@@_struct_abs_int} - { - \pdffile_embed_stream:nxx - {#1} - {tag-AFfile\int_use:N\c@g_@@_struct_abs_int.txt} - {@@/fileobj\int_use:N\c@g_@@_struct_abs_int} - \@@_struct_add_AF:ee - { \int_eval:n {\c@g_@@_struct_abs_int} } - { @@/fileobj\int_use:N\c@g_@@_struct_abs_int } - \@@_prop_gput:cnx - { g_@@_struct_\int_use:N\c@g_@@_struct_abs_int _prop } - { AF } - { - [ - \tl_use:c - { g_@@_struct_\int_eval:n {\c@g_@@_struct_abs_int}_AF_tl } - ] - } - } - \group_end: + \@@_struct_add_inline_AF:nn {#1}{txt} } ,AFinline-o .code:n = { - \group_begin: - \pdf_object_if_exist:eF {@@/fileobj\int_use:N\c@g_@@_struct_abs_int} - { - \pdffile_embed_stream:oxx - {#1} - {tag-AFfile\int_use:N\c@g_@@_struct_abs_int.txt} - {@@/fileobj\int_use:N\c@g_@@_struct_abs_int} - \@@_struct_add_AF:ee - { \int_eval:n {\c@g_@@_struct_abs_int} } - { @@/fileobj\int_use:N\c@g_@@_struct_abs_int } - \@@_prop_gput:cnx - { g_@@_struct_\int_use:N\c@g_@@_struct_abs_int _prop } - { AF } - { - [ - \tl_use:c - { g_@@_struct_\int_eval:n {\c@g_@@_struct_abs_int}_AF_tl } - ] - } - } - \group_end: + \@@_struct_add_inline_AF:on {#1}{txt} } + ,texsource .code:n = + { + \group_begin: + \pdfdict_put:nnn { l_pdffile/Filespec }{AFRelationship} { /Source } +% \end{macrocode} +% we set the mime type as pdfresources uses currently text/plain +% \begin{macrocode} + \pdfdict_put:nnx + { l_pdffile }{Subtype} + { \pdf_name_from_unicode_e:n{application/x-tex} } + \@@_struct_add_inline_AF:on {#1}{tex} + \group_end: + } } % \end{macrocode} % \end{macro} @@ -1184,7 +1226,7 @@ { \pdf_object_if_exist:nTF {#1} { - \@@_struct_add_AF:en { 0 }{#1} + \@@_struct_add_AF:ee { 0 }{\pdf_object_ref:n {#1}} \@@_prop_gput:cnx { g_@@_struct_0_prop } { AF } @@ -1510,7 +1552,7 @@ % \section{Attributes and attribute classes} % \begin{macrocode} %<*header> -\ProvidesExplPackage {tagpdf-attr-code} {2023-01-30} {0.98c} +\ProvidesExplPackage {tagpdf-attr-code} {2023-02-15} {0.98d} {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 507681afa62..c757e9e54d4 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.98c, released 2023-01-30} +% \date{Version 0.98d, released 2023-02-15} % \maketitle % \begin{implementation} % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-tree-code} {2023-01-30} {0.98c} +\ProvidesExplPackage {tagpdf-tree-code} {2023-02-15} {0.98d} {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 980641b6b70..01de768a15c 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.98c, released 2023-01-30} +% \date{Version 0.98d, released 2023-02-15} % \maketitle % \begin{documentation} % \section{Setup commands} @@ -64,10 +64,14 @@ % add a document structure. % \end{function} % -% -% \begin{function}{\tagpdfifluatexTF,\tagpdfifluatexT,\tagpdfifpdftexT} -% small wrappers around engine tests. This functions should not be used and will be removed -% in one of the next versions. +% \begin{function}{\tag_tool:n,\tagtool} +% \begin{syntax} +% \cs{tag_tool:n}\Arg{key val} +% \end{syntax} +% The tagging of basic document elements will require a variaty 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! % \end{function} % % \section{Commands related to mc-chunks} @@ -246,7 +250,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-user} {2023-01-30} {0.98c} +\ProvidesExplPackage {tagpdf-user} {2023-02-15} {0.98d} {tagpdf - user commands} %</header> % \end{macrocode} @@ -263,6 +267,22 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\tag_tool:n,\tagtool} +% This is a first definition of the tool command. +% Currently it uses key-val, but this should be probably +% be flattened to speed it up. +% \begin{macrocode} +%<base>\cs_new_protected:Npn\tag_tool:n #1 {} +%<base>\cs_set_eq:NN\tagtool\tag_tool:n +%<*package> +\cs_set_protected:Npn\tag_tool:n #1 + { + \tag_if_active:T { \keys_set:nn {tag / tool}{#1} } + } +\cs_set_eq:NN\tagtool\tag_tool:n +%</package> +% \end{macrocode} +% \end{macro} % \section{Commands for the mc-chunks} % \begin{macro}{\tagmcbegin,\tagmcend,\tagmcuse } @@ -579,10 +599,13 @@ % { % paratagging (setup-key), % paratagging-show (setup-key), +% paratag (setup-key), +% paratag (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 -% are boxes and they have a (small) height. +% are boxes and they have a (small) height. The |paratag| key sets the tag used by +% the next automatic paratagging, it can also be changed with |\tag_tool:n| % \begin{macrocode} \keys_define:nn { @@ / setup } { @@ -590,22 +613,43 @@ paratagging-show .bool_set:N = \l_@@_para_show_bool, paratag .tl_set:N = \l_@@_para_tag_tl } - +\keys_define:nn { tag / tool} + { + paratag .tl_set:N = \l_@@_para_tag_tl + } % \end{macrocode} % \end{macro} % This fills the para hooks with the needed code. % \begin{macrocode} +\cs_new_protected:Npn \@@_check_para_begin_show:nn #1 #2 + %#1 color, #2 prefix + { + \bool_if:NT \l_@@_para_show_bool + { + \tag_mc_begin:n{artifact} + \llap{\color_select:n{#1}\tiny#2\int_use:N\g_@@_para_begin_int\ } + \tag_mc_end: + } + } + +\cs_new_protected:Npn \@@_check_para_end_show:nn #1 #2 + %#1 color, #2 prefix + { + \bool_if:NT \l_@@_para_show_bool + { + \tag_mc_begin:n{artifact} + \rlap{\color_select:n{#1}\tiny\ #2\int_use:N\g_@@_para_end_int} + \tag_mc_end: + } + } + \AddToHook{para/begin} { \bool_if:NT \l_@@_para_bool { \int_gincr:N \g_@@_para_begin_int \tag_struct_begin:n {tag=\l_@@_para_tag_tl} - \bool_if:NT \l_@@_para_show_bool - { \tag_mc_begin:n{artifact} - \llap{\color_select:n{red}\tiny\int_use:N\g_@@_para_begin_int\ } - \tag_mc_end: - } + \@@_check_para_begin_show:nn {green}{} \tag_mc_begin:n {} } } @@ -615,11 +659,7 @@ { \int_gincr:N \g_@@_para_end_int \tag_mc_end: - \bool_if:NT \l_@@_para_show_bool - { \tag_mc_begin:n{artifact} - \rlap{\color_select:n{red}\tiny\ \int_use:N\g_@@_para_end_int} - \tag_mc_end: - } + \@@_check_para_end_show:nn {red}{} \tag_struct_end: } } @@ -671,13 +711,17 @@ % \tagpdfparaOff % } % This two command switch para mode on and off. |\tagpdfsetup| could be used -% too but is longer. +% too but is longer. An alternative is |\tag_tool:n{para=false}| % \begin{macrocode} %<base>\newcommand\tagpdfparaOn {} %<base>\newcommand\tagpdfparaOff{} %<*package> \renewcommand\tagpdfparaOn {\bool_set_true:N \l_@@_para_bool} \renewcommand\tagpdfparaOff{\bool_set_false:N \l_@@_para_bool} +\keys_define:nn { tag / tool} + { + para .bool_set:N = \l_@@_para_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 61222d151ab..67a3e411d46 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-01-30} {0.98c} +\ProvidesExplPackage {tagpdf} {2023-02-15} {0.98d} { A package to experiment with pdf tagging } \bool_if:nF @@ -118,7 +118,7 @@ % \end{macrocode} %<*debug> % \begin{macrocode} -\ProvidesExplPackage {tagpdf-debug} {2023-01-30} {0.98c} +\ProvidesExplPackage {tagpdf-debug} {2023-02-15} {0.98d} { 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} {2023-01-30} {0.98c} +\ProvidesExplPackage {tagpdf-base} {2023-02-15} {0.98d} {part of tagpdf - provide base, no-op versions of the user commands } %</base> % \end{macrocode} diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty index 0e7220b7d51..3ba34d0d46a 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-01-30} {0.98c} +\ProvidesExplPackage {tagpdf-base} {2023-02-15} {0.98d} {part of tagpdf - provide base, no-op versions of the user commands } \AddToHook{begindocument} { @@ -76,6 +76,8 @@ \NewDocumentCommand \tagpdfsetup { m }{} +\cs_new_protected:Npn\tag_tool:n #1 {} +\cs_set_eq:NN\tagtool\tag_tool:n \NewDocumentCommand \tagmcbegin { m } { 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 15df01d76e7..c7447b08b4d 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-01-30} {0.98c} +\ProvidesExplPackage {tagpdf-debug-generic} {2023-02-15} {0.98d} {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 fe27dc45683..659ca6f0b38 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-01-30} {0.98c} +\ProvidesExplPackage {tagpdf-debug} {2023-02-15} {0.98d} { debug code for tagpdf } \@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput} \prop_gput:Nnn \g_msg_module_type_prop { tag / debug} {} diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def index df0c825346c..c3d7495aab4 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-01-30} {0.98c} +\ProvidesExplFile {tagpdf-luatex.def} {2023-02-15} {0.98d} {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 8de786b494d..4caa3a5285e 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-01-30} {0.98c} +\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-02-15} {0.98d} {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 15a1a0d024b..45bd2d4539e 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-01-30} {0.98c} +\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-02-15} {0.98d} {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 1bcd546b017..d05c1aa5f00 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-01-30} {0.98c} +%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-02-15} {0.98d} %% {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 5323306b4e4..5f157ddc740 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-01-30} {0.98c} +%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-02-15} {0.98d} %% {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 aa90f54f130..383578f2adf 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-01-30} {0.98c} +%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-02-15} {0.98d} %% {latex} {https://www.latex-project.org/ns/dflt/2022}{} title, Title, pdf2, part, Title, pdf2, 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 f9404e71730..2ad2154bd76 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-01-30} {0.98c} +%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-02-15} {0.98d} 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 2cfe3a9c4e9..a6b07b70fa9 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-01-30} {0.98c} +%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-02-15} {0.98d} %% {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 d89a25be779..08c829cf819 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-01-30} {0.98c} +%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-02-15} {0.98d} %% {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 e29387bfefc..d68bff84bba 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-01-30} {0.98c} +%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-02-15} {0.98d} ,,,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 fac6a9312d5..831dcece77a 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-01-30} {0.98c} +%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-02-15} {0.98d} ,,,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 d2ee6479afb..2bd02458eac 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.98c", --TAGVERSION - date = "2023-01-30", --TAGDATE + version = "0.98d", --TAGVERSION + date = "2023-02-15", --TAGDATE description = "tagpdf lua code", license = "The LATEX Project Public License 1.3c" } @@ -432,6 +432,7 @@ local function __tag_space_chars_shipout (box) end end end + box.head = head end end diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty index 38f35c6b2df..ab618dc7099 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-01-30} {0.98c} +\ProvidesExplPackage {tagpdf} {2023-02-15} {0.98d} { A package to experiment with pdf tagging } \bool_if:nF @@ -1506,7 +1506,7 @@ { \tl_set:Nx\l__tag_tmpa_tl { \use_ii:nn ##1 } \exp_args:Nne - \tl_if_in:nnF {-Part-Div-NonStruct-}{-\l__tag_tmpa_tl-} + \str_if_in:nnF {-Part-Div-NonStruct-}{-\l__tag_tmpa_tl-} { \tl_set:Nn\l__tag_role_real_parent_tl {##1} \int_zero:N\l__tag_tmpa_int @@ -2297,7 +2297,64 @@ { <\l__tag_tmpa_str> } }, } -\cs_new_protected:Npn \__tag_struct_add_AF:nn #1 #2 % #1 struct num #2 object name +\int_new:N\g__tag_struct_AFobj_int +\cs_if_free:NTF \pdffile_embed_stream:nnN + { + \cs_new_protected:Npn \__tag_struct_add_inline_AF:nn #1 #2 + % #1 content, #2 extension + { + \group_begin: + \int_gincr:N \g__tag_struct_AFobj_int + \pdf_object_if_exist:eF {__tag/fileobj\int_use:N\g__tag_struct_AFobj_int} + { + \pdffile_embed_stream:nxx + {#1} + {tag-AFfile\int_use:N\g__tag_struct_AFobj_int.#2} + {__tag/fileobj\int_use:N\g__tag_struct_AFobj_int} + \__tag_struct_add_AF:ee + { \int_eval:n {\c@g__tag_struct_abs_int} } + { \pdf_object_ref:e {__tag/fileobj\int_use:N\g__tag_struct_AFobj_int} } + \__tag_prop_gput:cnx + { g__tag_struct_\int_use:N\c@g__tag_struct_abs_int _prop } + { AF } + { + [ + \tl_use:c + { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_AF_tl } + ] + } + } + \group_end: + } + } + { + \cs_generate_variant:Nn \pdffile_embed_stream:nnN {nxN} + \cs_new_protected:Npn \__tag_struct_add_inline_AF:nn #1 #2 + % #1 content, #2 extension + { + \group_begin: + \int_gincr:N \g__tag_struct_AFobj_int + \pdffile_embed_stream:nxN + {#1} + {tag-AFfile\int_use:N\g__tag_struct_AFobj_int.#2} + \l__tag_tmpa_tl + \__tag_struct_add_AF:ee + { \int_eval:n {\c@g__tag_struct_abs_int} } + { \l__tag_tmpa_tl } + \__tag_prop_gput:cnx + { g__tag_struct_\int_use:N\c@g__tag_struct_abs_int _prop } + { AF } + { + [ + \tl_use:c + { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_AF_tl } + ] + } + \group_end: + } + } +\cs_generate_variant:Nn \__tag_struct_add_inline_AF:nn {on} +\cs_new_protected:Npn \__tag_struct_add_AF:nn #1 #2 % #1 struct num #2 object reference { \tl_if_exist:cTF { @@ -2306,14 +2363,14 @@ { \tl_gput_right:cx { g__tag_struct_#1_AF_tl } - { ~ \pdf_object_ref:n {#2} } + { \c_space_tl #2 } } { \tl_new:c { g__tag_struct_#1_AF_tl } \tl_gset:cx { g__tag_struct_#1_AF_tl } - { \pdf_object_ref:n {#2} } + { #2 } } } \cs_generate_variant:Nn \__tag_struct_add_AF:nn {en,ee} @@ -2323,7 +2380,7 @@ { \pdf_object_if_exist:nTF {#1} { - \__tag_struct_add_AF:en { \int_eval:n {\c@g__tag_struct_abs_int} }{#1} + \__tag_struct_add_AF:ee { \int_eval:n {\c@g__tag_struct_abs_int} }{\pdf_object_ref:n {#1}} \__tag_prop_gput:cnx { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } { AF } @@ -2340,52 +2397,22 @@ }, ,AFinline .code:n = { - \group_begin: - \pdf_object_if_exist:eF {__tag/fileobj\int_use:N\c@g__tag_struct_abs_int} - { - \pdffile_embed_stream:nxx - {#1} - {tag-AFfile\int_use:N\c@g__tag_struct_abs_int.txt} - {__tag/fileobj\int_use:N\c@g__tag_struct_abs_int} - \__tag_struct_add_AF:ee - { \int_eval:n {\c@g__tag_struct_abs_int} } - { __tag/fileobj\int_use:N\c@g__tag_struct_abs_int } - \__tag_prop_gput:cnx - { g__tag_struct_\int_use:N\c@g__tag_struct_abs_int _prop } - { AF } - { - [ - \tl_use:c - { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_AF_tl } - ] - } - } - \group_end: + \__tag_struct_add_inline_AF:nn {#1}{txt} } ,AFinline-o .code:n = { - \group_begin: - \pdf_object_if_exist:eF {__tag/fileobj\int_use:N\c@g__tag_struct_abs_int} - { - \pdffile_embed_stream:oxx - {#1} - {tag-AFfile\int_use:N\c@g__tag_struct_abs_int.txt} - {__tag/fileobj\int_use:N\c@g__tag_struct_abs_int} - \__tag_struct_add_AF:ee - { \int_eval:n {\c@g__tag_struct_abs_int} } - { __tag/fileobj\int_use:N\c@g__tag_struct_abs_int } - \__tag_prop_gput:cnx - { g__tag_struct_\int_use:N\c@g__tag_struct_abs_int _prop } - { AF } - { - [ - \tl_use:c - { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_AF_tl } - ] - } - } - \group_end: + \__tag_struct_add_inline_AF:on {#1}{txt} } + ,texsource .code:n = + { + \group_begin: + \pdfdict_put:nnn { l_pdffile/Filespec }{AFRelationship} { /Source } + \pdfdict_put:nnx + { l_pdffile }{Subtype} + { \pdf_name_from_unicode_e:n{application/x-tex} } + \__tag_struct_add_inline_AF:on {#1}{tex} + \group_end: + } } \keys_define:nn { __tag / setup } { @@ -2393,7 +2420,7 @@ { \pdf_object_if_exist:nTF {#1} { - \__tag_struct_add_AF:en { 0 }{#1} + \__tag_struct_add_AF:ee { 0 }{\pdf_object_ref:n {#1}} \__tag_prop_gput:cnx { g__tag_struct_0_prop } { AF } @@ -2798,6 +2825,11 @@ { \keys_set:nn { __tag / setup } { #1 } } +\cs_set_protected:Npn\tag_tool:n #1 + { + \tag_if_active:T { \keys_set:nn {tag / tool}{#1} } + } +\cs_set_eq:NN\tagtool\tag_tool:n \NewDocumentCommand \tagmcifinTF { m m } @@ -2983,6 +3015,31 @@ paratagging-show .bool_set:N = \l__tag_para_show_bool, paratag .tl_set:N = \l__tag_para_tag_tl } +\keys_define:nn { tag / tool} + { + paratag .tl_set:N = \l__tag_para_tag_tl + } +\cs_new_protected:Npn \__tag_check_para_begin_show:nn #1 #2 + %#1 color, #2 prefix + { + \bool_if:NT \l__tag_para_show_bool + { + \tag_mc_begin:n{artifact} + \llap{\color_select:n{#1}\tiny#2\int_use:N\g__tag_para_begin_int\ } + \tag_mc_end: + } + } + +\cs_new_protected:Npn \__tag_check_para_end_show:nn #1 #2 + %#1 color, #2 prefix + { + \bool_if:NT \l__tag_para_show_bool + { + \tag_mc_begin:n{artifact} + \rlap{\color_select:n{#1}\tiny\ #2\int_use:N\g__tag_para_end_int} + \tag_mc_end: + } + } \AddToHook{para/begin} { @@ -2990,11 +3047,7 @@ { \int_gincr:N \g__tag_para_begin_int \tag_struct_begin:n {tag=\l__tag_para_tag_tl} - \bool_if:NT \l__tag_para_show_bool - { \tag_mc_begin:n{artifact} - \llap{\color_select:n{red}\tiny\int_use:N\g__tag_para_begin_int\ } - \tag_mc_end: - } + \__tag_check_para_begin_show:nn {green}{} \tag_mc_begin:n {} } } @@ -3004,11 +3057,7 @@ { \int_gincr:N \g__tag_para_end_int \tag_mc_end: - \bool_if:NT \l__tag_para_show_bool - { \tag_mc_begin:n{artifact} - \rlap{\color_select:n{red}\tiny\ \int_use:N\g__tag_para_end_int} - \tag_mc_end: - } + \__tag_check_para_end_show:nn {red}{} \tag_struct_end: } } @@ -3051,6 +3100,10 @@ } \renewcommand\tagpdfparaOn {\bool_set_true:N \l__tag_para_bool} \renewcommand\tagpdfparaOff{\bool_set_false:N \l__tag_para_bool} +\keys_define:nn { tag / tool} + { + para .bool_set:N = \l__tag_para_bool + } \NewDocumentCommand\tagpdfsuppressmarks{m} {{\use:c{__tag_mc_disable_marks:} #1}} \cs_new_protected:Npn\__tag_hook_kernel_before_head:{} diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty index dc1c94b9114..df9d084a393 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty @@ -1,10 +1,8 @@ %\RequirePackage[enable-debug]{expl3}[2018/06/14] -\ProvidesExplPackage {tagpdfdocu-patches} {2023-01-30} {0.98c} +\ProvidesExplPackage {tagpdfdocu-patches} {2023-02-15} {0.98d} {patches/commands for the tagpdf documentation} \RequirePackage{etoolbox,xpatch} -% latex-lab experiments -\providecommand\tagtool[1]{} %vLogos \ExplSyntaxOn |