summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tagpdf/tagpdf-mc-code-shared.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/tagpdf/tagpdf-mc-code-shared.sty
Initial commit
Diffstat (limited to 'macros/latex/contrib/tagpdf/tagpdf-mc-code-shared.sty')
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-mc-code-shared.sty47
1 files changed, 47 insertions, 0 deletions
diff --git a/macros/latex/contrib/tagpdf/tagpdf-mc-code-shared.sty b/macros/latex/contrib/tagpdf/tagpdf-mc-code-shared.sty
new file mode 100644
index 0000000000..b9bbe29eb3
--- /dev/null
+++ b/macros/latex/contrib/tagpdf/tagpdf-mc-code-shared.sty
@@ -0,0 +1,47 @@
+\ProvidesExplPackage {tagpdf-mc-code-shared} {2019/07/02} {0.61}
+ {part of tagpdf - code related to marking chunks - code shared by generic and luamode }
+
+% I use a latex counter for the absolute count, so that it is added to
+% \cl@@ckpt and restored e.g. in tabulars and align
+% \int_new:N \c@g__uftag_MCID_int and
+% \tl_put_right:Nn\cl@@ckpt{\@elt{g_uf_test_int}}
+% would work too, but as the name is not expl3 then too, why bother?
+% the absolute counter can be used to label and to check if the page
+% counter needs a reset.
+
+\newcounter { g__uftag_MCID_abs_int }
+\cs_new:Nn \__uftag_get_mc_abs_cnt: { \int_use:N \c@g__uftag_MCID_abs_int }
+
+% tagmcabs is the label name of the absolute count which is used to identify the chunk
+\zref@newprop {tagmcabs} [0] { \int_use:N \c@g__uftag_MCID_abs_int }
+\zref@addprop {uftagzrl} {tagmcabs}
+\zref@addprop {LastPage} {tagmcabs}
+
+%stores labels of mcid.
+\cs_new:Nn \__uftag_mc_handle_mc_label:n
+ {
+ \zref@labelbylist{tagpdf-#1}{uftagzrl}
+ }
+
+% will hold the structure numbers for the parenttree
+% key: absolute number of the mc (tagmcabs)
+% value: the structure number the mc is in
+\__uftag_prop_new:N \g__uftag_mc_parenttree_prop
+
+%shared keys
+%the rest are in the splitted code
+\tl_new:N \l__uftag_mc_artifact_type_tl
+
+\keys_define:nn { uftag / mc }
+ {
+ stash .bool_set:N = \l__uftag_mc_key_stash_bool,
+ artifact-bool .bool_set:N = \l__uftag_mc_artifact_bool,
+ artifact-type .choice:,
+ artifact-type / pagination .code:n = {\tl_set:Nn \l__uftag_mc_artifact_type_tl { Pagination }},
+ artifact-type / layout .code:n = {\tl_set:Nn \l__uftag_mc_artifact_type_tl { Layout }},
+ artifact-type / page .code:n = {\tl_set:Nn \l__uftag_mc_artifact_type_tl { Page }},
+ artifact-type / background .code:n = {\tl_set:Nn \l__uftag_mc_artifact_type_tl { Background }},
+ artifact-type / notype .code:n = {\tl_set:Nn \l__uftag_mc_artifact_type_tl {}},
+ }
+
+\endinput