diff options
author | Karl Berry <karl@freefriends.org> | 2023-11-18 20:40:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-11-18 20:40:31 +0000 |
commit | afaa9b579c6a9382f5011372cc31fc2f658e8ce4 (patch) | |
tree | 8f0026a3b806ca2ff950a42e494b3f38e6bd72bc /Master/texmf-dist/source | |
parent | 573f5f0945a6ae0bc310f423f7ec0b8dd8a7516d (diff) |
tagpdf (18nov23)
git-svn-id: svn://tug.org/texlive/trunk@68890 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
12 files changed, 252 insertions, 113 deletions
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx index 95c3ebec19a..b189742c5d1 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.98o, released 2023-11-13} +% \date{Version 0.98p, released 2023-11-17} % \maketitle % \begin{implementation} % \begin{macrocode} %<@@=tag> %<*luatex> -\ProvidesExplFile {tagpdf-luatex.def} {2023-11-13} {0.98o} +\ProvidesExplFile {tagpdf-luatex.def} {2023-11-17} {0.98p} {tagpdf~driver~for~luatex} % \end{macrocode} % \section{Loading the lua} @@ -158,8 +158,8 @@ local ProvidesLuaModule = { name = "tagpdf", - version = "0.98o", --TAGVERSION - date = "2023-11-13", --TAGDATE + version = "0.98p", --TAGVERSION + date = "2023-11-17", --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 d4452a78536..8a281250dff 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.98o, released 2023-11-13} +% \date{Version 0.98p, released 2023-11-17} % \maketitle % \begin{documentation} % \section{Commands} @@ -313,7 +313,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-checks-code} {2023-11-13} {0.98o} +\ProvidesExplPackage {tagpdf-checks-code} {2023-11-17} {0.98p} {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 90cde275279..b866058c83c 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.98o, released 2023-11-13} +% \date{Version 0.98p, released 2023-11-17} % \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-11-13} {0.98o} +%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-11-17} {0.98p} %% {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-11-13} {0.98o} +%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-11-17} {0.98p} %% {latex-book} {https://www.latex-project.org/ns/book/2022}{} chapter, H1,pdf2, section, H2,pdf2, @@ -108,7 +108,7 @@ subparagraph, H6,pdf2, % loaded. % \begin{macrocode} %<*ns-latex-inline> -%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-11-13} {0.98o} +%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-11-17} {0.98p} %% {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-11-13} {0.98o} +%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-11-17} {0.98p} %% {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-11-13} {0.98o} +%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-11-17} {0.98p} %% {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-11-13} {0.98o} +%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-11-17} {0.98p} % {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-11-13} {0.98o} +%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-11-17} {0.98p} ,,,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-11-13} {0.98o} +%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-11-17} {0.98p} ,,,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 48d2deb4041..be9830837ad 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.98o, released 2023-11-13} +% \date{Version 0.98p, released 2023-11-17} % \maketitle % \begin{documentation} % \end{documentation} @@ -55,11 +55,11 @@ % \begin{macrocode} %<@@=tag> %<*generic> -\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-11-13} {0.98o} +\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-11-17} {0.98p} {part of tagpdf - code related to marking chunks - generic mode} %</generic> %<*debug> -\ProvidesExplPackage {tagpdf-debug-generic} {2023-11-13} {0.98o} +\ProvidesExplPackage {tagpdf-debug-generic} {2023-11-17} {0.98p} {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 d0dbffd45ed..5d4930fcc38 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.98o, released 2023-11-13} +% \date{Version 0.98p, released 2023-11-17} % \maketitle % \begin{implementation} % The code is splitted into three parts: code shared by all engines, @@ -86,11 +86,11 @@ % \begin{macrocode} %<@@=tag> %<*luamode> -\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-11-13} {0.98o} +\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-11-17} {0.98p} {tagpdf - mc code only for the luamode } %</luamode> %<*debug> -\ProvidesExplPackage {tagpdf-debug-lua} {2023-11-13} {0.98o} +\ProvidesExplPackage {tagpdf-debug-lua} {2023-11-17} {0.98p} {part of tagpdf - debugging code related to marking chunks - lua mode} %</debug> % \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 0b159909cf8..de0facacc46 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.98o, released 2023-11-13} +% \date{Version 0.98p, released 2023-11-17} % \maketitle % \begin{documentation} % \section{Public Commands} @@ -181,7 +181,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-11-13} {0.98o} +\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-11-17} {0.98p} {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 2d8084282ea..de76d3a1d10 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.98o, released 2023-11-13} +% \date{Version 0.98p, released 2023-11-17} % \maketitle % \begin{documentation} % \begin{function} @@ -98,7 +98,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-roles-code} {2023-11-13} {0.98o} +\ProvidesExplPackage {tagpdf-roles-code} {2023-11-17} {0.98p} {part of tagpdf - code related to roles and structure names} %</header> % \end{macrocode} @@ -243,13 +243,15 @@ % { % ,\l_@@_role_tag_tmpa_tl % ,\l_@@_role_tag_namespace_tmpa_tl +% ,\l_@@_role_tag_namespace_tmpb_tl % % ,\l_@@_role_role_tmpa_tl -% ,\l_@@_role_role_namespace_tmpa_tl +% ,\l_@@_role_role_namespace_tmpa_tl % ,\l_@@_role_tmpa_seq % } % \begin{macrocode} \tl_new:N \l_@@_role_tag_tmpa_tl \tl_new:N \l_@@_role_tag_namespace_tmpa_tl +\tl_new:N \l_@@_role_tag_namespace_tmpb_tl \tl_new:N \l_@@_role_role_tmpa_tl \tl_new:N \l_@@_role_role_namespace_tmpa_tl \seq_new:N\l_@@_role_tmpa_seq diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx index c77c832c071..16b5ec5e551 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.98o, released 2023-11-13} +% \date{Version 0.98p, released 2023-11-17} % \maketitle % \begin{documentation} % \begin{function}{interwordspace (setup-key)} @@ -64,7 +64,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-space-code} {2023-11-13} {0.98o} +\ProvidesExplPackage {tagpdf-space-code} {2023-11-17} {0.98p} {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 3cc92b1ce3b..76b23e8e4c2 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.98o, released 2023-11-13} +% \date{Version 0.98p, released 2023-11-17} % \maketitle % \begin{documentation} % \section{Public Commands} @@ -174,9 +174,11 @@ % abbreviation or an acronym % (I couldn't think of a better name, so I sticked to E). % \end{function} -% \begin{function}{AF (struct-key),AFinline (struct-key),AFinline-o (struct-key)} +% \begin{function}{AF (struct-key),AFref (struct-key), +% AFinline (struct-key),AFinline-o (struct-key),texsource} % \begin{syntax} % AF = \meta{object name}\\ +% AFref = \meta{object reference}\\ % AF-inline = \meta{text content}\\ % \end{syntax} % These keys allows to reference an associated file in the structure element. @@ -190,9 +192,24 @@ % % Future versions will perhaps extend this to more mime types, but it is % still a research task to find out what is really needed. +% +% |texsource| is a special variant of |AF-inline-o| which embeds the file +% as |.tex| source with the |/AFrelationship| key set to |/Source|. % -% |AF| can be used more than once, to associate more than one file. The inline -% keys can be used only once per structure. Additional calls are ignored. +% The argument of |AF| is an object name referring an embedded file as declared for example with +% \cs{pdf_object_new:n} or with the l3pdffile module. |AF| expands its argument +% (this allows e.g. to use some variable for automatic numbering) +% and can be used more than once, to associate more than one file. +% +% The argument of |AFref| is an object reference to an embedded file +% or a variable expanding to such a object reference in the format +% as you would get e.g. from \cs{pdf_object_ref_last:} or \cs{pdf_object_ref:n} +% (and which is different for the various engines!). The key allows to make +% use of anonymous objects. Like |AF| the |AFref| key expands its argument +% and can be used more than once, to associate more than one file. \emph{It +% does not check if the reference is valid!} +% +% The inline keys can be used only once per structure. Additional calls are ignored. % \end{function} % % \begin{function}{attribute (struct-key)} @@ -247,7 +264,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-struct-code} {2023-11-13} {0.98o} +\ProvidesExplPackage {tagpdf-struct-code} {2023-11-17} {0.98p} {part of tagpdf - code related to storing structure} %</header> % \end{macrocode} @@ -1184,12 +1201,13 @@ } % \end{macrocode} % \end{macro} -% \begin{macro}{AF (struct-key),AFinline (struct-key),AFinline-o (struct-key)} +% \begin{macro}{AF (struct-key), AFref (struct-key), +% AFinline (struct-key),AFinline-o (struct-key)} % keys for the AF keys (associated files). They use commands from l3pdffile! % The stream variants use txt as extension to get the mimetype. % TODO: check if this should be configurable. For math we will perhaps need another % extension. -% AF is an array and can be used more than once, so we store it in a tl. +% AF/AFref is an array and can be used more than once, so we store it in a tl. % which is expanded. % AFinline currently uses the fix extention txt. % texsource is a special variant which creates a tex-file, it expects a @@ -1203,61 +1221,31 @@ % \end{variable} % % \begin{macrocode} -\cs_if_free:NTF \pdffile_embed_stream:nnN +\cs_generate_variant:Nn \pdffile_embed_stream:nnN {neN} +\cs_new_protected:Npn \@@_struct_add_inline_AF:nn #1 #2 +% #1 content, #2 extension { - \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:nee - {#1} - {tag-AFfile\int_use:N\g_@@_struct_AFobj_int.#2} - {@@/fileobj\int_use:N\g_@@_struct_AFobj_int} - \@@_struct_add_AF:ee - { \int_use:N \c@g_@@_struct_abs_int } - { \pdf_object_ref:e {@@/fileobj\int_use:N\g_@@_struct_AFobj_int} } - \@@_struct_prop_gput:nne - { \int_use:N \c@g_@@_struct_abs_int } - { 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 {neN} - \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:neN - {#1} - {tag-AFfile\int_use:N\g_@@_struct_AFobj_int.#2} - \l_@@_tmpa_tl - \@@_struct_add_AF:ee - { \int_use:N \c@g_@@_struct_abs_int } - { \l_@@_tmpa_tl } - \@@_struct_prop_gput:nne - { \int_use:N \c@g_@@_struct_abs_int } - { AF } - { - [ - \tl_use:c - { g_@@_struct_\int_eval:n {\c@g_@@_struct_abs_int}_AF_tl } - ] - } - \group_end: - } - } + \group_begin: + \int_gincr:N \g_@@_struct_AFobj_int + \pdffile_embed_stream:neN + {#1} + {tag-AFfile\int_use:N\g_@@_struct_AFobj_int.#2} + \l_@@_tmpa_tl + \@@_struct_add_AF:ee + { \int_use:N \c@g_@@_struct_abs_int } + { \l_@@_tmpa_tl } + \@@_struct_prop_gput:nne + { \int_use:N \c@g_@@_struct_abs_int } + { 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} % @@ -1286,9 +1274,9 @@ { AF .code:n = % AF property { - \pdf_object_if_exist:nTF {#1} + \pdf_object_if_exist:eTF {#1} { - \@@_struct_add_AF:ee { \int_use:N \c@g_@@_struct_abs_int }{\pdf_object_ref:n {#1}} + \@@_struct_add_AF:ee { \int_use:N \c@g_@@_struct_abs_int }{\pdf_object_ref:e {#1}} \@@_struct_prop_gput:nne { \int_use:N \c@g_@@_struct_abs_int } { AF } @@ -1303,6 +1291,19 @@ % message? } }, + AFref .code:n = % AF property + { + \@@_struct_add_AF:ee { \int_use:N \c@g_@@_struct_abs_int }{#1} + \@@_struct_prop_gput:nne + { \int_use:N \c@g_@@_struct_abs_int } + { AF } + { + [ + \tl_use:c + { g_@@_struct_\int_eval:n {\c@g_@@_struct_abs_int}_AF_tl } + ] + } + }, ,AFinline .code:n = { \@@_struct_add_inline_AF:nn {#1}{txt} @@ -1315,15 +1316,16 @@ { \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:nne - { l_pdffile }{Subtype} - { \pdf_name_from_unicode_e:n{application/x-tex} } \@@_struct_add_inline_AF:on {#1}{tex} \group_end: } + ,mathml .code:n = + { + \group_begin: + \pdfdict_put:nnn { l_pdffile/Filespec }{AFRelationship} { /Supplement } + \@@_struct_add_inline_AF:on {#1}{xml} + \group_end: + } } % \end{macrocode} % \end{macro} @@ -1848,7 +1850,7 @@ % \section{Attributes and attribute classes} % \begin{macrocode} %<*header> -\ProvidesExplPackage {tagpdf-attr-code} {2023-11-13} {0.98o} +\ProvidesExplPackage {tagpdf-attr-code} {2023-11-17} {0.98p} {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 5674e18c8d8..d244a8dc4ce 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.98o, released 2023-11-13} +% \date{Version 0.98p, released 2023-11-17} % \maketitle % \begin{implementation} % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-tree-code} {2023-11-13} {0.98o} +\ProvidesExplPackage {tagpdf-tree-code} {2023-11-17} {0.98p} {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 20d4ee31961..4724b322dc3 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.98o, released 2023-11-13} +% \date{Version 0.98p, released 2023-11-17} % \maketitle % \begin{documentation} % \section{Setup commands} @@ -250,7 +250,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-user} {2023-11-13} {0.98o} +\ProvidesExplPackage {tagpdf-user} {2023-11-17} {0.98p} {tagpdf - user commands} %</header> % \end{macrocode} @@ -400,7 +400,7 @@ { tex.print (tex.getattribute - (luatexbase.attributes.g__tag_mc_cnt_attr)) + (luatexbase.attributes.g_@@_mc_cnt_attr)) } } { @@ -521,7 +521,7 @@ { ,debug/structures .code:n = { - \int_step_inline:nnn{#1}{\c@g__tag_struct_abs_int} + \int_step_inline:nnn{#1}{\c@g_@@_struct_abs_int} { \msg_term:nneeee { tag/debug } { show-struct } @@ -603,7 +603,7 @@ { \cs_if_exist_p:N \pdf_activate_structure_destination: } } { - \tl_set:Nn \l_pdf_current_structure_destination_tl { __tag/struct/\g_@@_struct_stack_current_tl } + \tl_set:Nn \l_pdf_current_structure_destination_tl { _@@/struct/\g_@@_struct_stack_current_tl } \pdf_activate_structure_destination: } } @@ -660,8 +660,138 @@ \tl_set:Nn \l_@@_para_main_tag_tl {text-unit} % \end{macrocode} % \end{macro} + +% \begin{macro} +% { +% \@@_gincr_para_main_begin_int:, +% \@@_gincr_para_main_end_int:, +% \@@_gincr_para_begin_int:, +% \@@_gincr_para_end_int: +% } +% The global para counter should be set through commands so +% that \cs{tag_stop:} can stop them. +% \begin{macrocode} +\cs_new_protected:Npn \@@_gincr_para_main_begin_int: + { + \int_gincr:N \g_@@_para_main_begin_int + } +\cs_new_protected:Npn \@@_gincr_para_begin_int: + { + \int_gincr:N \g_@@_para_begin_int + } +\cs_new_protected:Npn \@@_gincr_para_main_end_int: + { + \int_gincr:N \g_@@_para_main_end_int + } +\cs_new_protected:Npn \@@_gincr_para_end_int: + { + \int_gincr:N \g_@@_para_end_int + } +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\@@_start_para_ints:,\@@_stop_para_ints:} +% \begin{macrocode} +\cs_new_protected:Npn \@@_start_para_ints: + { + \cs_set_protected:Npn \@@_gincr_para_main_begin_int: + { + \int_gincr:N \g_@@_para_main_begin_int + } + \cs_set_protected:Npn \@@_gincr_para_begin_int: + { + \int_gincr:N \g_@@_para_begin_int + } + \cs_set_protected:Npn \@@_gincr_para_main_end_int: + { + \int_gincr:N \g_@@_para_main_end_int + } + \cs_set_protected:Npn \@@_gincr_para_end_int: + { + \int_gincr:N \g_@@_para_end_int + } + } +\cs_new_protected:Npn \@@_stop_para_ints: + { + \cs_set_eq:NN \@@_gincr_para_main_begin_int:\prg_do_nothing: + \cs_set_eq:NN \@@_gincr_para_begin_int: \prg_do_nothing: + \cs_set_eq:NN \@@_gincr_para_main_end_int: \prg_do_nothing: + \cs_set_eq:NN \@@_gincr_para_end_int: \prg_do_nothing: + } +% \end{macrocode} +% \end{macro} % -% +% TEMPORARLY FIX (2023-11-17). Until latex-lab is update we must adapt a sec command: +% \begin{macrocode} +\AddToHook{package/latex-lab-testphase-sec/after} + { + \cs_set_protected:Npn \@kernel@tag@hangfrom #1 + { + \tagstructbegin{tag=\l__tag_para_tag_tl} + \__tag_gincr_para_begin_int: + \tagstructbegin{tag=Lbl} + \setbox\@tempboxa + \hbox + { + \bool_lazy_and:nnT + {\tag_if_active_p:} + {\g__tag_mode_lua_bool} + {\tagmcbegin{tag=Lbl}} + {#1} + } + \tag_stop:n{hangfrom} + \hangindent \wd\@tempboxa\noindent + \tag_start:n{hangfrom} + \tagmcbegin{}\box\@tempboxa\tagmcend\tagstructend\tagmcbegin{} + } + } +% \end{macrocode} +% and two adaptions from the block module: +% \begin{macrocode} +\AddToHook{package/latex-lab-testphase-block/after} + { + \cs_set_protected:Npn \__block_start_para_structure:n #1 { + \__block_debug_typeout:n + { @endpe = \legacy_if:nTF { @endpe }{true}{false} + \on@line } + \legacy_if:nF { @endpe } + { + \bool_if:NF \l__tag_para_flattened_bool + { + \@@_gincr_para_main_begin_int: + \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl} + } + } + \@@_gincr_para_begin_int: + \__block_debug_typeout:n{increment~ P \on@line } + \tag_struct_begin:n + { + tag=\l__tag_para_tag_tl + ,attribute-class=\l_tag_para_attr_class_tl + } + \__tag_check_para_begin_show:nn {green}{#1} + \tag_mc_begin:n {} + } + \RemoveFromHook{para/end}[latex-lab-testphase-block] + \AddToHook{para/end}[latex-lab-testphase-block] + { + \bool_if:NT \l__tag_para_bool + { + \__tag_gincr_para_end_int: + \__block_debug_typeout:n{increment~ /P \on@line } + \tag_mc_end: + \__tag_check_para_end_show:nn {red}{} + \tag_struct_end: + \bool_if:NF \l__tag_para_flattened_bool + { + \__tag_gincr_para_main_end_int: + \tag_struct_end: + } + } + } +} + +% \end{macrocode} %\begin{macro} % { % paratagging (setup-key), @@ -720,13 +850,13 @@ { \bool_if:NF \l_@@_para_flattened_bool { - \int_gincr:N \g_@@_para_main_begin_int + \@@_gincr_para_main_begin_int: \tag_struct_begin:n { tag=\l_@@_para_main_tag_tl, } } - \int_gincr:N \g_@@_para_begin_int + \@@_gincr_para_begin_int: \tag_struct_begin:n {tag=\l_@@_para_tag_tl} \@@_check_para_begin_show:nn {green}{} \tag_mc_begin:n {} @@ -736,13 +866,13 @@ { \bool_if:NT \l_@@_para_bool { - \int_gincr:N \g_@@_para_end_int + \@@_gincr_para_end_int: \tag_mc_end: \@@_check_para_end_show:nn {red}{} \tag_struct_end: \bool_if:NF \l_@@_para_flattened_bool { - \int_gincr:N \g_@@_para_main_end_int + \@@_gincr_para_main_end_int: \tag_struct_end: } } diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx index bc28e00bd08..cfe2ff9df88 100644 --- a/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx +++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx @@ -93,7 +93,7 @@ % \begin{macrocode} %<@@=tag> %<*package> -\ProvidesExplPackage {tagpdf} {2023-11-13} {0.98o} +\ProvidesExplPackage {tagpdf} {2023-11-17} {0.98p} { A package to experiment with pdf tagging } \bool_if:nF @@ -119,7 +119,7 @@ % \end{macrocode} %<*debug> % \begin{macrocode} -\ProvidesExplPackage {tagpdf-debug} {2023-11-13} {0.98o} +\ProvidesExplPackage {tagpdf-debug} {2023-11-17} {0.98p} { debug code for tagpdf } \@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput} % \end{macrocode} @@ -142,7 +142,7 @@ % we define a base package with dummy functions % \begin{macrocode} %<*base> -\ProvidesExplPackage {tagpdf-base} {2023-11-13} {0.98o} +\ProvidesExplPackage {tagpdf-base} {2023-11-17} {0.98p} {part of tagpdf - provide base, no-op versions of the user commands } %</base> % \end{macrocode} @@ -554,17 +554,20 @@ \group_begin: \bool_set_false:N \l_@@_active_struct_bool \bool_set_false:N \l_@@_active_mc_bool + \@@_stop_para_ints: } \cs_set_eq:NN \tag_stop_group_end: \group_end: \cs_set_protected:Npn \tag_stop: { \bool_set_false:N \l_@@_active_struct_bool \bool_set_false:N \l_@@_active_mc_bool + \@@_stop_para_ints: } \cs_set_protected:Npn \tag_start: { \bool_set_true:N \l_@@_active_struct_bool \bool_set_true:N \l_@@_active_mc_bool + \@@_start_para_ints: } \cs_set_eq:NN\tagstop\tag_stop: \cs_set_eq:NN\tagstart\tag_start: @@ -575,6 +578,7 @@ { \bool_set_false:N \l_@@_active_struct_bool \bool_set_false:N \l_@@_active_mc_bool + \@@_stop_para_ints: \prop_gput:Nnn \g_@@_state_prop { #1 }{ 1 } } { @@ -588,6 +592,7 @@ { \bool_set_true:N \l_@@_active_struct_bool \bool_set_true:N \l_@@_active_mc_bool + \@@_start_para_ints: } } %</package> |