summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tagpdf/tagpdf-tree-code.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-06-30 21:14:14 +0000
committerKarl Berry <karl@freefriends.org>2021-06-30 21:14:14 +0000
commitc604c653358384d71cfbdad75147fe6b3ef448d3 (patch)
treeaaa2eb4dac429b5bb9bdde1d867e88d75612e65d /Master/texmf-dist/tex/latex/tagpdf/tagpdf-tree-code.sty
parentf52cb629a5dd055df1ae60054f89cc718a5ce58e (diff)
tagpdf (30jun21)
git-svn-id: svn://tug.org/texlive/trunk@59769 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tagpdf/tagpdf-tree-code.sty')
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf-tree-code.sty268
1 files changed, 0 insertions, 268 deletions
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-tree-code.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-tree-code.sty
deleted file mode 100644
index 8d8c0859878..00000000000
--- a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-tree-code.sty
+++ /dev/null
@@ -1,268 +0,0 @@
-%%
-%% This is file `tagpdf-tree-code.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% tagpdf-tree.dtx (with options: `tree')
-%%
-%% Copyright (C) 2019 Ulrike Fischer
-%%
-%% It may be distributed and/or modified under the conditions of
-%% the LaTeX Project Public License (LPPL), either version 1.3c of
-%% this license or (at your option) any later version. The latest
-%% version of this license is in the file:
-%%
-%% https://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "tagpdf bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% File: tagpdf-tree.dtx
-\ProvidesExplPackage {tagpdf-tree-code} {2021-06-14} {0.82}
- {part of tagpdf - code related to writing trees and dictionaries to the pdf}
-
-\hook_gput_code:nnn{begindocument}{tagpdf}
- {
- \bool_if:NT \g__tag_active_tree_bool
- {
- \sys_if_output_pdf:TF
- {
- \AddToHook{enddocument/end} { \tag_finish_structure: }
- }
- {
- \AddToHook{shipout/lastpage} { \tag_finish_structure: }
- }
- }
- }
-
-
-\pdf_object_new:nn { __tag/struct/0 }{ dict }
-
- %need to think about the best place ...
-\hook_gput_code:nnn{begindocument}{tagpdf}
- {
- \bool_if:NT \g__tag_active_struct_bool
- {
- \pdfmanagement_add:nnx
- { Catalog }
- { StructTreeRoot }
- { \pdf_object_ref:n { __tag/struct/0 } }
- }
- }
-\cs_new_protected:Nn \__tag_tree_write_structtreeroot:
- {
- \__tag_struct_write_obj:n { 0 }
- }
-
-\cs_new_protected:Nn \__tag_tree_write_structelements:
- {
- \int_step_inline:nnnn {1}{1}{\c@g__tag_struct_abs_int}
- {
- %\prop_show:c {g__tag_struct_##1_prop}
- \__tag_struct_write_obj:n { ##1 } %write the object
- }
- }
-
-
-\pdf_object_new:nn { __tag/tree/parenttree }{ dict }
-
-\newcounter { g__tag_parenttree_obj_int }
-\hook_gput_code:nnn{begindocument}{tagpdf}
- {
- \int_gset:Nn
- \c@g__tag_parenttree_obj_int
- { \__tag_ref_value_lastpage:nn{abspage}{100} }
- }
-
-
-\tl_new:N \g__tag_parenttree_objr_tl
-
-\cs_new_protected:Nn \__tag_parenttree_add_objr:nn %#1 Structparent number, #2 objref
- {
- \tl_gput_right:Nx \g__tag_parenttree_objr_tl
- {
- #1 \c_space_tl #2 ^^J
- }
- }
-
-\tl_new:N \l__tag_parenttree_content_tl
-
-\cs_new_protected:Nn \__tag_tree_fill_parenttree:
- {
- \int_step_inline:nnnn{1}{1}{\__tag_ref_value_lastpage:nn{abspage}{-1}} %not quite clear if labels are needed. See lua code
- { %page ##1\par
- \prop_clear:N \l_tmpa_prop
- \int_step_inline:nnnn{1}{1}{\__tag_ref_value_lastpage:nn{tagmcabs}{-1}}
- {
- %mcid####1
- \int_compare:nT%F
- {\__tag_ref_value:enn{mcid-####1}{tagabspage}{-1}=##1} %mcid is on current page
- {% yes\par
- \prop_put:Nxx
- \l_tmpa_prop
- {\__tag_ref_value:enn{mcid-####1}{tagmcid}{-1}}
- {\prop_item:Nn \g__tag_mc_parenttree_prop {####1}}
- }
- }
- %\prop_show:N \l_tmpa_prop
- \tl_put_right:Nx\l__tag_parenttree_content_tl
- {
- \int_eval:n {##1-1}\c_space_tl
- [\c_space_tl %]
- }
- \int_step_inline:nnnn
- {0}
- {1}
- { \prop_map_function:NN \l_tmpa_prop\__tag_prop_count:nn -1 }
- {
- \prop_get:NnNTF \l_tmpa_prop {####1} \l_tmpb_tl
- {% page#1:mcid##1:\l_tmpb_tl :content
- \tl_put_right:Nx \l__tag_parenttree_content_tl
- {
- \prop_item:cn { g__tag_struct_\l_tmpb_tl _prop } {objref}
- \c_space_tl
- }
- %\tl_show:N \l__tag_parenttree_content_tl
- }
- {
- \msg_warning:nn { tag } {tree-mcid-index-wrong}
- }
- }
- \tl_put_right:Nn
- \l__tag_parenttree_content_tl
- {%[
- ]^^J
- }
- }
- }
-
-\cs_new_protected:Nn \__tag_tree_lua_fill_parenttree:
- {
- \tl_set:Nn \l__tag_parenttree_content_tl
- {
- \directlua
- {
- ltx.__tag.func.output_parenttree
- (
- \int_use:N\g_shipout_readonly_int
- )
- }
- }
- }
-
-\cs_new_protected:Nn \__tag_tree_write_parenttree:
- {
- \bool_if:NTF \g__tag_mode_lua_bool
- {
- \__tag_tree_lua_fill_parenttree:
- }
- {
- \__tag_tree_fill_parenttree:
- }
- \tl_put_right:NV \l__tag_parenttree_content_tl\g__tag_parenttree_objr_tl
- \pdf_object_write:nx { __tag/tree/parenttree }
- {
- /Nums\c_space_tl [\l__tag_parenttree_content_tl]
- }
- }
-
-
-\pdf_object_new:nn { __tag/tree/rolemap }{ dict }
-
-\cs_new_protected:Nn \__tag_tree_write_rolemap:
- {
- \pdf_object_write:nx { __tag/tree/rolemap }
- {
- \pdfdict_use:n{g__tag_role/RoleMap_dict}
- }
- }
-
-
-\cs_new_protected:Nn \__tag_tree_write_classmap:
- {
- \tl_gclear:N \g__tag_attr_class_content_tl
- \seq_gremove_duplicates:N \g__tag_attr_class_used_seq
- \seq_set_map:NNn \l_tmpa_seq \g__tag_attr_class_used_seq
- {
- /##1\c_space_tl
- <<
- \prop_item:Nn
- \g__tag_attr_entries_prop
- {##1}
- >>
- }
- \tl_gset:Nx \g__tag_attr_class_content_tl
- {
- \seq_use:Nn
- \l_tmpa_seq
- { \iow_newline: }
- }
- \tl_if_empty:NF
- \g__tag_attr_class_content_tl
- {
- \pdf_object_new:nn { __tag/tree/classmap }{ dict }
- % \__tag_pdfreserveobjnum:N \l_tmpa_tl
- % \tl_const:Nx \c__tag_tree_obj_classmap_tl { \l_tmpa_tl }
- \pdf_object_write:nx
- { __tag/tree/classmap }
- { \g__tag_attr_class_content_tl }
- \__tag_prop_gput:cnx
- { g__tag_struct_0_prop }
- { ClassMap }
- { \pdf_object_ref:n { __tag/tree/classmap } }
- }
- }
-
-\pdf_object_new:nn{ __tag/tree/namespaces }{array}
-\cs_new_protected:Npn \__tag_tree_write_namespaces:
- {
- \prop_map_inline:Nn \g__tag_role_NS_prop
- {
- \pdfdict_if_empty:nF {g__tag_role/RoleMapNS_##1_dict}
- {
- \pdf_object_write:nx {__tag/RoleMapNS/##1}
- {
- \pdfdict_use:n {g__tag_role/RoleMapNS_##1_dict}
- }
- \pdfdict_gput:nnx{g__tag_role/Namespace_##1_dict}
- {RoleMapNS}{\pdf_object_ref:n {__tag/RoleMapNS/##1}}
- }
- \pdf_object_write:nx{tag/NS/##1}
- {
- \pdfdict_use:n {g__tag_role/Namespace_##1_dict}
- }
- }
- \pdf_object_write:nx {__tag/tree/namespaces}
- {
- \prop_map_tokens:Nn \g__tag_role_NS_prop{\use_ii:nn}
- }
- }
-
-\cs_new_protected:Nn \tag_finish_structure:
- {
- \__tag_tree_write_parenttree:
- \__tag_tree_write_rolemap:
- \__tag_tree_write_classmap:
- \__tag_tree_write_namespaces:
- \__tag_tree_write_structelements: %this is rather slow!!
- \__tag_tree_write_structtreeroot:
- }
-
-\hook_gput_code:nnn{begindocument}{tagpdf}
- {
- \bool_if:NT\g__tag_active_tree_bool
- {
- \hook_gput_code:nnn{shipout/before} { tagpdf/structparents }
- {
- \pdfmanagement_add:nnx
- { Page }
- {StructParents}
- {\int_eval:n { \g_shipout_readonly_int}}
- }
- }
- }
-
-%%
-%%
-%% End of file `tagpdf-tree-code.sty'.