[latex3-commits] [git/LaTeX3-latex3-latex2e] testnewpara: update tagpdf (df32177e)
Ulrike Fischer
fischer at troubleshooting-tex.de
Wed Mar 1 16:12:35 CET 2023
Repository : https://github.com/latex3/latex2e
On branch : testnewpara
Link : https://github.com/latex3/latex2e/commit/df32177ec7876250ad502ae2ab02b4ef9c6da86a
>---------------------------------------------------------------
commit df32177ec7876250ad502ae2ab02b4ef9c6da86a
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Wed Mar 1 16:12:35 2023 +0100
update tagpdf
>---------------------------------------------------------------
df32177ec7876250ad502ae2ab02b4ef9c6da86a
texmf/tex/latex/tagpdf/tagpdf-ns-latex.def | 1 +
texmf/tex/latex/tagpdf/tagpdf.sty | 36 ++++++++++++++++++++++++++----
2 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/texmf/tex/latex/tagpdf/tagpdf-ns-latex.def b/texmf/tex/latex/tagpdf/tagpdf-ns-latex.def
index 383578f2..2de35a35 100644
--- a/texmf/tex/latex/tagpdf/tagpdf-ns-latex.def
+++ b/texmf/tex/latex/tagpdf/tagpdf-ns-latex.def
@@ -37,6 +37,7 @@ itembody, LBody, pdf2,
footnote, FENote, pdf2,
footnotemark, Lbl, pdf2,
footnotelabel,Lbl, pdf2,
+tpara, Part, pdf2,
%%
%%
%% End of file `tagpdf-ns-latex.def'.
diff --git a/texmf/tex/latex/tagpdf/tagpdf.sty b/texmf/tex/latex/tagpdf/tagpdf.sty
index ab618dc7..aac3b840 100644
--- a/texmf/tex/latex/tagpdf/tagpdf.sty
+++ b/texmf/tex/latex/tagpdf/tagpdf.sty
@@ -317,7 +317,7 @@
{engine/output~mode~#1~doesn't~support~the~interword~spaces}
\cs_set_eq:NN \__tag_check_typeout_v:n \use_none:n
\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!}
\prg_set_conditional:Npnn \tag_if_active: { p , T , TF, F }
{
@@ -3002,13 +3002,19 @@
}
}
\bool_new:N \l__tag_para_bool
+\bool_new:N \l__tag_para_main_bool
+\bool_set_true:N \l__tag_para_main_bool
\bool_new:N \l__tag_para_show_bool
\int_new:N \g__tag_para_begin_int
\int_new:N \g__tag_para_end_int
+\int_new:N \g__tag_para_main_begin_int
+\int_new:N \g__tag_para_main_end_int
\tl_new:N \l__tag_para_tag_default_tl
\tl_set:Nn \l__tag_para_tag_default_tl { P }
\tl_new:N \l__tag_para_tag_tl
\tl_set:Nn \l__tag_para_tag_tl { \l__tag_para_tag_default_tl }
+\tl_new:N \l__tag_para_main_tag_tl
+\tl_set:Nn \l__tag_para_main_tag_tl {tpara}
\keys_define:nn { __tag / setup }
{
paratagging .bool_set:N = \l__tag_para_bool,
@@ -3017,7 +3023,8 @@
}
\keys_define:nn { tag / tool}
{
- paratag .tl_set:N = \l__tag_para_tag_tl
+ paratag .tl_set:N = \l__tag_para_tag_tl,
+ para/main .bool_set:N = \l__tag_para_main_bool
}
\cs_new_protected:Npn \__tag_check_para_begin_show:nn #1 #2
%#1 color, #2 prefix
@@ -3045,6 +3052,11 @@
{
\bool_if:NT \l__tag_para_bool
{
+ \bool_if:NT \l__tag_para_main_bool
+ {
+ \int_gincr:N \g__tag_para_main_begin_int
+ \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl}
+ }
\int_gincr:N \g__tag_para_begin_int
\tag_struct_begin:n {tag=\l__tag_para_tag_tl}
\__tag_check_para_begin_show:nn {green}{}
@@ -3059,17 +3071,32 @@
\tag_mc_end:
\__tag_check_para_end_show:nn {red}{}
\tag_struct_end:
+ \bool_if:NT \l__tag_para_main_bool
+ {
+ \int_gincr:N \g__tag_para_main_end_int
+ \tag_struct_end:
+ }
}
}
\AddToHook{enddocument/info}
{
+ \int_compare:nNnF {\g__tag_para_main_begin_int}={\g__tag_para_main_end_int}
+ {
+ \msg_error:nnxxn
+ {tag}
+ {para-hook-count-wrong}
+ {\int_use:N\g__tag_para_begin_int}
+ {\int_use:N\g__tag_para_end_int}
+ {tpara}
+ }
\int_compare:nNnF {\g__tag_para_begin_int}={\g__tag_para_end_int}
{
- \msg_error:nnxx
+ \msg_error:nnxxn
{tag}
{para-hook-count-wrong}
{\int_use:N\g__tag_para_begin_int}
{\int_use:N\g__tag_para_end_int}
+ {P}
}
}
\AddToHook{begindocument/before}
@@ -3102,7 +3129,8 @@
\renewcommand\tagpdfparaOff{\bool_set_false:N \l__tag_para_bool}
\keys_define:nn { tag / tool}
{
- para .bool_set:N = \l__tag_para_bool
+ para .bool_set:N = \l__tag_para_bool,
+ para-main .bool_set:N = \l__tag_para_main_bool,
}
\NewDocumentCommand\tagpdfsuppressmarks{m}
{{\use:c{__tag_mc_disable_marks:} #1}}
More information about the latex3-commits
mailing list.