[latex3-commits] [latex3/pdfresources] object-tracking: working on structure destination, WIP (4bc8b05)
github at latex-project.org
github at latex-project.org
Mon Apr 1 22:35:09 CEST 2024
Repository : https://github.com/latex3/pdfresources
On branch : object-tracking
Link : https://github.com/latex3/pdfresources/commit/4bc8b059c23498ed6c4eabc9ae3ad00359a14de3
>---------------------------------------------------------------
commit 4bc8b059c23498ed6c4eabc9ae3ad00359a14de3
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Mon Apr 1 22:35:09 2024 +0200
working on structure destination, WIP
>---------------------------------------------------------------
4bc8b059c23498ed6c4eabc9ae3ad00359a14de3
l3backend-testphase.dtx | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/l3backend-testphase.dtx b/l3backend-testphase.dtx
index 00875c1..74039a3 100644
--- a/l3backend-testphase.dtx
+++ b/l3backend-testphase.dtx
@@ -1757,15 +1757,23 @@
% 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>
\tl_new:N \l_pdf_current_structure_destination_tl
@@ -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
+ }
%</drivers>
% \end{macrocode}
% \end{macro}
More information about the latex3-commits
mailing list.