diff options
author | Karl Berry <karl@freefriends.org> | 2024-02-03 21:13:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-02-03 21:13:44 +0000 |
commit | b0fe309be00e3d805ab19c3d51935bf7d39517f1 (patch) | |
tree | 9361d1b5a6d116bb3f0700bf3c059182faaeaa94 /Master/texmf-dist/source/latex | |
parent | 628f2068c18d2c8c8f4e07e12dacbce540f52cf7 (diff) |
tagpdf (3feb24)
git-svn-id: svn://tug.org/texlive/trunk@69691 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
12 files changed, 159 insertions, 102 deletions
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx index 809fb896fc4..811da157581 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.98t, released 2024-01-26} +% \date{Version 0.98u, released 2024-02-02} % \maketitle % \begin{implementation} % \begin{macrocode} %<@@=tag> %<*luatex> -\ProvidesExplFile {tagpdf-luatex.def} {2024-01-26} {0.98t} +\ProvidesExplFile {tagpdf-luatex.def} {2024-02-02} {0.98u} {tagpdf~driver~for~luatex} % \end{macrocode} % \section{Loading the lua} @@ -158,8 +158,8 @@ local ProvidesLuaModule = { name = "tagpdf", - version = "0.98t", --TAGVERSION - date = "2024-01-26", --TAGDATE + version = "0.98u", --TAGVERSION + date = "2024-02-02", --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 5205df1cf69..83586fb20c2 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.98t, released 2024-01-26} +% \date{Version 0.98u, released 2024-02-02} % \maketitle % \begin{documentation} % \section{Commands} @@ -327,7 +327,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-checks-code} {2024-01-26} {0.98t} +\ProvidesExplPackage {tagpdf-checks-code} {2024-02-02} {0.98u} {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 e9f0d147903..64052152971 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.98t, released 2024-01-26} +% \date{Version 0.98u, released 2024-02-02} % \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} {2024-01-26} {0.98t} +%% \ProvidesExplFile {tagpdf-ns-latex.def} {2024-02-02} {0.98u} %% {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} {2024-01-26} {0.98t} +%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2024-02-02} {0.98u} %% {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} {2024-01-26} {0.98t} +%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2024-02-02} {0.98u} %% {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} {2024-01-26} {0.98t} +%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2024-02-02} {0.98u} %% {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} {2024-01-26} {0.98t} +%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2024-02-02} {0.98u} %% {pdf2} {http://iso.org/pdf2/ssn}{} StructTreeRoot,StructTreeRoot,pdf2,D, Document,Document,pdf2,D, @@ -247,7 +247,7 @@ Strong,Strong,pdf2,I, % \section{The mathml namespace data} % \begin{macrocode} %<*ns-mathml> -%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2024-01-26} {0.98t} +%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2024-02-02} {0.98u} % {mathml}{http://www.w3.org/1998/Math/MathML}{} abs,abs,mathml, and,and,mathml, @@ -482,7 +482,7 @@ xor,xor,mathml, % This will perhaps change in future. % \begin{macrocode} %<*parent-child> -%% \ProvidesExplFile {tagpdf-parent-child.csv} {2024-01-26} {0.98t} +%% \ProvidesExplFile {tagpdf-parent-child.csv} {2024-02-02} {0.98u} ,,,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,∅,∅ @@ -537,7 +537,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} {2024-01-26} {0.98t} +%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2024-02-02} {0.98u} ,,,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 3764e92d11b..04f5501657e 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.98t, released 2024-01-26} +% \date{Version 0.98u, released 2024-02-02} % \maketitle % \begin{documentation} % \end{documentation} @@ -55,11 +55,11 @@ % \begin{macrocode} %<@@=tag> %<*generic> -\ProvidesExplPackage {tagpdf-mc-code-generic} {2024-01-26} {0.98t} +\ProvidesExplPackage {tagpdf-mc-code-generic} {2024-02-02} {0.98u} {part of tagpdf - code related to marking chunks - generic mode} %</generic> %<*debug> -\ProvidesExplPackage {tagpdf-debug-generic} {2024-01-26} {0.98t} +\ProvidesExplPackage {tagpdf-debug-generic} {2024-02-02} {0.98u} {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 20dd45ecc2e..8f9678e55aa 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.98t, released 2024-01-26} +% \date{Version 0.98u, released 2024-02-02} % \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} {2024-01-26} {0.98t} +\ProvidesExplPackage {tagpdf-mc-code-lua} {2024-02-02} {0.98u} {tagpdf - mc code only for the luamode } %</luamode> %<*debug> -\ProvidesExplPackage {tagpdf-debug-lua} {2024-01-26} {0.98t} +\ProvidesExplPackage {tagpdf-debug-lua} {2024-02-02} {0.98u} {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 db7c7277707..8799df3d4c1 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.98t, released 2024-01-26} +% \date{Version 0.98u, released 2024-02-02} % \maketitle % \begin{documentation} % \section{Public Commands} @@ -181,7 +181,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-mc-code-shared} {2024-01-26} {0.98t} +\ProvidesExplPackage {tagpdf-mc-code-shared} {2024-02-02} {0.98u} {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 682c4e387a4..98750fa4618 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.98t, released 2024-01-26} +% \date{Version 0.98u, released 2024-02-02} % \maketitle % \begin{documentation} % \begin{function} @@ -98,7 +98,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-roles-code} {2024-01-26} {0.98t} +\ProvidesExplPackage {tagpdf-roles-code} {2024-02-02} {0.98u} {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 feff45c1731..3e3b3de7e6e 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.98t, released 2024-01-26} +% \date{Version 0.98u, released 2024-02-02} % \maketitle % \begin{documentation} % \begin{function}{interwordspace (setup-key)} @@ -64,7 +64,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-space-code} {2024-01-26} {0.98t} +\ProvidesExplPackage {tagpdf-space-code} {2024-02-02} {0.98u} {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 bcc9083ae2c..8f0dd1e7176 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.98t, released 2024-01-26} +% \date{Version 0.98u, released 2024-02-02} % \maketitle % \begin{documentation} % \section{Public Commands} @@ -285,7 +285,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-struct-code} {2024-01-26} {0.98t} +\ProvidesExplPackage {tagpdf-struct-code} {2024-02-02} {0.98u} {part of tagpdf - code related to storing structure} %</header> % \end{macrocode} @@ -1905,7 +1905,7 @@ % \section{Attributes and attribute classes} % \begin{macrocode} %<*header> -\ProvidesExplPackage {tagpdf-attr-code} {2024-01-26} {0.98t} +\ProvidesExplPackage {tagpdf-attr-code} {2024-02-02} {0.98u} {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 362f3ecf7e5..d9ed68f31f1 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.98t, released 2024-01-26} +% \date{Version 0.98u, released 2024-02-02} % \maketitle % \begin{implementation} % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-tree-code} {2024-01-26} {0.98t} +\ProvidesExplPackage {tagpdf-tree-code} {2024-02-02} {0.98u} {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 ebdc8cece28..aea543ba405 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.98t, released 2024-01-26} +% \date{Version 0.98u, released 2024-02-02} % \maketitle % \begin{documentation} % \section{Setup commands} @@ -303,7 +303,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-user} {2024-01-26} {0.98t} +\ProvidesExplPackage {tagpdf-user} {2024-02-02} {0.98u} {tagpdf - user commands} %</header> % \end{macrocode} @@ -736,6 +736,7 @@ % \g_@@_para_end_int, % \g_@@_para_main_begin_int, % \g_@@_para_main_end_int, +% \g_@@_para_main_struct_tl, % \l_@@_para_tag_default_tl, % \l_@@_para_tag_tl, % \l_@@_para_main_tag_tl, @@ -752,6 +753,10 @@ \int_new:N \g_@@_para_end_int \int_new:N \g_@@_para_main_begin_int \int_new:N \g_@@_para_main_end_int +% \end{macrocode} +% this will hold the structure number of the current text-unit. +% \begin{macrocode} +\tl_new:N \g_@@_para_main_struct_tl \tl_new:N \l_@@_para_tag_default_tl \tl_set:Nn \l_@@_para_tag_default_tl { text } \tl_new:N \l_@@_para_tag_tl @@ -795,7 +800,6 @@ } % \end{macrocode} % \end{macro} - % \begin{macro}{\@@_start_para_ints:,\@@_stop_para_ints:} % \begin{macrocode} \cs_new_protected:Npn \@@_start_para_ints: @@ -827,21 +831,31 @@ % \end{macrocode} % \end{macro} % +% We want to be able to inspect the current para main structure, so +% we need a command to store its structure number +% \begin{macro}{\@@_para_main_store_struct:} +% \begin{macrocode} +\cs_new:Npn \@@_para_main_store_struct: + { + \tl_gset:Ne \g_@@_para_main_struct_tl {\int_use:N \c@g_@@_struct_abs_int } + } +% \end{macrocode} +% \end{macro} % TEMPORARLY FIX (2023-11-17). Until latex-lab is updated 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=\l_@@_para_tag_tl} + \@@_gincr_para_begin_int: \tagstructbegin{tag=Lbl} \setbox\@tempboxa \hbox { \bool_lazy_and:nnT {\tag_if_active_p:} - {\g__tag_mode_lua_bool} + {\g_@@_mode_lua_bool} {\tagmcbegin{tag=Lbl}} {#1} } @@ -852,7 +866,7 @@ } } % \end{macrocode} -% and two adaptions from the block module: +% and one temporary adaptions for the block module: % \begin{macrocode} \AddToHook{package/latex-lab-testphase-block/after} { @@ -860,49 +874,6 @@ { \tl_set:Nn \l_@@_para_attr_class_tl { \l_tag_para_attr_class_tl } } - \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_@@_para_main_tag_tl, - attribute-class=\l_@@_para_main_attr_class_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_@@_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} @@ -934,7 +905,7 @@ } % \end{macrocode} % \end{macro} -% This fills the para hooks with the needed code. +% Helper command for debugging: % \begin{macrocode} \cs_new_protected:Npn \@@_check_para_begin_show:nn #1 #2 %#1 color, #2 prefix @@ -957,30 +928,82 @@ \tag_mc_end: } } - -\AddToHook{para/begin} - { +% \end{macrocode} +% +% The para/begin and para/end code. +% We have two variants here: a simpler one, which must be used +% if the block code is not used (and so probably will disappear +% at some time) and a more sophisticated one that must +% be used if the block code is used. +% It is possible that we will need more variants, so +% we setup a socket so that the code can be easily switched. +% \begin{macrocode} +\socket_new:nn {tagsupport/para/begin}{0} +\socket_new:nn {tagsupport/para/end}{0} + +\socket_new_plug:nnn{tagsupport/para/begin}{plain} + { \bool_if:NT \l_@@_para_bool { \bool_if:NF \l_@@_para_flattened_bool + { + \@@_gincr_para_main_begin_int: + \tag_struct_begin:n + { + tag=\l_@@_para_main_tag_tl, + } + \@@_para_main_store_struct: + } + \@@_gincr_para_begin_int: + \tag_struct_begin:n {tag=\l_@@_para_tag_tl} + \@@_check_para_begin_show:nn {green}{} + \tag_mc_begin:n {} + } + } +\socket_new_plug:nnn{tagsupport/para/begin}{block} + { + \bool_if:NT \l_@@_para_bool + { + \legacy_if:nF { @inlabel } { - \@@_gincr_para_main_begin_int: - \tag_struct_begin:n - { - tag=\l_@@_para_main_tag_tl, + \@@_check_typeout_v:n + {==>~ @endpe = \legacy_if:nTF { @endpe }{true}{false} \on@line } + \legacy_if:nF { @endpe } + { + \bool_if:NF \l_@@_para_flattened_bool + { + \@@_gincr_para_main_begin_int: + \tag_struct_begin:n + { + tag=\l_@@_para_main_tag_tl, + attribute-class=\l_@@_para_main_attr_class_tl, + } + \@@_para_main_store_struct: + } } - } - \@@_gincr_para_begin_int: - \tag_struct_begin:n {tag=\l_@@_para_tag_tl} - \@@_check_para_begin_show:nn {green}{} - \tag_mc_begin:n {} - } - } -\AddToHook{para/end} + \@@_gincr_para_begin_int: + \@@_check_typeout_v:n {==>~increment~ P \on@line } + \tag_struct_begin:n + { + tag=\l_@@_para_tag_tl + ,attribute-class=\l_@@_para_attr_class_tl + } + \@@_check_para_begin_show:nn {green}{\PARALABEL} + \tag_mc_begin:n {} + } + } + } +% \end{macrocode} +% there was no real difference between the original and +% in the block variant, only a debug message. We therefore +% define only a plain variant. +% \begin{macrocode} +\socket_new_plug:nnn{tagsupport/para/end}{plain} { \bool_if:NT \l_@@_para_bool { \@@_gincr_para_end_int: + \@@_check_typeout_v:n {==>~increment~ /P \on@line } \tag_mc_end: \@@_check_para_end_show:nn {red}{} \tag_struct_end: @@ -989,9 +1012,43 @@ \@@_gincr_para_main_end_int: \tag_struct_end: } - } + } } % \end{macrocode} +% By default we assign the plain plug: +% \begin{macrocode} +\socket_assign_plug:nn { tagsupport/para/begin}{plain} +\socket_assign_plug:nn { tagsupport/para/end}{plain} +% \end{macrocode} +% And use the sockets in the hooks. Once tagging sockets exist, this +% can be adapted. +% \begin{macrocode} +\AddToHook{para/begin}{ \socket_use:n { tagsupport/para/begin } + } +\AddToHook{para/end} { \socket_use:n { tagsupport/para/end } } +% \end{macrocode} +% +% If the block code is loaded we must ensure that it doesn't overwrite +% the hook again. And we must reassign the para/begin plug. +% This can go once the block code no longer tries to adapt the hooks. +% \begin{macrocode} +\AddToHook{package/latex-lab-testphase-block/after} + { + \RemoveFromHook{para/begin}[tagpdf] + \RemoveFromHook{para/end}[latex-lab-testphase-block] + \AddToHook{para/begin}[tagpdf] + { + \socket_use:n { tagsupport/para/begin } + } + \AddToHook{para/end}[tagpdf] + { + \socket_use:n { tagsupport/para/end } + } + \socket_assign_plug:nn { tagsupport/para/begin}{block} + } + +% \end{macrocode} +% % We check the para count at the end. If tagging is not active it is not a error, % but we issue a warning as it perhaps indicates that the testphase code didn't guard % everything correctly. diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx index 71585725aa3..d1ccff926cb 100644 --- a/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx +++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx @@ -84,7 +84,7 @@ % \begin{macrocode} %<@@=tag> %<*package> -\ProvidesExplPackage {tagpdf} {2024-01-26} {0.98t} +\ProvidesExplPackage {tagpdf} {2024-02-02} {0.98u} { A package to experiment with pdf tagging } \bool_if:nF @@ -110,7 +110,7 @@ % \end{macrocode} %<*debug> % \begin{macrocode} -\ProvidesExplPackage {tagpdf-debug} {2024-01-26} {0.98t} +\ProvidesExplPackage {tagpdf-debug} {2024-02-02} {0.98u} { debug code for tagpdf } \@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput} % \end{macrocode} @@ -133,7 +133,7 @@ % we define a base package with dummy functions % \begin{macrocode} %<*base> -\ProvidesExplPackage {tagpdf-base} {2024-01-26} {0.98t} +\ProvidesExplPackage {tagpdf-base} {2024-02-02} {0.98u} {part of tagpdf - provide base, no-op versions of the user commands } %</base> % \end{macrocode} |