diff options
Diffstat (limited to 'macros/latex/contrib/tagpdf/tagpdf-struct.dtx')
-rw-r--r-- | macros/latex/contrib/tagpdf/tagpdf-struct.dtx | 81 |
1 files changed, 42 insertions, 39 deletions
diff --git a/macros/latex/contrib/tagpdf/tagpdf-struct.dtx b/macros/latex/contrib/tagpdf/tagpdf-struct.dtx index 2e83d51280..229989dad1 100644 --- a/macros/latex/contrib/tagpdf/tagpdf-struct.dtx +++ b/macros/latex/contrib/tagpdf/tagpdf-struct.dtx @@ -2,7 +2,7 @@ % %% File: tagpdf-struct.dtx % -% Copyright (C) 2019-2022 Ulrike Fischer +% Copyright (C) 2019-2023 Ulrike Fischer % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Version 0.98b, released 2023-01-24} +% \date{Version 0.98c, released 2023-01-30} % \maketitle % \begin{documentation} % \section{Public Commands} @@ -242,7 +242,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-struct-code} {2023-01-24} {0.98b} +\ProvidesExplPackage {tagpdf-struct-code} {2023-01-30} {0.98c} {part of tagpdf - code related to storing structure} %</header> % \end{macrocode} @@ -1510,7 +1510,7 @@ % \section{Attributes and attribute classes} % \begin{macrocode} %<*header> -\ProvidesExplPackage {tagpdf-attr-code} {2023-01-24} {0.98b} +\ProvidesExplPackage {tagpdf-attr-code} {2023-01-30} {0.98c} {part of tagpdf - code related to attributes and attribute classes} %</header> % \end{macrocode} @@ -1577,7 +1577,7 @@ { attribute-class .code:n = { - \clist_set:No \l_@@_tmpa_clist { #1 } + \clist_set:Nx \l_@@_tmpa_clist { #1 } \seq_set_from_clist:NN \l_@@_tmpb_seq \l_@@_tmpa_clist % \end{macrocode} % we convert the names into pdf names with slash @@ -1618,50 +1618,53 @@ { attribute .code:n = % A property (attribute, value currently a dictionary) { - \clist_set:No \l_@@_tmpa_clist { #1 } - \seq_set_from_clist:NN \l_@@_tmpb_seq \l_@@_tmpa_clist + \clist_set:Nx \l_@@_tmpa_clist { #1 } + \clist_if_empty:NF \l_@@_tmpa_clist + { + \seq_set_from_clist:NN \l_@@_tmpb_seq \l_@@_tmpa_clist % \end{macrocode} % we convert the names into pdf names with slash % \begin{macrocode} - \seq_set_map_x:NNn \l_@@_tmpa_seq \l_@@_tmpb_seq - { - \pdf_name_from_unicode_e:n {##1} - } - \tl_set:Nx \l_@@_attr_value_tl - { - \int_compare:nT { \seq_count:N \l_@@_tmpa_seq > 1 }{[}%] - } - \seq_map_inline:Nn \l_@@_tmpa_seq - { - \prop_if_in:NnF \g_@@_attr_entries_prop {##1} + \seq_set_map_x:NNn \l_@@_tmpa_seq \l_@@_tmpb_seq + { + \pdf_name_from_unicode_e:n {##1} + } + \tl_set:Nx \l_@@_attr_value_tl { - \msg_error:nnn { tag } { attr-unknown } { ##1 } + \int_compare:nT { \seq_count:N \l_@@_tmpa_seq > 1 }{[}%] } - \prop_if_in:NnF \g_@@_attr_objref_prop {##1} - {%\prop_show:N \g_@@_attr_entries_prop - \pdf_object_unnamed_write:nx - { dict } + \seq_map_inline:Nn \l_@@_tmpa_seq + { + \prop_if_in:NnF \g_@@_attr_entries_prop {##1} { - \prop_item:Nn\g_@@_attr_entries_prop {##1} + \msg_error:nnn { tag } { attr-unknown } { ##1 } } - \prop_gput:Nnx \g_@@_attr_objref_prop {##1} {\pdf_object_ref_last:} + \prop_if_in:NnF \g_@@_attr_objref_prop {##1} + {%\prop_show:N \g_@@_attr_entries_prop + \pdf_object_unnamed_write:nx + { dict } + { + \prop_item:Nn\g_@@_attr_entries_prop {##1} + } + \prop_gput:Nnx \g_@@_attr_objref_prop {##1} {\pdf_object_ref_last:} + } + \tl_put_right:Nx \l_@@_attr_value_tl + { + \c_space_tl + \prop_item:Nn \g_@@_attr_objref_prop {##1} + } + % \tl_show:N \l_@@_attr_value_tl } \tl_put_right:Nx \l_@@_attr_value_tl - { - \c_space_tl - \prop_item:Nn \g_@@_attr_objref_prop {##1} + { %[ + \int_compare:nT { \seq_count:N \l_@@_tmpa_seq > 1 }{]}% } - % \tl_show:N \l_@@_attr_value_tl - } - \tl_put_right:Nx \l_@@_attr_value_tl - { %[ - \int_compare:nT { \seq_count:N \l_@@_tmpa_seq > 1 }{]}% - } - % \tl_show:N \l_@@_attr_value_tl - \@@_prop_gput:cnx - { g_@@_struct_\int_eval:n {\c@g_@@_struct_abs_int}_prop } - { A } - { \l_@@_attr_value_tl } + % \tl_show:N \l_@@_attr_value_tl + \@@_prop_gput:cnx + { g_@@_struct_\int_eval:n {\c@g_@@_struct_abs_int}_prop } + { A } + { \l_@@_attr_value_tl } + } }, } %</package> |