diff options
author | Karl Berry <karl@freefriends.org> | 2023-03-07 22:23:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-03-07 22:23:30 +0000 |
commit | 146b9f2edb0a5faffe05dc68e38be4216d3d5da0 (patch) | |
tree | c6d1be5196b1478a6876efc6e6820fa4fe880e7e /Master/texmf-dist/source | |
parent | a07923dc8fd8bbd8bb0c493869925341ce9620a0 (diff) |
tagpdf (7mar23) (branch)
git-svn-id: svn://tug.org/texlive/branches/branch2022.final@66444 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
12 files changed, 145 insertions, 55 deletions
diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx index 012321bba50..9c947ca0b3a 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.98d, released 2023-02-15} +% \date{Version 0.98e, released 2023-03-07} % \maketitle % \begin{implementation} % \begin{macrocode} %<@@=tag> %<*luatex> -\ProvidesExplFile {tagpdf-luatex.def} {2023-02-15} {0.98d} +\ProvidesExplFile {tagpdf-luatex.def} {2023-03-07} {0.98e} {tagpdf~driver~for~luatex} % \end{macrocode} % \section{Loading the lua} @@ -158,8 +158,8 @@ local ProvidesLuaModule = { name = "tagpdf", - version = "0.98d", --TAGVERSION - date = "2023-02-15", --TAGDATE + version = "0.98e", --TAGVERSION + date = "2023-03-07", --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 6219d00192e..2eba24c8892 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.98d, released 2023-02-15} +% \date{Version 0.98e, released 2023-03-07} % \maketitle % \begin{documentation} % \section{Commands} @@ -295,7 +295,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-checks-code} {2023-02-15} {0.98d} +\ProvidesExplPackage {tagpdf-checks-code} {2023-03-07} {0.98e} {part of tagpdf - code related to checks, conditionals, debugging and messages} %</header> % \end{macrocode} @@ -493,7 +493,7 @@ % and breaks the structure. % \begin{macrocode} \msg_new:nnnn { tag } {para-hook-count-wrong} - {The~number~of~automatic~begin~(#1)~and~end~(#2)~para~hooks~differ!} + {The~number~of~automatic~begin~(#1)~and~end~(#2)~#3~para~hooks~differ!} {This~quite~probably~a~coding~error~and~the~structure~will~be~wrong!} %</package> % \end{macrocode} @@ -950,6 +950,10 @@ { Struct~end~#1~[\msg_line_context:] } +\msg_new:nnn { tag / debug } {struct-end-wrong} + { + Struct~end~'#1'~doesn't~fit~start~'#2'~[\msg_line_context:] + } \cs_new_protected:Npn \@@_debug_struct_begin_insert:n #1 { @@ -981,6 +985,24 @@ \msg_note:nnn { tag / debug } {struct-end } {ignored} } } +\cs_new_protected:Npn \@@_debug_struct_end_check:n #1 + { + \int_compare:nNnT { \l_@@_loglevel_int } > {0} + { + \seq_get:NNT \g_@@_struct_tag_stack_seq \l_@@_tmpa_tl + { + \str_if_eq:eeF + {#1} + {\exp_last_unbraced:NV\use_i:nn \l_@@_tmpa_tl} + { + \msg_warning:nnxx { tag/debug }{ struct-end-wrong } + {#1} + {\exp_last_unbraced:NV\use_i:nn \l_@@_tmpa_tl} + } + } + } + } + % \end{macrocode} % \begin{macrocode} %</debug> diff --git a/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx b/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx index 89b6d09d261..77c08c16028 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.98d, released 2023-02-15} +% \date{Version 0.98e, released 2023-03-07} % \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-02-15} {0.98d} +%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-03-07} {0.98e} %% {latex} {https://www.latex-project.org/ns/dflt/2022}{} title, Title, pdf2, part, Title, pdf2, @@ -69,15 +69,21 @@ subsection, H2, pdf2, subsubsection,H3, pdf2, paragraph, H4, pdf2, subparagraph, H5, pdf2, +list, L, pdf2, itemize, L, pdf2, enumerate, L, pdf2, description, L, pdf2, +quote, BlockQuote,pdf, +quotation, BlockQuote,pdf, +verbatim, Div, pdf2, item, LI, pdf2, itemlabel, Lbl, pdf2, itembody, LBody, pdf2, footnote, FENote, pdf2, footnotemark, Lbl, pdf2, footnotelabel,Lbl, pdf2, +text-unit, Part, pdf2, +text, P, pdf2, %</ns-latex> % \end{macrocode} % \section{The LaTeX-book namespace} @@ -86,7 +92,7 @@ footnotelabel,Lbl, pdf2, % It is bound to change % \begin{macrocode} %<*ns-latex-book> -%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-02-15} {0.98d} +%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-03-07} {0.98e} %% {latex-book} {https://www.latex-project.org/ns/book/2022}{} chapter, H1,pdf2, section, H2,pdf2, @@ -102,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-02-15} {0.98d} +%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-03-07} {0.98e} %% {latex-inline} {https://www.latex-project.org/ns/inline/2022}{} chapter, Span, pdf2, section, Span, pdf2, @@ -116,7 +122,7 @@ P, Span, pdf2, % \section{The pdf namespace data} % \begin{macrocode} %<*ns-pdf> -%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-02-15} {0.98d} +%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-03-07} {0.98e} %% {pdf} {http://iso.org/pdf/ssn}{} StructTreeRoot,StructTreeRoot,pdf,D, Document,Document,pdf,D, @@ -184,7 +190,7 @@ Strong,Span,pdf,I, % \section{The pdf 2.0 namespace data} % \begin{macrocode} %<*ns-pdf2> -%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-02-15} {0.98d} +%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-03-07} {0.98e} %% {pdf2} {http://iso.org/pdf2/ssn}{} Document,Document,pdf2,D, Part,Part,pdf2,G, @@ -240,7 +246,7 @@ Strong,Strong,pdf2,I, % \section{The mathml namespace data} % \begin{macrocode} %<*ns-mathml> -%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-02-15} {0.98d} +%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-03-07} {0.98e} % {mathml}{http://www.w3.org/1998/Math/MathML}{} abs,,, and,,, @@ -475,7 +481,7 @@ xor,,, % This will perhaps change in future. % \begin{macrocode} %<*parent-child> -%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-02-15} {0.98d} +%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-03-07} {0.98e} ,,,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 +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-02-15} {0.98d} +%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-03-07} {0.98e} ,,,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 8061a5d18d0..e2973a593b5 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.98d, released 2023-02-15} +% \date{Version 0.98e, released 2023-03-07} % \maketitle % \begin{documentation} % \end{documentation} @@ -55,11 +55,11 @@ % \begin{macrocode} %<@@=tag> %<*generic> -\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-02-15} {0.98d} +\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-03-07} {0.98e} {part of tagpdf - code related to marking chunks - generic mode} %</generic> %<*debug> -\ProvidesExplPackage {tagpdf-debug-generic} {2023-02-15} {0.98d} +\ProvidesExplPackage {tagpdf-debug-generic} {2023-03-07} {0.98e} {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 1b03011ddf2..8e006f6c5b3 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.98d, released 2023-02-15} +% \date{Version 0.98e, released 2023-03-07} % \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-02-15} {0.98d} +\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-03-07} {0.98e} {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 ba5516dc4c9..300eb1ee3b1 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.98d, released 2023-02-15} +% \date{Version 0.98e, released 2023-03-07} % \maketitle % \begin{documentation} % \section{Public Commands} @@ -174,7 +174,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-02-15} {0.98d} +\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-03-07} {0.98e} {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 8557552f9a6..07598ca1484 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.98d, released 2023-02-15} +% \date{Version 0.98e, released 2023-03-07} % \maketitle % \begin{documentation} % \begin{function} @@ -98,7 +98,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-roles-code} {2023-02-15} {0.98d} +\ProvidesExplPackage {tagpdf-roles-code} {2023-03-07} {0.98e} {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 ffb891fdc5b..bbcb91bff19 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.98d, released 2023-02-15} +% \date{Version 0.98e, released 2023-03-07} % \maketitle % \begin{documentation} % \begin{function}{interwordspace (setup-key)} @@ -64,7 +64,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-space-code} {2023-02-15} {0.98d} +\ProvidesExplPackage {tagpdf-space-code} {2023-03-07} {0.98e} {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 c488ad823d7..796ecf34e49 100644 --- a/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx +++ b/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx @@ -46,17 +46,22 @@ % }^^A % } % -% \date{Version 0.98d, released 2023-02-15} +% \date{Version 0.98e, released 2023-03-07} % \maketitle % \begin{documentation} % \section{Public Commands} -% \begin{function}{\tag_struct_begin:n,\tag_struct_end:} +% \begin{function}{\tag_struct_begin:n,\tag_struct_end:,\tag_struct_end:n} % \begin{syntax} % \cs{tag_struct_begin:n}\Arg{key-values}\\ -% \cs{tag_struct_end:} +% \cs{tag_struct_end:}\\ +% \cs{tag_struct_end:n}\Arg{tag} % \end{syntax} % These commands start and end a new structure. % They don't start a group. They set all their values globally. +% \cs{tag_struct_end:n} does nothing special normally (apart from +% swallowing its argument, but if \texttt{tagpdf-debug} is loaded, +% it will check if the \Arg{tag} (after expansion) +% is identical to the current structure on the stack. The tag is not role mapped! % \end{function} % \begin{function}{\tag_struct_use:n} % \begin{syntax} @@ -242,7 +247,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-struct-code} {2023-02-15} {0.98d} +\ProvidesExplPackage {tagpdf-struct-code} {2023-03-07} {0.98e} {part of tagpdf - code related to storing structure} %</header> % \end{macrocode} @@ -416,7 +421,9 @@ % to reference them in a Ref. The key is the destination. % It is currently used by the toc-tagging and sec-tagging code. % \begin{macrocode} -\prop_new:N \g_@@_struct_dest_num_prop +%</package> +%<base>\prop_new:N \g_@@_struct_dest_num_prop +%<*package> % \end{macrocode} % \end{variable} % @@ -1251,6 +1258,7 @@ % \begin{macrocode} %<base>\cs_new_protected:Npn \tag_struct_begin:n #1 {\int_gincr:N \c@g_@@_struct_abs_int} %<base>\cs_new_protected:Npn \tag_struct_end:{} +%<base>\cs_new_protected:Npn \tag_struct_end:n{} %<*package|debug> %<package>\cs_set_protected:Npn \tag_struct_begin:n #1 %#1 key-val %<debug>\cs_set_protected:Npn \tag_struct_begin:n #1 %#1 key-val @@ -1398,6 +1406,12 @@ } %<debug>{\@@_debug_struct_end_ignore:} } + +\cs_set_protected:Npn \tag_struct_end:n #1 + { +%<debug>\@@_debug_struct_end_check:n{#1} + \tag_struct_end: + } %</package|debug> % \end{macrocode} % \end{macro} @@ -1552,7 +1566,7 @@ % \section{Attributes and attribute classes} % \begin{macrocode} %<*header> -\ProvidesExplPackage {tagpdf-attr-code} {2023-02-15} {0.98d} +\ProvidesExplPackage {tagpdf-attr-code} {2023-03-07} {0.98e} {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 c757e9e54d4..c682386fc22 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.98d, released 2023-02-15} +% \date{Version 0.98e, released 2023-03-07} % \maketitle % \begin{implementation} % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-tree-code} {2023-02-15} {0.98d} +\ProvidesExplPackage {tagpdf-tree-code} {2023-03-07} {0.98e} {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 01de768a15c..5b1534be044 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.98d, released 2023-02-15} +% \date{Version 0.98e, released 2023-03-07} % \maketitle % \begin{documentation} % \section{Setup commands} @@ -250,7 +250,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-user} {2023-02-15} {0.98d} +\ProvidesExplPackage {tagpdf-user} {2023-03-07} {0.98e} {tagpdf - user commands} %</header> % \end{macrocode} @@ -554,7 +554,7 @@ { \cs_if_exist_p:N \pdf_activate_structure_destination: } } { - \tl_set:Nn \l_pdf_current_structure_destination_tl { __tag/struct/\g__tag_struct_stack_current_tl } + \tl_set:Nn \l_pdf_current_structure_destination_tl { __tag/struct/\g_@@_struct_stack_current_tl } \pdf_activate_structure_destination: } } @@ -580,17 +580,34 @@ % Probably one should add some checks if we are already in a paragraph. % % -% \begin{macro}{\l_@@_para_bool,\l_@@_para_show_bool,\g_@@_para_int,\l_@@_para_tag_default_tl} +% \begin{macro}{ +% \l_@@_para_bool, +% \l_@@_para_flattened_bool, +% \l_@@_para_show_bool, +% \g_@@_para_begin_int, +% \g_@@_para_end_int, +% \g_@@_para_main_begin_int, +% \g_@@_para_main_end_int, +% \l_@@_para_tag_default_tl, +% \l_@@_para_tag_tl, +% \l_@@_para_main_tag_tl} % At first some variables. % \begin{macrocode} \bool_new:N \l_@@_para_bool +%</package> +%<base>\bool_new:N \l_@@_para_flattened_bool +%<*package> \bool_new:N \l_@@_para_show_bool \int_new:N \g_@@_para_begin_int \int_new:N \g_@@_para_end_int +\int_new:N \g_@@_para_main_begin_int +\int_new:N \g_@@_para_main_end_int \tl_new:N \l_@@_para_tag_default_tl -\tl_set:Nn \l_@@_para_tag_default_tl { P } +\tl_set:Nn \l_@@_para_tag_default_tl { text } \tl_new:N \l_@@_para_tag_tl \tl_set:Nn \l_@@_para_tag_tl { \l_@@_para_tag_default_tl } +\tl_new:N \l_@@_para_main_tag_tl +\tl_set:Nn \l_@@_para_main_tag_tl {text-unit} % \end{macrocode} % \end{macro} % @@ -601,6 +618,8 @@ % paratagging-show (setup-key), % paratag (setup-key), % paratag (tool-key), +% unittag (tool-key), +% para-flattened (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 @@ -615,7 +634,9 @@ } \keys_define:nn { tag / tool} { - paratag .tl_set:N = \l_@@_para_tag_tl + paratag .tl_set:N = \l_@@_para_tag_tl, + unittag .tl_set:N = \l_@@_para_main_tag_tl, + para-flattened .bool_set:N = \l_@@_para_flattened_bool } % \end{macrocode} % \end{macro} @@ -647,6 +668,14 @@ { \bool_if:NT \l_@@_para_bool { + \bool_if:NF \l_@@_para_flattened_bool + { + \int_gincr:N \g_@@_para_main_begin_int + \tag_struct_begin:n + { + tag=\l_@@_para_main_tag_tl, + } + } \int_gincr:N \g_@@_para_begin_int \tag_struct_begin:n {tag=\l_@@_para_tag_tl} \@@_check_para_begin_show:nn {green}{} @@ -661,17 +690,32 @@ \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 + \tag_struct_end: + } } } \AddToHook{enddocument/info} { - \int_compare:nNnF {\g__tag_para_begin_int}={\g__tag_para_end_int} + \int_compare:nNnF {\g_@@_para_main_begin_int}={\g_@@_para_main_end_int} + { + \msg_error:nnxxx + {tag} + {para-hook-count-wrong} + {\int_use:N\g_@@_para_main_begin_int} + {\int_use:N\g_@@_para_main_end_int} + {text-unit} + } + \int_compare:nNnF {\g_@@_para_begin_int}={\g_@@_para_end_int} { - \msg_error:nnxx + \msg_error:nnxxx {tag} {para-hook-count-wrong} - {\int_use:N\g__tag_para_begin_int} - {\int_use:N\g__tag_para_end_int} + {\int_use:N\g_@@_para_begin_int} + {\int_use:N\g_@@_para_end_int} + {text} } } % \end{macrocode} @@ -720,7 +764,8 @@ \renewcommand\tagpdfparaOff{\bool_set_false:N \l_@@_para_bool} \keys_define:nn { tag / tool} { - para .bool_set:N = \l_@@_para_bool + para .bool_set:N = \l_@@_para_bool, + para-flattened .bool_set:N = \l_@@_para_flattened_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 67a3e411d46..ab81e9573a2 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-02-15} {0.98d} +\ProvidesExplPackage {tagpdf} {2023-03-07} {0.98e} { A package to experiment with pdf tagging } \bool_if:nF @@ -118,7 +118,7 @@ % \end{macrocode} %<*debug> % \begin{macrocode} -\ProvidesExplPackage {tagpdf-debug} {2023-02-15} {0.98d} +\ProvidesExplPackage {tagpdf-debug} {2023-03-07} {0.98e} { debug code for tagpdf } \@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput} % \end{macrocode} @@ -136,12 +136,21 @@ \prop_gput:Nnn \g_msg_module_name_prop { tag / debug }{tagpdf~DEBUG} %</debug> % \end{macrocode} +%\section{base package} +% To avoid to have to test everywhere if tagpdf has been loaded and is active, +% we define a base package with dummy functions +% \begin{macrocode} +%<*base> +\ProvidesExplPackage {tagpdf-base} {2023-03-07} {0.98e} + {part of tagpdf - provide base, no-op versions of the user commands } +%</base> +% \end{macrocode} %\section{Package options} % There are only two options to switch for luatex between generic and luamode, % TODO try to get rid of them. % \begin{macrocode} %<*package> -\bool_new:N\g_@@_mode_lua_bool +\bool_new:N\g_@@_mode_lua_bool \DeclareOption {luamode} { \sys_if_engine_luatex:T { \bool_gset_true:N \g_@@_mode_lua_bool } } \DeclareOption {genericmode}{ \bool_gset_false:N\g_@@_mode_lua_bool } \ExecuteOptions{luamode} @@ -157,12 +166,6 @@ \RequirePackage{tagpdf-base} %</package> % \end{macrocode} -% \begin{macrocode} -%<*base> -\ProvidesExplPackage {tagpdf-base} {2023-02-15} {0.98d} - {part of tagpdf - provide base, no-op versions of the user commands } -%</base> -% \end{macrocode} % The no-op version should behave a near enough to the real code as % possible, so we define a command which a special in the relevant backends: % \begin{macrocode} |