diff options
author | Norbert Preining <norbert@preining.info> | 2023-03-08 03:03:20 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-03-08 03:03:20 +0000 |
commit | a0867c71356c67c442bdebc0de39b7996f847bf7 (patch) | |
tree | 744a3932d78fb03b904b3355ea7b59abd0678055 /macros/latex/contrib/tagpdf/tagpdf-user.dtx | |
parent | 4f55c9271affed648c1a939790a73083043752f5 (diff) |
CTAN sync 202303080303
Diffstat (limited to 'macros/latex/contrib/tagpdf/tagpdf-user.dtx')
-rw-r--r-- | macros/latex/contrib/tagpdf/tagpdf-user.dtx | 67 |
1 files changed, 56 insertions, 11 deletions
diff --git a/macros/latex/contrib/tagpdf/tagpdf-user.dtx b/macros/latex/contrib/tagpdf/tagpdf-user.dtx index 01de768a15..5b1534be04 100644 --- a/macros/latex/contrib/tagpdf/tagpdf-user.dtx +++ b/macros/latex/contrib/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} |