1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
%%
%% This is file `tagpdf-mc-code-shared.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% tagpdf-mc.dtx (with options: `shared')
%%
%% 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-mc.dtx
\ProvidesExplPackage {tagpdf-mc-code-shared} {2021/05/14} {0.81}
{part of tagpdf - code related to marking chunks -
code shared by generic and luamode }
\newcounter { g__tag_MCID_abs_int }
\cs_new:Nn \__tag_get_mc_abs_cnt: { \int_use:N \c@g__tag_MCID_abs_int }
\cs_new:Nn \__tag_mc_handle_mc_label:n
{
\__tag_ref_label:en{tagpdf-#1}{mc}
}
\__tag_prop_new:N \g__tag_mc_parenttree_prop
\seq_new:N \g__tag_mc_stack_seq
\tl_new:N \l__tag_mc_artifact_type_tl
\keys_define:nn { __tag / mc }
{
stash .bool_set:N = \l__tag_mc_key_stash_bool,
artifact-bool .bool_set:N = \l__tag_mc_artifact_bool,
artifact-type .choice:,
artifact-type / pagination .code:n =
{
\tl_set:Nn \l__tag_mc_artifact_type_tl { Pagination }
},
artifact-type / layout .code:n =
{
\tl_set:Nn \l__tag_mc_artifact_type_tl { Layout }
},
artifact-type / page .code:n =
{
\tl_set:Nn \l__tag_mc_artifact_type_tl { Page }
},
artifact-type / background .code:n =
{
\tl_set:Nn \l__tag_mc_artifact_type_tl { Background }
},
artifact-type / notype .code:n =
{
\tl_set:Nn \l__tag_mc_artifact_type_tl {}
},
artifact-type / .code:n =
{
\tl_set:Nn \l__tag_mc_artifact_type_tl {}
},
}
\cs_new_protected:Npn \tag_mc_artifact_group_begin:n #1
{
\tag_mc_begin:n {artifact=#1}
\tag_stop_group_begin:
}
\cs_new_protected:Npn \tag_mc_artifact_group_end:
{
\tag_stop_group_end:
\tag_mc_end:
}
\int_new:N \g__tag_MCID_tmp_bypage_int
\cs_new_protected:Npn \tag_mc_end_push:
{
\__tag_mc_if_in:TF
{
\seq_gpush:Nx \g__tag_mc_stack_seq { \tag_get:n {mc_tag} }
\__tag_check_mc_pushed_popped:nn {pushed}{\tag_get:n {mc_tag}}
\tag_mc_end:
}
{
\__tag_check_mc_pushed_popped:nn {pushed}{-1}
\seq_gpush:Nn \g__tag_mc_stack_seq{ -1 }
}
}
\cs_new_protected:Npn \tag_mc_begin_pop:n #1
{
\seq_gpop:NNTF \g__tag_mc_stack_seq \l__tag_tmpa_tl
{
\tl_if_eq:NnTF \l__tag_tmpa_tl {-1}
{
\__tag_check_mc_pushed_popped:nn {popped}{-1}
}
{
\__tag_check_mc_pushed_popped:nn {popped}{\l__tag_tmpa_tl}
\tag_mc_begin:n {tag=\l__tag_tmpa_tl,#1}
}
}
{ \__tag_check_mc_pushed_popped:nn {popped}{empty~stack,~nothing} } %message?
}
%%
%%
%% End of file `tagpdf-mc-code-shared.sty'.
|