diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty | 56 |
1 files changed, 33 insertions, 23 deletions
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty index 822b654d92a..91dcf65368e 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty @@ -27,7 +27,7 @@ %% and all files in that bundle must be distributed together. %% %% File: tagpdf.dtx -\ProvidesExplPackage {tagpdf} {2022-01-13} {0.93} +\ProvidesExplPackage {tagpdf} {2022-05-11} {0.94} { A package to experiment with pdf tagging } \bool_if:nF @@ -45,7 +45,7 @@ { Activate~it~with \MessageBreak \string\RequirePackage{pdfmanagement-testphase}\MessageBreak - \string\DeclareDocumentMetadata{<options>}\MessageBreak + \string\DocumentMetadata{<options>}\MessageBreak before~\string\documentclass } } @@ -56,6 +56,7 @@ \ExecuteOptions{luamode} \ProcessOptions \RequirePackage{l3ref-tmp} +\RequirePackage{tagpdf-base} \cs_new_protected:Npn \__tag_lastpagelabel: { \legacy_if:nT { @filesw } @@ -120,7 +121,7 @@ \cs_generate_variant:Nn \pdf_object_ref:n {e} \cs_generate_variant:Nn \pdfannot_dict_put:nnn {nnx} \cs_generate_variant:Nn \pdffile_embed_stream:nnn {nxx,oxx} -\cs_generate_variant:Nn \prop_gput:Nnn {Nxx} +\cs_generate_variant:Nn \prop_gput:Nnn {Nxx,Nen} \cs_generate_variant:Nn \prop_put:Nnn {Nxx} \cs_generate_variant:Nn \ref_label:nn { nv } \cs_generate_variant:Nn \seq_set_split:Nnn{Nne} @@ -181,6 +182,11 @@ \bool_set_false:N \l__tag_active_mc_bool } \cs_set_eq:NN \tag_stop_group_end: \group_end: +\cs_new_protected:Npn \tag_stop: + { + \bool_set_false:N \l__tag_active_struct_bool + \bool_set_false:N \l__tag_active_mc_bool + } \keys_define:nn { __tag / setup } { @@ -263,7 +269,7 @@ {The~number~of~automatic~begin~(#1)~and~end~(#2)~para~hooks~differ!} {This~quite~probably~a~coding~error~and~the~structure~will~be~wrong!} \cs_new:Npn \tag_get:n #1 { \use:c {__tag_get_data_#1: } } -\prg_new_conditional:Npnn \tag_if_active: { p , T , TF, F } +\prg_set_conditional:Npnn \tag_if_active: { p , T , TF, F } { \bool_lazy_all:nTF { @@ -490,7 +496,7 @@ { \prg_return_true: } { \prg_return_false: } } -%% File: tagpdf-mc.dtx +%% File: tagpdf-mc-shared.dtx \newcounter { g__tag_MCID_abs_int } \cs_new:Npn \__tag_get_mc_abs_cnt: { \int_use:N \c@g__tag_MCID_abs_int } @@ -513,7 +519,7 @@ { \tl_new:c { g__tag_mc_label_\tl_to_str:n{#1}_used_tl } } -\cs_new_protected:Npn \tag_mc_use:n #1 %#1: label name +\cs_set_protected:Npn \tag_mc_use:n #1 %#1: label name { \__tag_check_if_active_struct:T { @@ -534,20 +540,20 @@ } } } -\cs_new_protected:Npn \tag_mc_artifact_group_begin:n #1 +\cs_set_protected:Npn \tag_mc_artifact_group_begin:n #1 { \tag_mc_end_push: \tag_mc_begin:n {artifact=#1} \tag_stop_group_begin: } -\cs_new_protected:Npn \tag_mc_artifact_group_end: +\cs_set_protected:Npn \tag_mc_artifact_group_end: { \tag_stop_group_end: \tag_mc_end: \tag_mc_begin_pop:n{} } -\cs_new_protected:Npn \tag_mc_end_push: +\cs_set_protected:Npn \tag_mc_end_push: { \__tag_check_if_active_mc:T { @@ -566,7 +572,7 @@ } } -\cs_new_protected:Npn \tag_mc_begin_pop:n #1 +\cs_set_protected:Npn \tag_mc_begin_pop:n #1 { \__tag_check_if_active_mc:T { @@ -786,7 +792,7 @@ \seq_gremove_duplicates:N \g__tag_attr_class_used_seq \seq_set_map:NNn \l__tag_tmpa_seq \g__tag_attr_class_used_seq { - /##1\c_space_tl + ##1\c_space_tl << \prop_item:Nn \g__tag_attr_entries_prop @@ -1862,7 +1868,7 @@ } }, } -\cs_new_protected:Npn \tag_struct_begin:n #1 %#1 key-val +\cs_set_protected:Npn \tag_struct_begin:n #1 %#1 key-val { \__tag_check_if_active_struct:T { @@ -1920,7 +1926,7 @@ \group_end: } } -\cs_new_protected:Nn \tag_struct_end: +\cs_set_protected:Nn \tag_struct_end: { %take the current structure num from the stack: %the objects are written later, lua mode hasn't all needed info yet %\seq_show:N \g__tag_struct_stack_seq @@ -1946,7 +1952,7 @@ } } } -\cs_new_protected:Nn \tag_struct_use:n %#1 is the label +\cs_set_protected:Npn \tag_struct_use:n #1 %#1 is the label { \__tag_check_if_active_struct:T { @@ -1990,8 +1996,8 @@ \prop_new:N \g__tag_attr_objref_prop %will contain obj num of used attributes \cs_new_protected:Npn \__tag_attr_new_entry:nn #1 #2 %#1:name, #2: content { - \prop_gput:Nnn \g__tag_attr_entries_prop - {#1}{#2} + \prop_gput:Nen \g__tag_attr_entries_prop + {\pdf_name_from_unicode_e:n{#1}}{#2} } \keys_define:nn { __tag / setup } @@ -2006,7 +2012,11 @@ attribute-class .code:n = { \clist_set:No \l__tag_tmpa_clist { #1 } - \seq_set_from_clist:NN \l__tag_tmpa_seq \l__tag_tmpa_clist + \seq_set_from_clist:NN \l__tag_tmpb_seq \l__tag_tmpa_clist + \seq_set_map_x:NNn \l__tag_tmpa_seq \l__tag_tmpb_seq + { + \pdf_name_from_unicode_e:n {##1} + } \seq_map_inline:Nn \l__tag_tmpa_seq { \prop_if_in:NnF \g__tag_attr_entries_prop {##1} @@ -2015,14 +2025,10 @@ } \seq_gput_left:Nn\g__tag_attr_class_used_seq { ##1} } - \seq_set_map:NNn \l__tag_tmpb_seq \l__tag_tmpa_seq - { - /##1 - } \tl_set:Nx \l__tag_tmpa_tl { \int_compare:nT { \seq_count:N \l__tag_tmpa_seq > 1 }{[} - \seq_use:Nn \l__tag_tmpb_seq { \c_space_tl } + \seq_use:Nn \l__tag_tmpa_seq { \c_space_tl } \int_compare:nT { \seq_count:N \l__tag_tmpa_seq > 1 }{]} } \int_compare:nT { \seq_count:N \l__tag_tmpa_seq > 0 } @@ -2040,7 +2046,11 @@ attribute .code:n = % A property (attribute, value currently a dictionary) { \clist_set:No \l__tag_tmpa_clist { #1 } - \seq_set_from_clist:NN \l__tag_tmpa_seq \l__tag_tmpa_clist + \seq_set_from_clist:NN \l__tag_tmpb_seq \l__tag_tmpa_clist + \seq_set_map_x:NNn \l__tag_tmpa_seq \l__tag_tmpb_seq + { + \pdf_name_from_unicode_e:n {##1} + } \tl_set:Nx \l__tag_attr_value_tl { \int_compare:nT { \seq_count:N \l__tag_tmpa_seq > 1 }{[}%] |