summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tagpdf/tagpdf.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/tagpdf/tagpdf.dtx')
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf.dtx30
1 files changed, 24 insertions, 6 deletions
diff --git a/macros/latex/contrib/tagpdf/tagpdf.dtx b/macros/latex/contrib/tagpdf/tagpdf.dtx
index ba473d7022..959e7c0097 100644
--- a/macros/latex/contrib/tagpdf/tagpdf.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf.dtx
@@ -27,7 +27,7 @@
% \begin{macrocode}
%<@@=tag>
%<*package>
-\ProvidesExplPackage {tagpdf} {2021/05/14} {0.81}
+\ProvidesExplPackage {tagpdf} {2021-06-14} {0.82}
{ A package to experiment with pdf tagging }
\bool_if:nF
@@ -335,7 +335,7 @@
%
% \begin{macrocode}
%<*user>
-\ProvidesExplPackage {tagpdf-user} {2021/05/14} {0.81}
+\ProvidesExplPackage {tagpdf-user} {2021-06-14} {0.82}
{tagpdf - user commands}
% \end{macrocode}
@@ -351,6 +351,24 @@
\cs_set_eq:NN\tagpdfifpdftexT \sys_if_engine_pdftex:T
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\tag_if_active:}
+% This is a test it tagging is active. This allows packages
+% to add conditional code. We probably will need a better
+% test in the end, but for now it should be ok.
+% \begin{macrocode}
+\prg_new_conditional:Npnn \tag_if_active: { p , T , TF, F }
+ {
+ \bool_if:NTF\g_@@_active_struct_bool
+ {
+ \prg_return_true:
+ }
+ {
+ \prg_return_false:
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% We need a command to stop tagging in some places.
%
% \begin{macro}{ \tag_stop_group_begin:, \tag_stop_group_end: }
@@ -590,7 +608,7 @@
\pdfannot_dict_put:nnx
{ link/URI }
{ StructParent }
- { \int_use:N\c@g_@@_parenttree_obj_int }
+ { \tag_struct_parent_int: }
}
}
@@ -600,7 +618,7 @@
{
\bool_if:NT \g_@@_active_struct_bool
{
- \@@_struct_finish_link:
+ \tag_struct_insert_annot:xx {\pdfannot_link_ref_last:}{\tag_struct_parent_int:}
\tag_mc_end:
\tag_struct_end:
\tag_mc_begin_pop:n{}
@@ -619,7 +637,7 @@
\pdfannot_dict_put:nnx
{ link/GoTo }
{ StructParent }
- { \int_use:N\c@g_@@_parenttree_obj_int }
+ { \tag_struct_parent_int: }
}
}
@@ -629,7 +647,7 @@
{
\bool_if:NT \g_@@_active_struct_bool
{
- \@@_struct_finish_link:
+ \tag_struct_insert_annot:xx {\pdfannot_link_ref_last:}{\tag_struct_parent_int:}
\tag_mc_end:
\tag_struct_end:
\tag_mc_begin_pop:n{}