Skip to content

Commit

Permalink
working on structure destination, WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed Apr 1, 2024
1 parent 5765e5b commit 4bc8b05
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions l3backend-testphase.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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}
Expand Down

0 comments on commit 4bc8b05

Please sign in to comment.