Debian Codegraph @

texmf-dist/tex/latex/tagpdf/tagpdf-base.sty

raw
1 %%
2 %% This is file `tagpdf-base.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% tagpdf.dtx (with options: `base')
8 %% tagpdf-mc-generic.dtx (with options: `base')
9 %% tagpdf-mc-shared.dtx (with options: `base')
10 %% tagpdf-struct.dtx (with options: `base')
11 %% tagpdf-checks.dtx (with options: `base')
12 %% tagpdf-user.dtx (with options: `base')
13 %% tagpdf-roles.dtx (with options: `base')
14 %%
15 %% Copyright (C) 2019-2025 Ulrike Fischer
16 %%
17 %% It may be distributed and/or modified under the conditions of
18 %% the LaTeX Project Public License (LPPL), either version 1.3c of
19 %% this license or (at your option) any later version. The latest
20 %% version of this license is in the file:
21 %%
22 %% https://www.latex-project.org/lppl.txt
23 %%
24 %% This file is part of the "tagpdf bundle" (The Work in LPPL)
25 %% and all files in that bundle must be distributed together.
26 %%
27 %% File: tagpdf.dtx
28 \ProvidesExplPackage {tagpdf-base} {2026-05-17} {1.0c}
29 {part of tagpdf - provide base, no-op versions of the user commands }
30 \cs_new_protected:Npn \__tag_whatsits: {}
31 \AddToHook{begindocument}
32 {
33 \str_case:onF { \c_sys_backend_str }
34 {
35 { luatex } { \cs_set_protected:Npn \__tag_whatsits: {} }
36 { dvisvgm } { \cs_set_protected:Npn \__tag_whatsits: {} }
37 }
38 {
39 \cs_set_protected:Npn \__tag_whatsits: {\tex_special:D {} }
40 }
41 }
42 \cs_new_protected:Npn \tag_stop:{}
43 \cs_new_protected:Npn \tag_start:{}
44 \cs_new_protected:Npn \tagstop{}
45 \cs_new_protected:Npn \tagstart{}
46 \cs_new_protected:Npn \tag_stop:n #1 {}
47 \cs_new_protected:Npn \tag_start:n #1 {}
48 \cs_set_eq:NN \tag_suspend:n \tag_stop:n
49 \cs_set_eq:NN \tag_resume:n \tag_start:n
50 %% File: tagpdf-mc-generic.dtx
51 \cs_new_protected:Npn \tag_mc_begin:n #1 { \__tag_whatsits: \int_gincr:N \c@g__tag_MCID_abs_int }
52 \cs_new_protected:Nn \tag_mc_end:{ \__tag_whatsits: }
53
54 %% File: tagpdf-mc-shared.dtx
55 \newcounter { g__tag_MCID_abs_int }
56 \cs_new:Npn \__tag_get_data_mc_counter:
57 {
58 \int_use:N \c@g__tag_MCID_abs_int
59 }
60 \cs_new_protected:Npn \tag_mc_use:n #1 { \__tag_whatsits: }
61 \cs_new_protected:Npn \tag_mc_artifact_group_begin:n #1 {}
62 \cs_new_protected:Npn \tag_mc_artifact_group_end:{}
63 \cs_new_protected:Npn \tag_mc_reset_box:N #1 {}
64 \cs_new_protected:Npn \tag_mc_end_push: {}
65 \cs_new_protected:Npn \tag_mc_begin_pop:n #1 {}
66 %% File: tagpdf-struct.dtx
67 \int_new:N \c@g__tag_struct_abs_int
68 \int_gset:Nn \c@g__tag_struct_abs_int { 1 }
69 \tl_new:N \g__tag_struct_stack_current_tl
70 \tl_gset:Nn \g__tag_struct_stack_current_tl {\int_use:N\c@g__tag_struct_abs_int}
71 \prop_new_linked:N \g__tag_struct_dest_num_prop
72
73
74 \cs_new:Npn \__tag_get_data_struct_num:
75 {
76 \g__tag_struct_stack_current_tl
77 }
78 \cs_new:Npn \__tag_get_data_struct_counter:
79 {
80 \int_use:N \c@g__tag_struct_abs_int
81 }
82 \cs_new_protected:Npn \tag_struct_begin:n #1 {\int_gincr:N \c@g__tag_struct_abs_int}
83 \cs_new_protected:Npn \tag_struct_end:{}
84 \cs_new_protected:Npn \tag_struct_end:n{}
85 \cs_new_protected:Npn \tag_struct_use:n #1 {}
86 \cs_new_protected:Npn \tag_struct_use_num:n #1 {}
87 \cs_new_protected:Npn \tag_struct_gput:nnn #1 #2 #3{}
88
89 %% File: tagpdf-checks.dtx
90
91
92 \cs_new:Npn \tag_get:n #1 { \use:c {__tag_get_data_#1: } }
93 \cs_if_exist:NF\tag_if_active:T
94 {
95 \prg_new_conditional:Npnn \tag_if_active: { p , T , TF, F }
96 { \prg_return_false: }
97 }
98 \prg_new_conditional:Npnn \tag_if_box_tagged:N #1 {p,T,F,TF}
99 {
100 \tl_if_exist:cTF {l_tag_box_\int_use:N #1_tl}
101 {
102 \int_compare:nNnTF {0\tl_use:c{l_tag_box_\int_use:N #1_tl}}>{0}
103 { \prg_return_true: }
104 { \prg_return_false: }
105 }
106 {
107 \prg_return_false:
108 % warning??
109 }
110 }
111 %% File: tagpdf-user.dtx
112
113
114 \NewDocumentCommand \tagpdfsetup { m }{}
115 \cs_new_protected:Npn\tag_tool:n #1 {}
116 \cs_set_eq:NN\tagtool\tag_tool:n
117
118 \NewDocumentCommand \tagmcbegin { m }
119 {
120 \tag_mc_begin:n {#1}
121 }
122
123 \NewDocumentCommand \tagmcend { }
124 {
125 \tag_mc_end:
126 }
127
128 \NewDocumentCommand \tagmcuse { m }
129 {
130 \tag_mc_use:n {#1}
131 }
132
133 \NewDocumentCommand \tagstructbegin { m }
134 {
135 \tag_struct_begin:n {#1}
136 }
137
138 \NewDocumentCommand \tagstructend { }
139 {
140 \tag_struct_end:
141 }
142
143 \NewDocumentCommand \tagstructuse { m }
144 {
145 \tag_struct_use:n {#1}
146 }
147 \bool_new:N \l__tag_para_flattened_bool
148 \bool_new:N \l__tag_para_bool
149 \newcommand\tagpdfparaOn {}
150 \newcommand\tagpdfparaOff{}
151 %% File: tagpdf-roles.dtx
152 \prg_new_protected_conditional:Npnn \tag_check_child:nn #1 #2 {T,F,TF}{\prg_return_true:}
153 %%
154 %%
155 %% End of file `tagpdf-base.sty'.