From 4bc8b059c23498ed6c4eabc9ae3ad00359a14de3 Mon Sep 17 00:00:00 2001 From: Ulrike Fischer Date: Mon, 1 Apr 2024 22:35:09 +0200 Subject: [PATCH] working on structure destination, WIP --- l3backend-testphase.dtx | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/l3backend-testphase.dtx b/l3backend-testphase.dtx index 00875c16..74039a3a 100644 --- a/l3backend-testphase.dtx +++ b/l3backend-testphase.dtx @@ -1757,14 +1757,22 @@ % that if structure destinations are used, they should be used always. So we define % alternative commands which can be activated by mapping them to the standard backend commands. % +% The needed code differ depending on if structure objects use standard or indexed object names. +% At the end we will probably always use indexed objects, but for now we offer +% both options. +% % \begin{macro}{\l_pdf_current_structure_destination_tl} % -% This commands holds the name of the structure object to use in the next command +% This command holds the name of the structure object to use in the following commands % which creates a destination. The code which activates structure destinations % must also ensure that it has a sensible, expandable content. \pkg{tagpdf} for example % will define it as % \begin{verbatim} % \tl_set:Nn \l_pdf_current_structure_destination_tl { __tag/struct/\g__tag_struct_stack_current_tl } +% \end{verbatim} +% or if indexed structure object names are used +% \begin{verbatim} +% \tl_set:Nn \l_pdf_current_structure_destination_tl { {__tag/struct}{\g__tag_struct_stack_current_tl} } % \end{verbatim} % \begin{macrocode} %<*drivers> @@ -1778,21 +1786,30 @@ % \__pdf_backend_destination:nn -> \__pdf_backend_structure_destination:nn % \__pdf_backend_destination:nnnn -> \__pdf_backend_structure_destination:nnnn % \__pdf_backend_link_begin_goto:nnw -> \__pdf_backend_link_begin_structure_goto:nnw +% \__pdf_backend_destination:nn -> \__pdf_backend_indexed_structure_destination:nn +% \__pdf_backend_destination:nnnn -> \__pdf_backend_indexed_structure_destination:nnnn +% \__pdf_backend_link_begin_goto:nnw -> \__pdf_backend_indexed_link_begin_structure_goto:nnw % \end{verbatim} % % Activating means mapping them onto the original commands. Be aware that not % all engines and compilation routes support structure destinations, for them % the command will be a no-op. % -% \begin{macro}{\pdf_activate_structure_destination:} +% \begin{macro}{\pdf_activate_structure_destination:,\pdf_activate_indexed_structure_destination:} % \begin{macrocode} %<*drivers> \cs_new_protected:Npn \pdf_activate_structure_destination: { - \cs_gset_eq:NN \@@_backend_destination:nn \@@_backend_structure_destination:nn - \cs_gset_eq:NN \@@_backend_destination:nnnn \@@_backend_structure_destination:nnnn + \cs_gset_eq:NN \@@_backend_destination:nn \@@_backend_structure_destination:nn + \cs_gset_eq:NN \@@_backend_destination:nnnn \@@_backend_structure_destination:nnnn \cs_gset_eq:NN \@@_backend_link_begin_goto:nnw \@@_backend_link_begin_structure_goto:nnw } +\cs_new_protected:Npn \pdf_activate_indexed_structure_destination: + { + \cs_gset_eq:NN \@@_backend_destination:nn \@@_backend_indexed_structure_destination:nn + \cs_gset_eq:NN \@@_backend_destination:nnnn \@@_backend_indexed_structure_destination:nnnn + \cs_gset_eq:NN \@@_backend_link_begin_goto:nnw \@@_backend_indexed_link_begin_structure_goto:nnw + } % % \end{macrocode} % \end{macro}